Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractIndex ¶
ExtractIndex returns some bits form a byte array, being able to go across byte boundaries. The slice is interpreted in ascending order. The length is interpreted as slicing the slice into fixed length items and the zero-based index refers to the item of index n.
The maximum length allowed is 7. As 8 bit would be simply accessing the byte slice and more than 8 byte is not supported.
It needs to be verified before that (index+1)*length <= len(bytes)*8 either by convention or by testing.
func ExtractVector ¶
ExtractVector return some bits form a byte array, being able to go across byte boundaries. The slice is interpreted in ascending order. The shift is interpreted as the total number of bits before the value and the length is the amount of bits to read and to return.
The maximum length allowed is 7. As 8 bit would be simply accessing the byte slice and more than 8 byte is not supported.
It needs to be verified before that shift+length <= len(bytes)*8 either by convention or by testing.
func InterpolateColors ¶
InterpolateColors interpolates two 565 color values to 4 color.NRGBA values. Each color needs to be two bytes wide and formatted as 565 color. It will compare both values and decide how the interpolation is handled.
Types ¶
type ColorDecoder ¶
type ColorDecoder struct {
// contains filtered or unexported fields
}
func (*ColorDecoder) BlockColor ¶
func (cd *ColorDecoder) BlockColor(colorsBlock []byte)
func (*ColorDecoder) PixelAlpha ¶
func (cd *ColorDecoder) PixelAlpha(pixelIndex, alpha byte) color.NRGBA
func (*ColorDecoder) PixelColor ¶
func (cd *ColorDecoder) PixelColor(pixelIndex byte) color.NRGBA