pixmap

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	R   uint16
	G   uint16
	B   uint16
	Max Model
}

Color represents a gray color in any depth.

func (Color) RGBA

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

type Image

type Image struct {
	Pix    []uint8
	Stride int
	Rect   image.Rectangle
	Max    Model
}

Image represents a Pix Map image.

func New

func New(r image.Rectangle, m Model) *Image

New returns a new Image with the given bounds and maximum value.

func (*Image) At

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

func (*Image) Bounds

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

Bounds implements image.Image.

func (*Image) ColorModel

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

ColorModel implements image.Image.

func (*Image) PixAt

func (img *Image) PixAt(x, y int) Color

func (*Image) Set

func (img *Image) Set(x, y int, c color.Color)

func (*Image) SetPix

func (img *Image) SetPix(x, y int, c Color)

type Model

type Model uint16

Model represents a gray color model.

func (Model) Convert

func (m Model) Convert(c color.Color) color.Color

Jump to

Keyboard shortcuts

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