matrix

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 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 ConsoleMatrix

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

ConsoleMatrix prints a representation of a matrix to a terminal. Useful for testing layouts without a Pi or an LED matrix.

func NewConsoleMatrix

func NewConsoleMatrix(width int, height int, out io.Writer, logger *zap.Logger) *ConsoleMatrix

NewConsoleMatrix ...

func (*ConsoleMatrix) At

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

At ...

func (*ConsoleMatrix) Close

func (c *ConsoleMatrix) Close() error

Close ...

func (*ConsoleMatrix) Geometry

func (c *ConsoleMatrix) Geometry() (int, int)

Geometry ...

func (*ConsoleMatrix) Play

func (c *ConsoleMatrix) Play(ctx context.Context, startInterval time.Duration, interval <-chan time.Duration) error

func (*ConsoleMatrix) PreLoad

func (c *ConsoleMatrix) PreLoad(scene *MatrixScene)

func (*ConsoleMatrix) Render

func (c *ConsoleMatrix) Render() error

Render ...

func (*ConsoleMatrix) Reset

func (c *ConsoleMatrix) Reset()

Reset ...

func (*ConsoleMatrix) ReversePreLoad

func (c *ConsoleMatrix) ReversePreLoad()

func (*ConsoleMatrix) Set

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

Set ...

func (*ConsoleMatrix) SetBrightness

func (c *ConsoleMatrix) SetBrightness(brightness int)

SetBrightness does nothing

type Matrix

type Matrix interface {
	Geometry() (width, height int)
	At(x int, y int) color.Color
	Set(x int, y int, c color.Color)
	// Apply([]color.Color) error
	Render() error
	Close() error
	SetBrightness(brightness int)
	PreLoad(*MatrixScene)
	ReversePreLoad()
	Play(ctx context.Context, startInterval time.Duration, interval <-chan time.Duration) error
}

Matrix is an interface that represent any RGB matrix, very useful for testing

type MatrixPoint

type MatrixPoint struct {
	X     int
	Y     int
	Color color.Color
}

type MatrixScene

type MatrixScene struct {
	Points []MatrixPoint
	// Index is the ordering of each scene
	Index int
}

Jump to

Keyboard shortcuts

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