Documentation ¶
Index ¶
- Variables
- type ScrollCanvas
- func (c *ScrollCanvas) AddCanvas(add draw.Image)
- func (c *ScrollCanvas) AlwaysRender() bool
- func (c *ScrollCanvas) Append(other *ScrollCanvas)
- func (c *ScrollCanvas) AppendAndGC(other *ScrollCanvas)
- func (c *ScrollCanvas) At(x int, y int) color.Color
- func (c *ScrollCanvas) Bounds() image.Rectangle
- func (c *ScrollCanvas) Clear() error
- func (c *ScrollCanvas) Close() error
- func (c *ScrollCanvas) ColorModel() color.Model
- func (c *ScrollCanvas) Disable() bool
- func (c *ScrollCanvas) Enable() bool
- func (c *ScrollCanvas) Enabled() bool
- func (c *ScrollCanvas) GC()
- func (c *ScrollCanvas) GetActual() *image.RGBA
- func (c *ScrollCanvas) GetHTTPHandlers() ([]*board.HTTPHandler, error)
- func (c *ScrollCanvas) GetPadding() int
- func (c *ScrollCanvas) GetScrollDirection() ScrollDirection
- func (c *ScrollCanvas) GetScrollSpeed() time.Duration
- func (c *ScrollCanvas) GetWidth() int
- func (c *ScrollCanvas) Len() int
- func (c *ScrollCanvas) MatchScroll(ctx context.Context, match *ScrollCanvas)
- func (c *ScrollCanvas) Name() string
- func (c *ScrollCanvas) PrepareSubCanvases()
- func (c *ScrollCanvas) Render(ctx context.Context) error
- func (c *ScrollCanvas) RenderWithStatus(ctx context.Context, status chan float64) error
- func (c *ScrollCanvas) Scrollable() bool
- func (c *ScrollCanvas) Set(x int, y int, color color.Color)
- func (c *ScrollCanvas) SetPadding(pad int)
- func (c *ScrollCanvas) SetScrollDirection(d ScrollDirection)
- func (c *ScrollCanvas) SetScrollSpeed(d time.Duration)
- func (c *ScrollCanvas) SetStateChangeCallback(s func())
- func (c *ScrollCanvas) SetWidth(w int)
- func (c *ScrollCanvas) Store(s bool) bool
- func (c *ScrollCanvas) Width() int
- type ScrollCanvasOption
- type ScrollDirection
Constants ¶
This section is empty.
Variables ¶
var (
DefaultScrollDelay = 50 * time.Millisecond
)
Functions ¶
This section is empty.
Types ¶
type ScrollCanvas ¶
func NewScrollCanvas ¶
func NewScrollCanvas(m matrix.Matrix, logger *zap.Logger, opts ...ScrollCanvasOption) (*ScrollCanvas, error)
func (*ScrollCanvas) AddCanvas ¶
func (c *ScrollCanvas) AddCanvas(add draw.Image)
func (*ScrollCanvas) AlwaysRender ¶
func (c *ScrollCanvas) AlwaysRender() bool
func (*ScrollCanvas) Append ¶
func (c *ScrollCanvas) Append(other *ScrollCanvas)
Append the actual canvases of another ScrollCanvas to this one
func (*ScrollCanvas) AppendAndGC ¶
func (c *ScrollCanvas) AppendAndGC(other *ScrollCanvas)
Append the actual canvases of another ScrollCanvas to this one
func (*ScrollCanvas) At ¶
func (c *ScrollCanvas) At(x int, y int) color.Color
At returns the color of the pixel at (x, y)
func (*ScrollCanvas) Bounds ¶
func (c *ScrollCanvas) Bounds() image.Rectangle
Bounds return the topology of the Canvas
func (*ScrollCanvas) Clear ¶
func (c *ScrollCanvas) Clear() error
Clear set all the leds on the matrix with color.Black
func (*ScrollCanvas) Close ¶
func (c *ScrollCanvas) Close() error
Close clears the matrix and close the matrix
func (*ScrollCanvas) ColorModel ¶
func (c *ScrollCanvas) ColorModel() color.Model
ColorModel returns the canvas' color model, always color.RGBAModel
func (*ScrollCanvas) GC ¶
func (c *ScrollCanvas) GC()
GC clears out the underlying struct fields that hold image data. This should be called whenever a ScrollCanvas is used that is not Rendered at some point or after Rendering
func (*ScrollCanvas) GetActual ¶
func (c *ScrollCanvas) GetActual() *image.RGBA
func (*ScrollCanvas) GetHTTPHandlers ¶
func (c *ScrollCanvas) GetHTTPHandlers() ([]*board.HTTPHandler, error)
GetHTTPHandlers ...
func (*ScrollCanvas) GetScrollDirection ¶
func (c *ScrollCanvas) GetScrollDirection() ScrollDirection
GetScrollDirection ...
func (*ScrollCanvas) GetScrollSpeed ¶
func (c *ScrollCanvas) GetScrollSpeed() time.Duration
GetScrollSpeed ...
func (*ScrollCanvas) GetWidth ¶
func (c *ScrollCanvas) GetWidth() int
func (*ScrollCanvas) MatchScroll ¶
func (c *ScrollCanvas) MatchScroll(ctx context.Context, match *ScrollCanvas)
MatchScroll will match the scroll speed of this canvas from the given one. It will block until the context is canceled
func (*ScrollCanvas) Name ¶
func (c *ScrollCanvas) Name() string
func (*ScrollCanvas) PrepareSubCanvases ¶
func (c *ScrollCanvas) PrepareSubCanvases()
PrepareSubCanvases
func (*ScrollCanvas) Render ¶
func (c *ScrollCanvas) Render(ctx context.Context) error
Render update the display with the data from the LED buffer
func (*ScrollCanvas) RenderWithStatus ¶
func (c *ScrollCanvas) RenderWithStatus(ctx context.Context, status chan float64) error
RenderWithStatus update the display with the data from the LED buffer
func (*ScrollCanvas) Scrollable ¶
func (c *ScrollCanvas) Scrollable() bool
func (*ScrollCanvas) Set ¶
func (c *ScrollCanvas) Set(x int, y int, color color.Color)
Set set LED at position x,y to the provided 24-bit color value
func (*ScrollCanvas) SetScrollDirection ¶
func (c *ScrollCanvas) SetScrollDirection(d ScrollDirection)
SetScrollDirection ...
func (*ScrollCanvas) SetScrollSpeed ¶
func (c *ScrollCanvas) SetScrollSpeed(d time.Duration)
SetScrollSpeed ...
func (*ScrollCanvas) SetStateChangeCallback ¶
func (c *ScrollCanvas) SetStateChangeCallback(s func())
func (*ScrollCanvas) SetWidth ¶
func (c *ScrollCanvas) SetWidth(w int)
func (*ScrollCanvas) Store ¶
func (c *ScrollCanvas) Store(s bool) bool
func (*ScrollCanvas) Width ¶
func (c *ScrollCanvas) Width() int
type ScrollCanvasOption ¶
type ScrollCanvasOption func(*ScrollCanvas) error
func WithName ¶
func WithName(name string) ScrollCanvasOption
func WithScrollDirection ¶
func WithScrollDirection(direct ScrollDirection) ScrollCanvasOption
WithScrollDirection ...
type ScrollDirection ¶
type ScrollDirection int
ScrollDirection represents the direction the canvas scrolls
const ( // RightToLeft ... RightToLeft ScrollDirection = iota // LeftToRight ... LeftToRight // BottomToTop ... BottomToTop // TopToBottom ... TopToBottom )