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) 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
Click to show internal directories.
Click to hide internal directories.