display

package
v0.0.0-...-0109317 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Consolas7pt = Font{
	// contains filtered or unexported fields
}
View Source
var Consolas8pt = Font{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type BitmapDisplay

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

func (*BitmapDisplay) Print

func (d *BitmapDisplay) Print(s string)

func (*BitmapDisplay) PrintAt

func (d *BitmapDisplay) PrintAt(line int, s string, clear bool)

type CustomDevice

type CustomDevice struct {
	PixelSetter func(int16, int16, color.RGBA)
	Displayer   func() error
	Clearer     func()
}

CustomDevice is a customizable implementation of the Device interface. Set the functions to whatever you'd like to keep the complexity of the hardware outside of this package.

func (CustomDevice) Clear

func (m CustomDevice) Clear()

func (CustomDevice) Display

func (m CustomDevice) Display() error

func (CustomDevice) SetPixel

func (m CustomDevice) SetPixel(x, y int16, ps PixelState)

type Device

type Device interface {
	SetPixel(x, y int16, c PixelState)
	Display() error
	Clear()
}

type Font

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

Font contains font information for Consolas 8pt

func (*Font) Bitmap

func (f *Font) Bitmap(c rune) []uint8

func (*Font) GetBitmapOffset

func (f *Font) GetBitmapOffset(c rune) int

func (*Font) Pixels

func (f *Font) Pixels(s string) [][]bool

func (*Font) RowN

func (f *Font) RowN(c rune, y int) uint8

func (*Font) StringBitmap

func (f *Font) StringBitmap(s string) [][]uint8

type FontBitmaps

type FontBitmaps []uint8

type FontCharInfo

type FontCharInfo [2]int

type FontDisplay

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

func (*FontDisplay) Print

func (d *FontDisplay) Print(s string)

func (*FontDisplay) PrintAt

func (d *FontDisplay) PrintAt(line int, s string, clear bool)

type PixelState

type PixelState color.RGBA

type Printer

type Printer interface {
	Print(s string)
	PrintAt(line int, s string, clear bool)
}

func New

func New(disp Device, width, height int) Printer

func NewFontDisplay

func NewFontDisplay(disp Device, width, height int, font Font) Printer

type WipeAnimation

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

func NewWipeAnimation

func NewWipeAnimation(device Device) WipeAnimation

func (*WipeAnimation) Run

func (wa *WipeAnimation) Run()

Jump to

Keyboard shortcuts

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