go2dpf

package module
v0.0.0-...-f559176 Latest Latest
Warning

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

Go to latest
Published: May 26, 2016 License: MIT Imports: 5 Imported by: 0

README

Go to dpf

Work in progress

go2pdf allows you to record graphics in hacked photo frames.

For usb use Go wrapper around the libusb.

Used photo frame based on microcontroller Appotech AX206.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RGB565Model color.Model = color.ModelFunc(rgb565Model)

Functions

This section is empty.

Types

type ColorRGB565

type ColorRGB565 struct {
	C uint16
}

ColorRGB565 represents a 16-bit 565 color.

func (ColorRGB565) RGBA

func (c ColorRGB565) RGBA() (r, g, b, a uint32)

type DPF

type DPF struct {
	Width  int
	Height int
	Debug  bool
	// contains filtered or unexported fields
}

func OpenDpf

func OpenDpf() (*DPF, error)

func (*DPF) Blit

func (dpf *DPF) Blit(img *ImageRGB565) error

func (*DPF) Brightness

func (dpf *DPF) Brightness(lvl int) error

func (*DPF) Close

func (dpf *DPF) Close()

func (*DPF) GetDimensions

func (dpf *DPF) GetDimensions() (width, height int, err error)

type ImageRGB565

type ImageRGB565 struct {
	// Pix holds the image's pixels, as alpha values in big-endian format. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

RGB565 is an in-memory image whose At method returns ColorRGB565 values.

func NewRGB565

func NewRGB565(r image.Rectangle) *ImageRGB565

NewRGB565 returns a new RGB565 image with the given bounds.

func NewRGB565Image

func NewRGB565Image(src image.Image) *ImageRGB565

NewRGB565 returns RGB565 copy of image

func (ImageRGB565) At

func (p ImageRGB565) At(x, y int) color.Color

func (ImageRGB565) Bounds

func (p ImageRGB565) Bounds() image.Rectangle

func (ImageRGB565) ColorModel

func (p ImageRGB565) ColorModel() color.Model

func (*ImageRGB565) Opaque

func (p *ImageRGB565) Opaque() bool

Opaque scans the entire image and reports whether it is fully opaque.

func (*ImageRGB565) PixOffset

func (p *ImageRGB565) PixOffset(x, y int) int

PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).

func (*ImageRGB565) PixRect

func (p *ImageRGB565) PixRect() []byte

func (*ImageRGB565) RGB565At

func (p *ImageRGB565) RGB565At(x, y int) ColorRGB565

func (*ImageRGB565) Set

func (p *ImageRGB565) Set(x, y int, c color.Color)

func (*ImageRGB565) SetRGB565

func (p *ImageRGB565) SetRGB565(x, y int, c ColorRGB565)

func (*ImageRGB565) SubImage

func (p *ImageRGB565) SubImage(r image.Rectangle) image.Image

SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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