framebuffer

package module
v0.0.0-...-7b38548 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2014 License: BSD-3-Clause Imports: 3 Imported by: 0

README

GoDoc

framebuffer

Library for linux framebuffer device.

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.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) 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.

Jump to

Keyboard shortcuts

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