fbimage

package module
v0.0.0-...-7349145 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A8Color

type A8Color struct {
	Color8
}

func ToA8Color

func ToA8Color(c color.Color) A8Color

func (A8Color) RGBA

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

type A8Image

type A8Image struct {
	*Image8
}

func NewA8Image

func NewA8Image(r image.Rectangle, stride int, buf []byte) *A8Image

func (*A8Image) At

func (i *A8Image) At(x, y int) color.Color

func (*A8Image) FillColor

func (i *A8Image) FillColor(c color.Color)

func (*A8Image) Set

func (i *A8Image) Set(x, y int, c color.Color)

func (*A8Image) SetLine

func (i *A8Image) SetLine(x1, y1, x2 int, c color.Color)

func (*A8Image) SubImage

func (i *A8Image) SubImage(r image.Rectangle) Image

type BGRA32Color

type BGRA32Color struct {
	Color32
}

func ToBGRA32Color

func ToBGRA32Color(c color.Color) BGRA32Color

func (BGRA32Color) RGBA

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

type BGRA32Image

type BGRA32Image struct {
	*Image32
}

func NewBGRA32Image

func NewBGRA32Image(r image.Rectangle, stride int, buf []byte) *BGRA32Image

func (*BGRA32Image) At

func (i *BGRA32Image) At(x, y int) color.Color

func (*BGRA32Image) FillColor

func (i *BGRA32Image) FillColor(c color.Color)

func (*BGRA32Image) Set

func (i *BGRA32Image) Set(x, y int, c color.Color)

func (*BGRA32Image) SetLine

func (i *BGRA32Image) SetLine(x1, y1, x2 int, c color.Color)

func (*BGRA32Image) SubImage

func (i *BGRA32Image) SubImage(r image.Rectangle) Image

type Color

type Color interface {
	color.Color

	Bytes() []byte
}

type Color32

type Color32 struct {
	M, N, O, P uint8
}

func NewColor32

func NewColor32(bs []byte) Color32

func (Color32) Bytes

func (c Color32) Bytes() []byte

func (Color32) RGBA

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

type Color8

type Color8 struct {
	M uint8
}

func NewColor8

func NewColor8(bs []byte) Color8

func (Color8) Bytes

func (c Color8) Bytes() []byte

func (Color8) RGBA

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

type Image

type Image interface {
	// To be compatible with standard library
	// Contains other fields that not used by fbimage
	draw.Image

	// Implemented in ImageStore
	Bounds() image.Rectangle
	FrameBuffer() []byte
	Clear()

	// Needs to be implemented by dest image impls i.e. bgra32image, ...
	// For performance & color space issues
	At(x, y int) color.Color
	Set(x, y int, c color.Color)
	FillColor(c color.Color)
	SetLine(x1, y1, x2 int, c color.Color)
	SubImage(r image.Rectangle) Image
}

type Image32

type Image32 struct {
	ImageStore
}

func NewImage32

func NewImage32(r image.Rectangle, stride int, buf []byte) *Image32

func (*Image32) AtColor

func (i *Image32) AtColor(x, y int) Color

func (*Image32) SetBytes

func (i *Image32) SetBytes(x, y int, src []byte)

type Image8

type Image8 struct {
	ImageStore
}

func NewImage8

func NewImage8(r image.Rectangle, stride int, buf []byte) *Image8

func (*Image8) AtColor

func (i *Image8) AtColor(x, y int) Color

func (*Image8) SetByte

func (i *Image8) SetByte(x, y int, b byte)

type ImageStore

type ImageStore struct {
	Pix      []byte
	CellSize int
	Stride   int
	Rect     image.Rectangle
}

ImageStore provides basic functions for upper-level image formats

func NewImageStore

func NewImageStore(cellSize int, r image.Rectangle, stride int, buf []byte) ImageStore

func (ImageStore) Bounds

func (i ImageStore) Bounds() image.Rectangle

func (ImageStore) Clear

func (i ImageStore) Clear()

func (ImageStore) ColorModel

func (i ImageStore) ColorModel() color.Model

Compatible with standard library; not used in fbimage

func (ImageStore) FrameBuffer

func (i ImageStore) FrameBuffer() []byte

func (ImageStore) PixCell

func (i ImageStore) PixCell(x, y int) ([]byte, int, bool)

func (ImageStore) SetLineBytes

func (i ImageStore) SetLineBytes(x1, y1, x2 int, src []byte)

type RGBA32Color

type RGBA32Color struct {
	Color32
}

func ToRGBA32Color

func ToRGBA32Color(c color.Color) RGBA32Color

func (RGBA32Color) RGBA

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

type RGBA32Image

type RGBA32Image struct {
	*Image32
}

func NewRGBA32Image

func NewRGBA32Image(r image.Rectangle, stride int, buf []byte) *RGBA32Image

func (*RGBA32Image) At

func (i *RGBA32Image) At(x, y int) color.Color

func (*RGBA32Image) FillColor

func (i *RGBA32Image) FillColor(c color.Color)

func (*RGBA32Image) Set

func (i *RGBA32Image) Set(x, y int, c color.Color)

func (*RGBA32Image) SetLine

func (i *RGBA32Image) SetLine(x1, y1, x2 int, c color.Color)

func (*RGBA32Image) SubImage

func (i *RGBA32Image) SubImage(r image.Rectangle) Image

Jump to

Keyboard shortcuts

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