Documentation
¶
Overview ¶
Package pix represents pixels and provide palette extraction for a list of pixels.
Package pix ...
Package pix represents a single pixel - its color value and location in an HSV color space.
Package pix ...
Index ¶
- func ColorToHSVSpace(color blcolor.Color) (float64, float64, float64)
- func HSVSpaceToColor(x, y, z float64) blcolor.Color
- func PaletteFromColorList(colors blcolor.Palette, k int, method PaletteMethod) blcolor.Palette
- func PaletteFromPixelList(pixels PixelList, k int, method PaletteMethod) blcolor.Palette
- type PaletteMethod
- type Pixel
- type PixelList
- func (p *PixelList) Add(pixel *Pixel)
- func (p *PixelList) AddColor(color blcolor.Color)
- func (p *PixelList) AddColors(colors blcolor.Palette)
- func (p *PixelList) AddNullPixel(x, y, z float64)
- func (p PixelList) Average() *Pixel
- func (p PixelList) Equal(p1 PixelList) bool
- func (p PixelList) Reset()
- func (p PixelList) Reverse()
- func (p PixelList) RotateX(angle float64)
- func (p PixelList) RotateY(angle float64)
- func (p PixelList) RotateZ(angle float64)
- func (p PixelList) Scale(s float64)
- func (p PixelList) Sort()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorToHSVSpace ¶
ColorToHSVSpace converts a color value to HSV color space coordinates.
func HSVSpaceToColor ¶
HSVSpaceToColor returns a color from a set of HSV color space coordinates.
func PaletteFromColorList ¶
PaletteFromColorList generates a palette from a list of colors.
func PaletteFromPixelList ¶
func PaletteFromPixelList(pixels PixelList, k int, method PaletteMethod) blcolor.Palette
PaletteFromPixelList generates a palette from a list of Pixels.
Types ¶
type PaletteMethod ¶
type PaletteMethod int
PaletteMethod is the method used to determine which color value to pick from each cluster for the palette.
const ( PaletteMethodAverage PaletteMethod = iota PaletteMethodClosest PaletteMethodRandom )
PaletteMethods are the three different PaletteMethods.
type Pixel ¶
Pixel is a single pixel, color value and location in HSV color space.
func NewNullPixel ¶
NewNullPixel creates a new pixel with a specified HSV color space location, but black color.
func NewPixel ¶
NewPixel creates a new pixel from a color value, calculating its initial space in 3d
func (*Pixel) ProjectWithScale ¶
ProjectWithScale projects a pixel to a screen x, y coordinate and also passes back the scale value.
type PixelList ¶
type PixelList []*Pixel
PixelList is a list of pixels.
func NewPixelListFromColors ¶
NewPixelListFromColors creates a new PixelList from a list of colors.
func (*PixelList) AddColors ¶
AddColors adds a new pixel to this list for each color in the given color list.
func (*PixelList) AddNullPixel ¶
AddNullPixel adds a null pixel to this list at the given coords.
func (PixelList) Average ¶
Average finds the average (mean) location of all the pixels in this list.
func (PixelList) Reset ¶
func (p PixelList) Reset()
Reset resets all the pixels in this list to their initial values.
func (PixelList) Reverse ¶
func (p PixelList) Reverse()
Reverse reverses the order of this PixelList.