framebuffer

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT, BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package framebuffer is an interface to linux framebuffer device.

Example
package main

import (
	"fmt"
	"image/color"
	"log"

	"github.com/srlehn/termimg/wm/framebuffer"
)

func main() {
	fb, err := framebuffer.Init("/dev/fb0")
	if err != nil {
		log.Fatalln(err)
	}
	defer fb.Close()
	fb.Clear(color.RGBA{})
	fb.Set(200, 100, color.RGBA{R: 255})
	fmt.Scanln()
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Framebuffer

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

Framebuffer contains information about framebuffer.

func Init

func Init(dev string) (*Framebuffer, error)

Init opens framebuffer device, maps it to memory and saves its current contents.

func (*Framebuffer) At

func (fb *Framebuffer) At(x, y int) color.Color

func (*Framebuffer) Bounds

func (fb *Framebuffer) Bounds() image.Rectangle

Size returns dimensions of a framebuffer.

func (*Framebuffer) Clear

func (fb *Framebuffer) Clear(c color.Color)

Clear fills screen with specified color

func (*Framebuffer) Close

func (fb *Framebuffer) Close() error

Close closes framebuffer device and restores its contents.

func (*Framebuffer) ColorModel

func (fb *Framebuffer) ColorModel() color.Model

func (*Framebuffer) Set

func (fb *Framebuffer) Set(x, y int, c color.Color)

Set changes pixel at x, y to specified color.

Jump to

Keyboard shortcuts

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