canvas

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	// contains filtered or unexported fields
}

Canvas is a image.Image representation of a WS281x matrix, it implements image.Image interface and can be used with draw.Draw for example

func NewCanvas

func NewCanvas(m matrix.Matrix) *Canvas

NewCanvas returns a new Canvas using the given width and height and creates a new WS281x matrix using the given config

func (*Canvas) AlwaysRender

func (c *Canvas) AlwaysRender() bool

func (*Canvas) At

func (c *Canvas) At(x, y int) color.Color

At returns the color of the pixel at (x, y)

func (*Canvas) Bounds

func (c *Canvas) Bounds() image.Rectangle

Bounds return the topology of the Canvas

func (*Canvas) Clear

func (c *Canvas) Clear() error

Clear set all the leds on the matrix with color.Black

func (*Canvas) Close

func (c *Canvas) Close() error

Close clears the matrix and close the matrix

func (*Canvas) ColorModel

func (c *Canvas) ColorModel() color.Model

ColorModel returns the canvas' color model, always color.RGBAModel

func (*Canvas) Disable

func (c *Canvas) Disable() bool

Disable ...

func (*Canvas) Enable

func (c *Canvas) Enable() bool

Enable ...

func (*Canvas) Enabled

func (c *Canvas) Enabled() bool

Enabled ...

func (*Canvas) GetHTTPHandlers

func (c *Canvas) GetHTTPHandlers() ([]*board.HTTPHandler, error)

GetHTTPHandlers ...

func (*Canvas) GetWidth

func (c *Canvas) GetWidth() int

GetWidth ...

func (*Canvas) Name

func (c *Canvas) Name() string

func (*Canvas) PaddedBounds

func (c *Canvas) PaddedBounds() image.Rectangle

func (*Canvas) Render

func (c *Canvas) Render(ctx context.Context) error

Render update the display with the data from the LED buffer

func (*Canvas) Scrollable

func (c *Canvas) Scrollable() bool

Scrollable ...

func (*Canvas) Set

func (c *Canvas) Set(x, y int, color color.Color)

Set set LED at position x,y to the provided 24-bit color value

func (*Canvas) SetStateChangeCallback

func (c *Canvas) SetStateChangeCallback(s func())

func (*Canvas) SetWidth

func (c *Canvas) SetWidth(x int)

SetWidth ...

func (*Canvas) Store

func (c *Canvas) Store(s bool) bool

Jump to

Keyboard shortcuts

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