rgb565

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Model = color.ModelFunc(rgb565Model)

Model is the Model for RGB565 colors.

Functions

This section is empty.

Types

type Color

type Color struct {
	RGB565 uint16
}

Color represents a RGB565 color.

func (Color) RGBA

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

type RGB565

type RGB565 struct {
	// Pix holds the image's pixels, as RGB565 values in big-endian format. The pixel at
	// (x, y) starts at Pix[(y-p.Rect.Min.Y)*p.Stride + (x-p.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
}

RGBA is an in-memory image whose At method returns color.RGBA values.

func NewRGB565

func NewRGB565(r image.Rectangle) *RGB565

NewRGB565 returns a new RGB565 image with the given bounds.

func (*RGB565) At

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

func (*RGB565) Bounds

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

func (*RGB565) ColorModel

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

func (*RGB565) PixOffset

func (p *RGB565) PixOffset(x, y int) int

func (*RGB565) Set

func (p *RGB565) Set(x, y int, c color.Color)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL