Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
File *os.File
Pixels []byte
Pitch int
// contains filtered or unexported fields
}
Device represents the frame buffer. It implements the draw.Image interface.
func Open ¶
Open expects a framebuffer device as its argument (such as "/dev/fb0"). The device will be memory-mapped to a local buffer. Writing to the device changes the screen output. The returned Device implements the draw.Image interface. This means that you can use it to copy to and from other images. The only supported color model for the specified frame buffer is RGB565. After you are done using the Device, call Close on it to unmap the memory and close the framebuffer file.
func (*Device) Close ¶
func (d *Device) Close()
Close unmaps the framebuffer memory and closes the device file. Call this function when you are done using the frame buffer.
func (*Device) ColorModel ¶
ColorModel implements the image.Image (and draw.Image) interface.
func (*Device) Dirty ¶
Dirty returns the rectangle that has been modified since the last call to Set.
func (*Device) ResetDirty ¶
func (d *Device) ResetDirty()
ResetDirty resets the dirty rectangle to an empty rectangle.
type RGB565 ¶
type RGB565 uint16
The default color model under the Raspberry Pi is RGB 565. Each pixel is represented by two bytes, with 5 bits for red, 6 bits for green and 5 bits for blue. There is no alpha channel, so alpha is assumed to always be 100% opaque. This shows the memory layout of a pixel:
bit 76543210 76543210
RRRRRGGG GGGBBBBB
high byte low byte
RGB565 implements the color.Color and color.Model interfaces.