toolkit

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation interface {
	Delay() time.Duration
	Image() image.Image
	Next() error
}

type Frame

type Frame struct {
	Image image.Image
	Delay time.Duration
}

type Matrix

type Matrix interface {
	draw.Image
	Render()
}

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

type ToolKit

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

ToolKit is a convinient set of function to operate with a led of Matrix.

func New

func New(m Matrix) *ToolKit

New returns a new ToolKit wrapping the given Matrix.

func (*ToolKit) DrawImage

func (tk *ToolKit) DrawImage(img image.Image)

DrawImage draws the given image.

func (*ToolKit) PlayAnimation

func (tk *ToolKit) PlayAnimation(ctx context.Context, a Animation) error

PlayAnimation play the image during the delay returned by Next, until an err is returned, if io.EOF is returned, PlayAnimation finish without an error.

func (*ToolKit) PlayFrames

func (tk *ToolKit) PlayFrames(ctx context.Context, frames []Frame, loopCount int) error

PlayFrames draws a sequence of frames.

func (*ToolKit) PlayGIF

func (tk *ToolKit) PlayGIF(ctx context.Context, gif *gif.GIF) error

PlayGIF draws a gif. It use the contained images and delays and loops over it.

Jump to

Keyboard shortcuts

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