Documentation ¶
Overview ¶
Quant provides an interface for image color quantizers.
Quant provides an interface for image color quantizers.
Quant provides an interface for image color quantizers.
Index ¶
Constants ¶
const ( TLeaf = iota TSplitR TSplitG TSplitB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinearPalette ¶
type LinearPalette struct { // Convert method of Palette satisfied by method of color.Palette. color.Palette }
LinearPalette implements the Palette interface with color.Palette and has no optimizations.
func (LinearPalette) ColorPalette ¶
func (p LinearPalette) ColorPalette() color.Palette
ColorPalette satisfies interface Palette.
It simply returns the internal color.Palette.
type Palette ¶
type Palette interface { IndexNear(color.Color) int ColorNear(color.Color) color.Color ColorPalette() color.Palette }
Palette is a palette of color.Colors, much like color.Pallete of the standard library.
It is defined as an interface here to allow more general implementations, presumably ones that maintain some data structure to achieve performance advantages over linear search.
type Quantizer ¶
type Quantizer interface { // Image quantizes an image and returns a paletted image. Image(image.Image) *image.Paletted // Palette quantizes an image and returns a Palette. Note the return // type is the Palette interface of this package and not image.Palette. Palette(image.Image) Palette }
Quantizer defines a color quantizer for images.
type TreePalette ¶
type TreePalette struct { Type int // for TLeaf Index int Color color.RGBA64 // for TSplit Split uint32 Low, High *TreePalette }
func (*TreePalette) ColorPalette ¶
func (t *TreePalette) ColorPalette() (p color.Palette)