Version: v0.0.0-...-6fbabd1 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0



Package rgb provides RGB image which implements image.Image interface.



This section is empty.


View Source
var ColorModel = color.ModelFunc(rgbModel)

ColorModel is RGB color model instance


This section is empty.


type Image

type Image struct {
	// Pix holds the image's stream, in R, G, B order.
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle

Image represent image data which has RGB colors. Image is compatible with image.RGBA, but does not have alpha channel to reduce using memory.

func NewImage

func NewImage(r image.Rectangle) *Image

NewImage allocates and returns RGB image

func (*Image) At

func (p *Image) At(x, y int) color.Color

At implements image.Image.At

func (*Image) Bounds

func (p *Image) Bounds() image.Rectangle

Bounds implements image.Image.At

func (*Image) ColorModel

func (p *Image) ColorModel() color.Model

ColorModel returns RGB color model.

func (*Image) RGBAAt

func (p *Image) RGBAAt(x, y int) color.RGBA

RGBAAt returns the color of the pixel at (x, y) as RGBA.

type RGB

type RGB struct {
	R, G, B uint8

RGB color

func (RGB) RGBA

func (c RGB) RGBA() (r, g, b, a uint32)

RGBA implements Color.RGBA

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL