Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ColorModel = color.ModelFunc(rgbModel)
ColorModel is the color model for RGB24 images, converting any color to 24-bit RGB format.
Functions ¶
This section is empty.
Types ¶
type RGB ¶
type RGB struct {
R, G, B uint8
}
RGB represents a 24-bit color consisting of red, green, and blue components. Each component is an 8-bit value, giving a total of 16,777,216 possible colors.
type RGB24 ¶
type RGB24 struct {
// Pix holds the image's pixels, in RGB order. The pixel at (x, y)
// starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*3].
Pix []uint8
// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
Stride int
// Rect is the image's bounds.
Rect image.Rectangle
}
RGB24 represents an in-memory image with 24-bit RGB color. Each pixel is stored as three consecutive bytes in RGB order. This format is commonly used for uncompressed image data from video frames.
func NewRGB24 ¶ added in v1.6.7
NewRGB24 returns a new RGB24 image with the given bounds. The image's pixels are initialized to zero (black).
func (*RGB24) At ¶
At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right pixel.
func (*RGB24) Bounds ¶
Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0).
func (*RGB24) ColorModel ¶
ColorModel returns the RGB color model.