Documentation
¶
Index ¶
Constants ¶
const ( R = iota G B NumBytePixel )
Red Green Blue an numBytePixel as constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame interface {
image.Image
ToLedStripe() LedStripe
GetSumHardwarePixel() int
SetRGBA(x, y int, c color.RGBA)
Set(x, y int, c color.Color)
RGBAAt(x, y int) color.RGBA
GetWidth() int
GetHeight() int
// contains filtered or unexported methods
}
Frame is a hardware frame
func NewCopyFrameFromImage ¶
NewCopyFrameFromImage creates a new Frame with the reference of Tiles and copies the other image contents into the frame
func NewCopyFrameWithEmptyImage ¶
NewCopyFrameWithEmptyImage creates a new Frame with the reference of Tiles but creates a new image
type LedStripe ¶
type LedStripe interface {
GetBuffer() []uint8
GetPixelLength() int
GetColorMap() map[string][]int
Compare(other LedStripe) *LedStripeCompare
}
LedStripe interface
func NewLedStripe ¶ added in v0.1.4
NewLedStripe creates a new led stripe buffer
type LedStripeCompare ¶ added in v0.1.4
type LedStripeCompare struct {
// contains filtered or unexported fields
}
LedStripeCompare holds all diffenences between old and new LedStripe buffer
func (*LedStripeCompare) GetFullColor ¶ added in v0.1.4
func (l *LedStripeCompare) GetFullColor() Pixel
GetFullColor returns nil when no fullColor is available, otherwise the Pixel
func (*LedStripeCompare) GetOtherDiffPixels ¶ added in v0.1.4
func (l *LedStripeCompare) GetOtherDiffPixels() []int
GetOtherDiffPixels returns the slice of changed pixels
func (*LedStripeCompare) HasChanged ¶ added in v0.1.4
func (l *LedStripeCompare) HasChanged() bool
HasChanged returns true when a change happened
type Pixel ¶
type Pixel interface {
color.Color
Equals(color.Color) bool
Slice() []uint8
Int() int
Hex() string
}
Pixel interface implements color interface
func NewPixelFromColor ¶ added in v0.1.4
NewPixelFromColor creates a new rgb byte struct from color.Color
func NewPixelFromHex ¶ added in v0.1.4
NewPixelFromHex parses a "html" hex color-string, either in the 3 "#f0c" or 6 "#ff1034" digits form.
func NewPixelFromInt ¶
NewPixelFromInt creates a new rgb byte struct from integer
func NewPixelFromInts ¶
NewPixelFromInts creates a new rgb byte struct from single ints
func NewPixelFromSlice ¶
NewPixelFromSlice creates a new rgb byte struct from uint8 slice