imgcanvas

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

This section is empty.

Functions

This section is empty.

Types

type ImgCanvas

type ImgCanvas struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ImgCanvas is a board.Canvas type that just stores the state as an image.Image

func New

func New(width int, height int, logger *zap.Logger) *ImgCanvas

New ...

func (*ImgCanvas) AlwaysRender

func (i *ImgCanvas) AlwaysRender() bool

AlwaysRender ...

func (*ImgCanvas) At

func (i *ImgCanvas) At(x, y int) color.Color

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

func (*ImgCanvas) Bounds

func (i *ImgCanvas) Bounds() image.Rectangle

Bounds return the topology of the Canvas

func (*ImgCanvas) Clear

func (i *ImgCanvas) Clear() error

Clear sets the canvas to all black

func (*ImgCanvas) Close

func (i *ImgCanvas) Close() error

Close ...

func (*ImgCanvas) ColorModel

func (i *ImgCanvas) ColorModel() color.Model

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

func (*ImgCanvas) Disable

func (i *ImgCanvas) Disable() bool

Disable ...

func (*ImgCanvas) Enable

func (i *ImgCanvas) Enable() bool

Enable ...

func (*ImgCanvas) Enabled

func (i *ImgCanvas) Enabled() bool

Enabled ...

func (*ImgCanvas) GetHTTPHandlers

func (i *ImgCanvas) GetHTTPHandlers() ([]*board.HTTPHandler, error)

GetHTTPHandlers ...

func (*ImgCanvas) GetWidth

func (i *ImgCanvas) GetWidth() int

GetWidth ...

func (*ImgCanvas) Name

func (i *ImgCanvas) Name() string

Name ...

func (*ImgCanvas) Render

func (i *ImgCanvas) Render(ctx context.Context) error

Render stores the state of the image as a PNG

func (*ImgCanvas) Scrollable

func (i *ImgCanvas) Scrollable() bool

Scrollable ...

func (*ImgCanvas) Set

func (i *ImgCanvas) Set(x, y int, clr color.Color)

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

func (*ImgCanvas) SetStateChangeCallback

func (i *ImgCanvas) SetStateChangeCallback(s func())

func (*ImgCanvas) SetWidth

func (i *ImgCanvas) SetWidth(x int)

SetWidth ...

func (*ImgCanvas) Store

func (i *ImgCanvas) Store(s bool) bool

Jump to

Keyboard shortcuts

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