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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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()
}

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