scrollcanvas

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultScrollDelay = 50 * time.Millisecond
)

Functions

This section is empty.

Types

type ScrollCanvas

type ScrollCanvas struct {
	Matrix matrix.Matrix
	// contains filtered or unexported fields
}

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) Disable

func (c *ScrollCanvas) Disable() bool

Disable ...

func (*ScrollCanvas) Enable

func (c *ScrollCanvas) Enable() bool

Enable ...

func (*ScrollCanvas) Enabled

func (c *ScrollCanvas) Enabled() bool

Enabled ...

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) GetPadding

func (c *ScrollCanvas) GetPadding() int

GetPadding

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) Len

func (c *ScrollCanvas) Len() int

Len returns the number of canvases

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) SetPadding

func (c *ScrollCanvas) SetPadding(pad int)

SetPadding ...

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 WithMergePadding

func WithMergePadding(pad int) ScrollCanvasOption

WithMergePadding ...

func WithName

func WithName(name string) ScrollCanvasOption

func WithPreloadThreads added in v0.0.96

func WithPreloadThreads(t int) ScrollCanvasOption

func WithScrollDirection

func WithScrollDirection(direct ScrollDirection) ScrollCanvasOption

WithScrollDirection ...

func WithScrollSpeed

func WithScrollSpeed(d time.Duration) ScrollCanvasOption

WithScrollSpeed ...

type ScrollDirection

type ScrollDirection int

ScrollDirection represents the direction the canvas scrolls

const (
	// RightToLeft ...
	RightToLeft ScrollDirection = iota
	// LeftToRight ...
	LeftToRight
	// BottomToTop ...
	BottomToTop
	// TopToBottom ...
	TopToBottom
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL