display

package
v0.0.0-...-bf7d0e6 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BGR8BytesPerPixel int = 3
View Source
var BGR8Model color.Model = color.ModelFunc(bgr8Model)
View Source
var PtSansRegular *truetype.Font = parseFont(ptSansRegular)
View Source
var ScreenRect image.Rectangle = image.Rectangle{
	Min: image.Point{0, 0},
	Max: image.Point{320, 240},
}
View Source
var TickDuration time.Duration = time.Duration(int64(1000000000 / 60))
View Source
var TimerDuration time.Duration = time.Duration(5 * time.Second)

Functions

func DrawText

func DrawText(text []string, rect image.Rectangle, bg *image.Uniform) *image.NRGBA

func ReflowText

func ReflowText(txt string) []string

Types

type BGR8

type BGR8 struct {
	// Pix holds the image's pixels, in R, G, B, A order. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

BGR8 is an in-memory image whose At method returns color.BGR8 values.

func NewBGR8

func NewBGR8(r image.Rectangle) *BGR8

NewBGR8 returns a new BGR8 image with the given bounds.

func TextToBGR8

func TextToBGR8(txtLines []string) *BGR8

func (*BGR8) At

func (p *BGR8) At(x, y int) color.Color

func (*BGR8) BGR8At

func (p *BGR8) BGR8At(x, y int) ColorBGR8

func (*BGR8) Bounds

func (p *BGR8) Bounds() image.Rectangle

func (*BGR8) ColorModel

func (p *BGR8) ColorModel() color.Model

func (*BGR8) NRGBAAt

func (p *BGR8) NRGBAAt(x, y int) color.NRGBA

func (*BGR8) Opaque

func (p *BGR8) Opaque() bool

Opaque scans the entire image and reports whether it is fully opaque.

func (*BGR8) PixOffset

func (p *BGR8) PixOffset(x, y int) int

PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).

func (*BGR8) RGBA64At

func (p *BGR8) RGBA64At(x, y int) color.RGBA64

func (*BGR8) Set

func (p *BGR8) Set(x, y int, c color.Color)

func (*BGR8) SetNRGBA

func (p *BGR8) SetNRGBA(x, y int, c color.NRGBA)

func (*BGR8) SetRGBA64

func (p *BGR8) SetRGBA64(x, y int, c color.RGBA64)

func (*BGR8) SubImage

func (p *BGR8) SubImage(r image.Rectangle) image.Image

SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.

type ColorBGR8

type ColorBGR8 struct {
	B, G, R uint8
}

func ColorToBGR8

func ColorToBGR8(c color.Color) ColorBGR8

func (ColorBGR8) RGBA

func (c ColorBGR8) RGBA() (r, g, b, a uint32)

type DisplayError

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

func NewDisplayError

func NewDisplayError(err error) DisplayError

func (*DisplayError) Error

func (err *DisplayError) Error() string

type MiSTerDisplay

type MiSTerDisplay struct {
	IsRunning bool
	Client    *UdpDisplayClient
	StartChan chan bool
	StopChan  chan bool
	Ticker    *time.Ticker
	Timer     *time.Timer
	Frame     *BGR8
}

func NewMiSTerDisplay

func NewMiSTerDisplay(host string) *MiSTerDisplay

func (*MiSTerDisplay) BlitText

func (disp *MiSTerDisplay) BlitText(txt []string)

func (*MiSTerDisplay) SafeClose

func (disp *MiSTerDisplay) SafeClose()

func (*MiSTerDisplay) SafeOpen

func (disp *MiSTerDisplay) SafeOpen()

type UdpDisplayClient

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

func NewUdpClient

func NewUdpClient(host string) *UdpDisplayClient

func (*UdpDisplayClient) Close

func (client *UdpDisplayClient) Close()

func (*UdpDisplayClient) CmdBlit

func (client *UdpDisplayClient) CmdBlit(frameBuffer []byte)

func (*UdpDisplayClient) CmdClose

func (client *UdpDisplayClient) CmdClose()

func (*UdpDisplayClient) CmdInit

func (client *UdpDisplayClient) CmdInit()

func (*UdpDisplayClient) CmdSwitchres

func (client *UdpDisplayClient) CmdSwitchres()

func (*UdpDisplayClient) Open

func (client *UdpDisplayClient) Open()

func (*UdpDisplayClient) SendMTU

func (client *UdpDisplayClient) SendMTU(buffer []byte)

func (*UdpDisplayClient) SendPacket

func (client *UdpDisplayClient) SendPacket(buffer []byte)

Jump to

Keyboard shortcuts

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