board

package
v0.0.65 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlankCanvas added in v0.0.14

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

BlankCanvas is a board.Canvas type that does not render

func NewBlankCanvas added in v0.0.14

func NewBlankCanvas(width int, height int, logger *zap.Logger) *BlankCanvas

NewBlankCanvas ...

func (*BlankCanvas) AlwaysRender added in v0.0.29

func (i *BlankCanvas) AlwaysRender() bool

AlwaysRender ...

func (*BlankCanvas) At added in v0.0.14

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

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

func (*BlankCanvas) Bounds added in v0.0.14

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

Bounds return the topology of the Canvas

func (*BlankCanvas) Clear added in v0.0.14

func (i *BlankCanvas) Clear() error

Clear sets the canvas to all black

func (*BlankCanvas) Close added in v0.0.14

func (i *BlankCanvas) Close() error

Close ...

func (*BlankCanvas) ColorModel added in v0.0.14

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

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

func (*BlankCanvas) Disable added in v0.0.14

func (i *BlankCanvas) Disable()

Disable ...

func (*BlankCanvas) Enable added in v0.0.14

func (i *BlankCanvas) Enable()

Enable ...

func (*BlankCanvas) Enabled added in v0.0.14

func (i *BlankCanvas) Enabled() bool

Enabled ...

func (*BlankCanvas) GetHTTPHandlers added in v0.0.14

func (i *BlankCanvas) GetHTTPHandlers() ([]*HTTPHandler, error)

GetHTTPHandlers ...

func (*BlankCanvas) Name added in v0.0.14

func (i *BlankCanvas) Name() string

Name ...

func (*BlankCanvas) Render added in v0.0.14

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

Render stores the state of the image as a PNG

func (*BlankCanvas) Scrollable added in v0.0.29

func (i *BlankCanvas) Scrollable() bool

Scrollable ...

func (*BlankCanvas) Set added in v0.0.14

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

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

type Board

type Board interface {
	Enabler
	Name() string
	Render(ctx context.Context, canvases Canvas) error
	GetHTTPHandlers() ([]*HTTPHandler, error)
	ScrollMode() bool
	GetRPCHandler() (string, http.Handler)
}

Board is the interface to implement for displaying on the matrix

type Canvas added in v0.0.7

type Canvas interface {
	image.Image
	draw.Image
	Enabler
	Name() string
	Clear() error
	Render(ctx context.Context) error
	GetHTTPHandlers() ([]*HTTPHandler, error)
	Close() error
	Scrollable() bool
	AlwaysRender() bool
}

Canvas ...

type Enabler added in v0.0.8

type Enabler interface {
	Enabled() bool
	Enable()
	Disable()
}

Enabler is an interface for basic Enable/Disable functions

type HTTPHandler

type HTTPHandler struct {
	Handler func(http.ResponseWriter, *http.Request)
	Path    string
}

HTTPHandler is the type returned to the sportsmatrix for HTTP endpoints

Jump to

Keyboard shortcuts

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