matrix

package
v0.0.0-...-7db34b9 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Progressive = ScanMode(iota + 1)
	Interlaced
)

Variables

View Source
var DefaultHardwareConfig = HardwareConfig{
	Rows:            64,
	Cols:            64,
	PWMBits:         5,
	Brightness:      100,
	ScanMode:        Interlaced,
	Mapping:         DefaultHardwareMapping,
	ShowRefreshRate: true,
}

DefaultHardwareConfig default WS281x configuration

View Source
var DefaultHardwareMapping = HardwareMapping{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type HardwareConfig

type HardwareConfig struct {
	// Rows the number of rows supported by the display, so 32 or 16.
	Rows int
	// Cols the number of columns supported by the display, so 32 or 64 .
	Cols int
	// PWMBits sets PWM bits used for output. Default is 11, but if you only deal with
	// limited comic-colors, 1 might be sufficient. Lower require less CPU and
	// increases refresh-rate.
	PWMBits int
	// Brightness is the initial brightness of the panel in percent. Valid range
	// is 1..100
	Brightness int
	// ScanMode progressive or interlaced
	ScanMode        ScanMode // strip color layout
	Mapping         HardwareMapping
	ShowRefreshRate bool
}

HardwareConfig rgb-led-matrix configuration

type HardwareMapping

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

type Matrix

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

func New

func New(b board.Board, hc *HardwareConfig) *Matrix

func (*Matrix) At

func (m *Matrix) At(x, y int) color.Color

func (*Matrix) Bounds

func (m *Matrix) Bounds() image.Rectangle

Bounds return the topology of the Canvas

func (*Matrix) Close

func (m *Matrix) Close() error

func (*Matrix) ColorModel

func (m *Matrix) ColorModel() color.Model

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

func (*Matrix) PWMBits

func (m *Matrix) PWMBits() int

func (*Matrix) Render

func (m *Matrix) Render()

Render renders the back buffer. It waits to the next VSync and swaps the active buffer with the back buffer one.

func (*Matrix) Set

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

func (*Matrix) SetPWMBits

func (m *Matrix) SetPWMBits(pwmBits int)

SetPWMBits sets PWM bits used for output. Default is 11, but if you only deal with limited comic-colors, 1 might be sufficient. Lower require less CPU and increases refresh-rate.

type ScanMode

type ScanMode int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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