Documentation
¶
Overview ¶
Package framebuffer is an interface to linux framebuffer device.
Example ¶
package main
import (
"fmt"
"log"
"github.com/kaey/framebuffer"
)
func main() {
fb, err := framebuffer.Init("/dev/fb0")
if err != nil {
log.Fatalln(err)
}
defer fb.Close()
fb.Clear(0, 0, 0, 0)
fb.WritePixel(200, 100, 255, 0, 0, 0)
fmt.PrintLn(fb.WritePixel(200, 100))
fmt.Scanln()
}
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) Clear ¶
func (fb *Framebuffer) Clear(red, green, blue, alpha int)
Clear fills screen with specified color
func (*Framebuffer) Close ¶
func (fb *Framebuffer) Close()
Close closes framebuffer device and restores its contents.
func (*Framebuffer) Size ¶
func (fb *Framebuffer) Size() (width, height int)
Size returns dimensions of a framebuffer.
func (*Framebuffer) WritePixel ¶
func (fb *Framebuffer) WritePixel(x, y, red, green, blue, alpha int)
WritePixel changes pixel at x, y to specified color.
Click to show internal directories.
Click to hide internal directories.
