Source File
image.go
Belonging Package
image
package image
import (
)
Rect Rectangle
}
func ( *RGBA) () color.Model { return color.RGBAModel }
func ( *RGBA) () Rectangle { return .Rect }
func ( *RGBA) (, int) color.Color {
return .RGBAAt(, )
}
func ( *RGBA) (, int) color.RGBA {
if !(Point{, }.In(.Rect)) {
return color.RGBA{}
}
:= .PixOffset(, )
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
return color.RGBA{[0], [1], [2], [3]}
}
func ( *RGBA) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*4
}
func ( *RGBA) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= color.RGBAModel.Convert().(color.RGBA)
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
[0] = .R
[1] = .G
[2] = .B
[3] = .A
}
func ( *RGBA) (, int, color.RGBA) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
[0] = .R
[1] = .G
[2] = .B
[3] = .A
}
Rect Rectangle
}
func ( *RGBA64) () color.Model { return color.RGBA64Model }
func ( *RGBA64) () Rectangle { return .Rect }
func ( *RGBA64) (, int) color.Color {
return .RGBA64At(, )
}
func ( *RGBA64) (, int) color.RGBA64 {
if !(Point{, }.In(.Rect)) {
return color.RGBA64{}
}
:= .PixOffset(, )
:= .Pix[ : +8 : +8] // Small cap improves performance, see https://golang.org/issue/27857
return color.RGBA64{
uint16([0])<<8 | uint16([1]),
uint16([2])<<8 | uint16([3]),
uint16([4])<<8 | uint16([5]),
uint16([6])<<8 | uint16([7]),
}
}
func ( *RGBA64) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*8
}
func ( *RGBA64) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= color.RGBA64Model.Convert().(color.RGBA64)
:= .Pix[ : +8 : +8] // Small cap improves performance, see https://golang.org/issue/27857
[0] = uint8(.R >> 8)
[1] = uint8(.R)
[2] = uint8(.G >> 8)
[3] = uint8(.G)
[4] = uint8(.B >> 8)
[5] = uint8(.B)
[6] = uint8(.A >> 8)
[7] = uint8(.A)
}
func ( *RGBA64) (, int, color.RGBA64) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= .Pix[ : +8 : +8] // Small cap improves performance, see https://golang.org/issue/27857
[0] = uint8(.R >> 8)
[1] = uint8(.R)
[2] = uint8(.G >> 8)
[3] = uint8(.G)
[4] = uint8(.B >> 8)
[5] = uint8(.B)
[6] = uint8(.A >> 8)
[7] = uint8(.A)
}
Rect Rectangle
}
func ( *NRGBA) () color.Model { return color.NRGBAModel }
func ( *NRGBA) () Rectangle { return .Rect }
func ( *NRGBA) (, int) color.Color {
return .NRGBAAt(, )
}
func ( *NRGBA) (, int) color.NRGBA {
if !(Point{, }.In(.Rect)) {
return color.NRGBA{}
}
:= .PixOffset(, )
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
return color.NRGBA{[0], [1], [2], [3]}
}
func ( *NRGBA) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*4
}
func ( *NRGBA) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= color.NRGBAModel.Convert().(color.NRGBA)
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
[0] = .R
[1] = .G
[2] = .B
[3] = .A
}
func ( *NRGBA) (, int, color.NRGBA) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
[0] = .R
[1] = .G
[2] = .B
[3] = .A
}
Rect Rectangle
}
func ( *NRGBA64) () color.Model { return color.NRGBA64Model }
func ( *NRGBA64) () Rectangle { return .Rect }
func ( *NRGBA64) (, int) color.Color {
return .NRGBA64At(, )
}
func ( *NRGBA64) (, int) color.NRGBA64 {
if !(Point{, }.In(.Rect)) {
return color.NRGBA64{}
}
:= .PixOffset(, )
:= .Pix[ : +8 : +8] // Small cap improves performance, see https://golang.org/issue/27857
return color.NRGBA64{
uint16([0])<<8 | uint16([1]),
uint16([2])<<8 | uint16([3]),
uint16([4])<<8 | uint16([5]),
uint16([6])<<8 | uint16([7]),
}
}
func ( *NRGBA64) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*8
}
func ( *NRGBA64) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= color.NRGBA64Model.Convert().(color.NRGBA64)
:= .Pix[ : +8 : +8] // Small cap improves performance, see https://golang.org/issue/27857
[0] = uint8(.R >> 8)
[1] = uint8(.R)
[2] = uint8(.G >> 8)
[3] = uint8(.G)
[4] = uint8(.B >> 8)
[5] = uint8(.B)
[6] = uint8(.A >> 8)
[7] = uint8(.A)
}
func ( *NRGBA64) (, int, color.NRGBA64) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= .Pix[ : +8 : +8] // Small cap improves performance, see https://golang.org/issue/27857
[0] = uint8(.R >> 8)
[1] = uint8(.R)
[2] = uint8(.G >> 8)
[3] = uint8(.G)
[4] = uint8(.B >> 8)
[5] = uint8(.B)
[6] = uint8(.A >> 8)
[7] = uint8(.A)
}
Rect Rectangle
}
func ( *Alpha) () color.Model { return color.AlphaModel }
func ( *Alpha) () Rectangle { return .Rect }
func ( *Alpha) (, int) color.Color {
return .AlphaAt(, )
}
func ( *Alpha) (, int) color.Alpha {
if !(Point{, }.In(.Rect)) {
return color.Alpha{}
}
:= .PixOffset(, )
return color.Alpha{.Pix[]}
}
func ( *Alpha) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*1
}
func ( *Alpha) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
.Pix[] = color.AlphaModel.Convert().(color.Alpha).A
}
func ( *Alpha) (, int, color.Alpha) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
.Pix[] = .A
}
Rect Rectangle
}
func ( *Alpha16) () color.Model { return color.Alpha16Model }
func ( *Alpha16) () Rectangle { return .Rect }
func ( *Alpha16) (, int) color.Color {
return .Alpha16At(, )
}
func ( *Alpha16) (, int) color.Alpha16 {
if !(Point{, }.In(.Rect)) {
return color.Alpha16{}
}
:= .PixOffset(, )
return color.Alpha16{uint16(.Pix[+0])<<8 | uint16(.Pix[+1])}
}
func ( *Alpha16) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*2
}
func ( *Alpha16) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= color.Alpha16Model.Convert().(color.Alpha16)
.Pix[+0] = uint8(.A >> 8)
.Pix[+1] = uint8(.A)
}
func ( *Alpha16) (, int, color.Alpha16) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
.Pix[+0] = uint8(.A >> 8)
.Pix[+1] = uint8(.A)
}
Rect Rectangle
}
func ( *Gray) () color.Model { return color.GrayModel }
func ( *Gray) () Rectangle { return .Rect }
func ( *Gray) (, int) color.Color {
return .GrayAt(, )
}
func ( *Gray) (, int) color.Gray {
if !(Point{, }.In(.Rect)) {
return color.Gray{}
}
:= .PixOffset(, )
return color.Gray{.Pix[]}
}
func ( *Gray) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*1
}
func ( *Gray) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
.Pix[] = color.GrayModel.Convert().(color.Gray).Y
}
func ( *Gray) (, int, color.Gray) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
.Pix[] = .Y
}
Rect Rectangle
}
func ( *Gray16) () color.Model { return color.Gray16Model }
func ( *Gray16) () Rectangle { return .Rect }
func ( *Gray16) (, int) color.Color {
return .Gray16At(, )
}
func ( *Gray16) (, int) color.Gray16 {
if !(Point{, }.In(.Rect)) {
return color.Gray16{}
}
:= .PixOffset(, )
return color.Gray16{uint16(.Pix[+0])<<8 | uint16(.Pix[+1])}
}
func ( *Gray16) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*2
}
func ( *Gray16) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= color.Gray16Model.Convert().(color.Gray16)
.Pix[+0] = uint8(.Y >> 8)
.Pix[+1] = uint8(.Y)
}
func ( *Gray16) (, int, color.Gray16) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
.Pix[+0] = uint8(.Y >> 8)
.Pix[+1] = uint8(.Y)
}
Rect Rectangle
}
func ( *CMYK) () color.Model { return color.CMYKModel }
func ( *CMYK) () Rectangle { return .Rect }
func ( *CMYK) (, int) color.Color {
return .CMYKAt(, )
}
func ( *CMYK) (, int) color.CMYK {
if !(Point{, }.In(.Rect)) {
return color.CMYK{}
}
:= .PixOffset(, )
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
return color.CMYK{[0], [1], [2], [3]}
}
func ( *CMYK) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*4
}
func ( *CMYK) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= color.CMYKModel.Convert().(color.CMYK)
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
[0] = .C
[1] = .M
[2] = .Y
[3] = .K
}
func ( *CMYK) (, int, color.CMYK) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
:= .Pix[ : +4 : +4] // Small cap improves performance, see https://golang.org/issue/27857
[0] = .C
[1] = .M
[2] = .Y
[3] = .K
}
func ( *Paletted) (, int) int {
return (-.Rect.Min.Y)*.Stride + (-.Rect.Min.X)*1
}
func ( *Paletted) (, int, color.Color) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
.Pix[] = uint8(.Palette.Index())
}
func ( *Paletted) (, int) uint8 {
if !(Point{, }.In(.Rect)) {
return 0
}
:= .PixOffset(, )
return .Pix[]
}
func ( *Paletted) (, int, uint8) {
if !(Point{, }.In(.Rect)) {
return
}
:= .PixOffset(, )
.Pix[] =
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |