Documentation ¶
Index ¶
- Constants
- Variables
- func BlueColor(color uint16) uint8
- func GetPalette(img image.Image, maxCubes int) ([]color.Color, []int, error)
- func GetRGB(color uint16) (uint8, uint8, uint8)
- func GreenColor(color uint16) uint8
- func NewPriorityQueue(maxSize int) *priorityQueue
- func RGB(r uint8, g uint8, b uint8) uint16
- func RedColor(color uint16) uint8
- type ColorCube
- func (cube ColorCube) Clone() ColorCube
- func (cube ColorCube) GetColor(hist []int) color.RGBA
- func (cube *ColorCube) Len() int
- func (cube *ColorCube) Less(i, j int) bool
- func (cube ColorCube) Rank() int
- func (cube *ColorCube) Shrink()
- func (cube *ColorCube) Swap(i, j int)
- func (cube ColorCube) Volume() int
- type LongestColor
Constants ¶
View Source
const (
// HistogramSize is the maximum number of 16 bit colors
HistogramSize = 32768
)
Variables ¶
View Source
var ErrEmpty = errors.New("Empty")
Functions ¶
func GetPalette ¶
GetPalette return cluster similar colors by the median cut algorithm
func GreenColor ¶
GreenColor return green value from uint16 color
func NewPriorityQueue ¶
func NewPriorityQueue(maxSize int) *priorityQueue
NewPriorityQueue return a maximum heap
Types ¶
type ColorCube ¶
type ColorCube struct { Count int // number of pixels Level int // cutting depth Longest LongestColor // RGB cube's longest edge RMin, RMax, GMin, GMax, BMin, BMax uint8 // range of RGB value Hist []uint16 }
type LongestColor ¶
type LongestColor int
const ( LongRed LongestColor = iota + 1 LongGreen LongBlue )
Click to show internal directories.
Click to hide internal directories.