image16bit

package
v0.0.0-...-0c309f4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package image16bit implements 16 bit (5, 6, 7 bits per color) 2D graphics.

It is compatible with package image/draw.

Index

Constants

View Source
const (
	Black = 0
	White = 0xffff
)

Variables

View Source
var BitsModel = color.ModelFunc(convert)

Functions

This section is empty.

Types

type Bits

type Bits uint16

Bit implements a 65k color.

func NewBits

func NewBits(c color.Color) Bits

func (Bits) RGBA

func (bi Bits) RGBA() (uint32, uint32, uint32, uint32)

type VerticalLSB

type VerticalLSB struct {
	// Pix holds the image's pixels, as vertically LSB-first packed bitmap. It
	// can be passed directly to ssd1351.Dev.Write()
	Pix []byte

	Stride int

	// Rect is the image's bounds.
	Rect image.Rectangle
}

VerticalLSB is a 16 bit RGB image.

Each 2 bytes represent a single pixel

It is designed specifically to work with SSD1351 OLED display controller.

func NewVerticalLSB

func NewVerticalLSB(r image.Rectangle) *VerticalLSB

NewVerticalLSB returns an initialized VerticalLSB instance.

func (*VerticalLSB) At

func (i *VerticalLSB) At(x, y int) color.Color

At implements image.Image.

func (*VerticalLSB) BitsAt

func (i *VerticalLSB) BitsAt(x, y int) Bits

BitAt is the optimized version of At().

func (*VerticalLSB) Bounds

func (i *VerticalLSB) Bounds() image.Rectangle

Bounds implements image.Image.

func (*VerticalLSB) ColorModel

func (i *VerticalLSB) ColorModel() color.Model

ColorModel implements image.Image.

func (*VerticalLSB) Opaque

func (i *VerticalLSB) Opaque() bool

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

func (*VerticalLSB) PixOffset

func (i *VerticalLSB) PixOffset(x, y int) int

func (*VerticalLSB) Set

func (i *VerticalLSB) Set(x, y int, c color.Color)

Set implements draw.Image

func (*VerticalLSB) SetBit

func (i *VerticalLSB) SetBit(x, y int, b Bits)

SetBit is the optimized version of Set().

Jump to

Keyboard shortcuts

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