encoding

package
v0.0.0-...-9fcebae Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Colormap

type Colormap struct {
	// contains filtered or unexported fields
}

func NewColormap

func NewColormap(colormap string) (*Colormap, error)

Create new colormap by parsing colormap string, which is a comma-delimited set of <value>:<hex> entries, e.g., "1:#AABBCC,2:#DDEEFF"

func (*Colormap) GetIndex

func (c *Colormap) GetIndex(value uint8) uint8

Returns palette index of value any values not in original colormap are set to transparent

func (*Colormap) Palette

func (c *Colormap) Palette() color.Palette

type ColormapEncoder

type ColormapEncoder struct {
	// contains filtered or unexported fields
}

func NewColormapEncoder

func NewColormapEncoder(width int, height int, colormap *Colormap) *ColormapEncoder

func (*ColormapEncoder) Encode

func (e *ColormapEncoder) Encode(buffer interface{}) ([]byte, error)

type GrayscaleEncoder

type GrayscaleEncoder struct {
	// contains filtered or unexported fields
}

func NewGrayscaleEncoder

func NewGrayscaleEncoder(width int, height int) *GrayscaleEncoder

func (*GrayscaleEncoder) Encode

func (e *GrayscaleEncoder) Encode(buffer interface{}) ([]byte, error)

Encode uint8 values to 8-bit grayscale PNG

type PNGEncoder

type PNGEncoder interface {
	Encode(buffer interface{}) ([]byte, error)
}

PNGEncoder provides an Encode() function for encoding buffer to PNG

type RGBEncoder

type RGBEncoder struct {
	// contains filtered or unexported fields
}

func NewRGBEncoder

func NewRGBEncoder(width int, height int) *RGBEncoder

func (*RGBEncoder) Encode

func (e *RGBEncoder) Encode(buffer interface{}) ([]byte, error)

Encode uint8...uint32 values to 24-bit RGB PNG

Jump to

Keyboard shortcuts

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