fb

package
v0.0.0-...-4142f2f Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

The fb package provides a framebuffer abstraction. It also implements the displayer interface which is used by some drawing libraries (especially libraries intended for tinygo).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Displayer

type Displayer interface {
	SetPixel(x, y int16, c color.RGBA)
	Display() error
	Size() (int16, int16)
}

Displayer defines the methods that any display-compatible framebuffer must implement.

type ImageFB

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

ImageFB encapsulates an in-memory image framebuffer.

func New

func New(width, height int) *ImageFB

New creates and returns a new instance of ImageFB with the specified width and height.

func (*ImageFB) Display

func (i *ImageFB) Display() error

Display implements the Display method for the displayer interface. It currently does nothing and returns nil.

func (*ImageFB) SetPixel

func (i *ImageFB) SetPixel(x, y int16, c color.RGBA)

SetPixel sets the pixel color at the specified x and y coordinates within the framebuffer. It does nothing if the coordinates are out of bounds.

func (*ImageFB) Size

func (i *ImageFB) Size() (int16, int16)

Size returns the width and height dimensions of the framebuffer.

func (*ImageFB) ToImage

func (i *ImageFB) ToImage() *image.RGBA

ToImage returns the internal image.RGBA image.

Jump to

Keyboard shortcuts

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