screen

package
v0.0.0-...-2fbf42a Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package screen implements a 1D display.Drawer that outputs to terminal (stdout) using ANSI color codes.

Useful while you are waiting for your super nice APA-102 LED strip to come by mail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dev

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

Dev is a 1D LED strip emulator that outputs to the console.

func New

func New(l int) *Dev

New returns a Dev that displays at the console.

Permits to do local testing of LEDs animation.

func (*Dev) Bounds

func (d *Dev) Bounds() image.Rectangle

Bounds implements display.Drawer.

func (*Dev) ColorModel

func (d *Dev) ColorModel() color.Model

ColorModel implements display.Drawer.

func (*Dev) Draw

func (d *Dev) Draw(r image.Rectangle, src image.Image, sp image.Point) error

Draw implements display.Drawer.

func (*Dev) Halt

func (d *Dev) Halt() error

Halt implements conn.Resource.

It clears the display so it is not corrupted.

func (*Dev) String

func (d *Dev) String() string

func (*Dev) Write

func (d *Dev) Write(pixels []byte) (int, error)

Write accepts a stream of raw RGB pixels and writes it to the console.

Jump to

Keyboard shortcuts

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