Documentation ¶
Index ¶
Constants ¶
const HeaderSize = 28
HeaderSize is the size of the Header structure, in bytes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Area ¶
type Area [4]int16
Area is a placeholder for either a rectangle, or an anchoring point (first two entries).
type Bitmap ¶
Bitmap describes a palette based image.
type Bitmapper ¶ added in v0.6.0
type Bitmapper struct {
// contains filtered or unexported fields
}
Bitmapper creates bitmap images from generic images.
func NewBitmapper ¶ added in v0.6.0
NewBitmapper returns a new bitmapper instance based on the given palette.
type Flag ¶
type Flag uint16
Flag adds further properties
const ( // FlagTransparent is set for bitmaps that shall treat palette index 0x00 as fully transparent. FlagTransparent Flag = 0x0001 )
Flag constants
type Header ¶
type Header struct { Type Type Flags Flag Width int16 Height int16 Stride uint16 WidthFactor byte HeightFactor byte Area Area PaletteOffset int32 // contains filtered or unexported fields }
Header contains the meta information for a bitmap.
type Palette ¶
type Palette [256]RGB
Palette describes a list of colors to be used by bitmaps. It is an array of 256 RGB values.
type PaletteCache ¶
type PaletteCache struct {
// contains filtered or unexported fields
}
PaletteCache retrieves palettes from a localizer and keeps them decoded until they are invalidated.
func NewPaletteCache ¶
func NewPaletteCache(localizer resource.Localizer) *PaletteCache
NewPaletteCache returns a new instance.
func (*PaletteCache) InvalidateResources ¶
func (cache *PaletteCache) InvalidateResources(ids []resource.ID)
InvalidateResources lets the cache remove any palettes from resources that are specified in the given slice.
type Type ¶
type Type byte
Type describes the data layout of a bitmap.
const ( // TypeFlat8Bit bitmaps are 8-bit paletted bitmaps that have their pixel stored in a flat layout. TypeFlat8Bit Type = 2 // TypeCompressed8Bit bitmaps are 8-bit paletted bitmaps that have their pixel compressed in storage. // Compression is using run-length-encoding (RLE); See package rle. TypeCompressed8Bit Type = 4 )
Type constants