RG is an in-memory image whose At method returns color.RG values.
type RG struct { // Pix holds the image's pixels, as Red values. The pixel at // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2]. Pix []uint8 // Stride is the Pix stride (in bytes) between vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
func NewRG(r image.Rectangle) *RG
NewRG returns a new RG image with the given bounds.
func (p *RG) At(x, y int) color.Color
func (p *RG) Bounds() image.Rectangle
func (p *RG) ColorModel() color.Model
func (p *RG) Opaque() bool
Opaque scans the entire image and reports whether it is fully opaque.
func (p *RG) PixOffset(x, y int) int
PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).
func (p *RG) RGAt(x, y int) xcolor.RG
func (p *RG) Set(x, y int, c color.Color)
func (p *RG) SetRG(x, y int, c xcolor.RG)
func (p *RG) SubImage(r image.Rectangle) image.Image
SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.
RGB is an in-memory image whose At method returns color.RGB values.
type RGB struct { // Pix holds the image's pixels, as Red values. The pixel at // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2]. Pix []uint8 // Stride is the Pix stride (in bytes) between vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
func NewRGB(r image.Rectangle) *RGB
NewRGB returns a new RGB image with the given bounds.
func (p *RGB) At(x, y int) color.Color
func (p *RGB) Bounds() image.Rectangle
func (p *RGB) ColorModel() color.Model
func (p *RGB) Opaque() bool
Opaque scans the entire image and reports whether it is fully opaque.
func (p *RGB) PixOffset(x, y int) int
PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).
func (p *RGB) RGBAt(x, y int) xcolor.RGB
func (p *RGB) Set(x, y int, c color.Color)
func (p *RGB) SetRGB(x, y int, c xcolor.RGB)
func (p *RGB) SubImage(r image.Rectangle) image.Image
SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.
Red is an in-memory image whose At method returns color.Red values.
type Red struct { // Pix holds the image's pixels, as Red values. The pixel at // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1]. Pix []uint8 // Stride is the Pix stride (in bytes) between vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
func NewRed(r image.Rectangle) *Red
NewRed returns a new Red image with the given bounds.
func (p *Red) At(x, y int) color.Color
func (p *Red) Bounds() image.Rectangle
func (p *Red) ColorModel() color.Model
func (p *Red) Opaque() bool
Opaque scans the entire image and reports whether it is fully opaque.
func (p *Red) PixOffset(x, y int) int
PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).
func (p *Red) RedAt(x, y int) xcolor.Red
func (p *Red) Set(x, y int, c color.Color)
func (p *Red) SetRed(x, y int, c xcolor.Red)
func (p *Red) SubImage(r image.Rectangle) image.Image
SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.
Name | Synopsis |
---|---|
xcolor | Package xcolor implements Red, RedGreen, and RGB color models matching the core image/color interface. |