Documentation
¶
Overview ¶
Package pixel implements a color and image library suitable for OLED and LCD pixel displays.
This module provides additional color models, compatible with Go's native color.Color and image.Image / draw.Image interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( MonoModel color.Model = color.ModelFunc(monoModel) Gray2Model color.Model = color.ModelFunc(gray2Model) Gray4Model color.Model = color.ModelFunc(gray4Model) CBGR15Model color.Model = color.ModelFunc(cbgr15Model) CRGB15Model color.Model = color.ModelFunc(crgb15Model) CBGR16Model color.Model = color.ModelFunc(cbgr16Model) CRGB16Model color.Model = color.ModelFunc(crgb16Model) )
Models for the standard color types.
var ( Off = Mono{false} On = Mono{true} )
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// Rect is the image bounding box.
Rect image.Rectangle
// Pix are the image pixels.
Pix []byte
// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
Stride int
}
Buffer holds the pixel values and is a container that is used by most image formats in this package.
type CBGR15 ¶ added in v1.1.0
type CBGR15 struct {
V uint16
}
CBGR15 represents a 15-bit 5-5-5 BGR color.
type CBGR15Image ¶ added in v1.1.0
CBGR15Image is a 15-bits per pixel 5-5-5-bit BGR image.
func NewCBGR15Image ¶ added in v1.1.0
func NewCBGR15Image(w, h int) *CBGR15Image
func (*CBGR15Image) ColorModel ¶ added in v1.1.0
func (p *CBGR15Image) ColorModel() color.Model
func (*CBGR15Image) Fill ¶ added in v1.1.0
func (p *CBGR15Image) Fill(c color.Color)
type CBGR16 ¶ added in v1.1.0
type CBGR16 struct {
V uint16
}
CBGR16 represents a 16-bit 5-6-5 BGR color.
type CBGR16Image ¶ added in v1.1.0
CBGR16Image is a 16-bits per pixel 5-6-5-bit BGR image.
func NewCBGR16Image ¶ added in v1.1.0
func NewCBGR16Image(w, h int) *CBGR16Image
func (*CBGR16Image) ColorModel ¶ added in v1.1.0
func (p *CBGR16Image) ColorModel() color.Model
func (*CBGR16Image) Fill ¶ added in v1.1.0
func (p *CBGR16Image) Fill(c color.Color)
type CRGB15Image ¶
CRGB15Image is a 15-bits per pixel 5-5-5-bit RGB image.
func NewCRGB15Image ¶
func NewCRGB15Image(w, h int) *CRGB15Image
func (*CRGB15Image) ColorModel ¶
func (p *CRGB15Image) ColorModel() color.Model
func (*CRGB15Image) Fill ¶ added in v0.0.10
func (p *CRGB15Image) Fill(c color.Color)
type CRGB16 ¶
type CRGB16 struct {
// CRed, 5, CGreen, 6, CBlue, 5
V uint16
}
CRGB16 represents a 16-bit 5-6-5 RGB color.
type CRGB16Image ¶
CRGB16Image is a 16-bits per pixel 5-6-5-bit RGB image.
func NewCRGB16Image ¶
func NewCRGB16Image(w, h int) *CRGB16Image
func (*CRGB16Image) ColorModel ¶
func (p *CRGB16Image) ColorModel() color.Model
func (*CRGB16Image) Fill ¶ added in v0.0.10
func (p *CRGB16Image) Fill(c color.Color)
type Gray2Image ¶
type Gray2Image struct {
Buffer
}
Gray2Image is a 2-bits per pixel gray scale image.
func NewGray2Image ¶
func NewGray2Image(w, h int) *Gray2Image
func (*Gray2Image) ColorModel ¶
func (p *Gray2Image) ColorModel() color.Model
func (*Gray2Image) Fill ¶ added in v0.0.10
func (p *Gray2Image) Fill(c color.Color)
type Gray4Image ¶
type Gray4Image struct {
Buffer
}
Gray4Image is a 4-bits per pixel gray scale image.
func NewGray4Image ¶
func NewGray4Image(w, h int) *Gray4Image
func (*Gray4Image) ColorModel ¶
func (p *Gray4Image) ColorModel() color.Model
func (*Gray4Image) Fill ¶ added in v0.0.10
func (p *Gray4Image) Fill(c color.Color)
type MonoImage ¶
type MonoImage struct {
Buffer
}
MonoImage is a 1-bit per pixel monochrome image.
func NewMonoImage ¶
func (*MonoImage) ColorModel ¶
type MonoVerticalLSBImage ¶
type MonoVerticalLSBImage struct {
Buffer
}
MonoVerticalLSBImage is a 1-bit per pixel monochrome image.
This is mostly used by SSD1xxx OLED displays.
func NewMonoVerticalLSBImage ¶
func NewMonoVerticalLSBImage(w, h int) *MonoVerticalLSBImage
func (*MonoVerticalLSBImage) ColorModel ¶
func (p *MonoVerticalLSBImage) ColorModel() color.Model
func (*MonoVerticalLSBImage) Fill ¶ added in v0.0.10
func (p *MonoVerticalLSBImage) Fill(c color.Color)