epdcolor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: BSD-2-Clause Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Gray3Model = color.ModelFunc(gray3Model)

Gray3Model is color model for white, gray or black color.

View Source
var WBModel = color.ModelFunc(bwModel)

WBModel is color model for white or black color.

Functions

This section is empty.

Types

type Gray3

type Gray3 uint8

Gray3 implements a 3 kinds of gray color.

const (
	Gray3White Gray3 = iota
	Gray3Gray
	Gray3Black
)

Possible colors

func (Gray3) RGBA

func (g Gray3) RGBA() (uint32, uint32, uint32, uint32)

RGBA returns either all white, gray or black.

func (Gray3) String

func (g Gray3) String() string

type Gray3Image

type Gray3Image struct {
	// Pix holds images pixels
	Pix []byte
	// Rect is image.Rectangle
	Rect image.Rectangle
}

Image is a Gray3 image

func NewGray3Image

func NewGray3Image(r image.Rectangle) *Gray3Image

NewImage returns gray3.Image instance.

func (*Gray3Image) At

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

At implements draw.Image

func (*Gray3Image) Bounds

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

Bounds implements draw.Image

func (*Gray3Image) ColorModel

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

ColorModel implements draw.Image

func (*Gray3Image) Set

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

Set implements draw.Image

type WB

type WB uint8

WB implements a 3 kinds of gray color.

const (
	WBWhite WB = iota
	WBBlack
)

Possible colors

func (WB) RGBA

func (c WB) RGBA() (uint32, uint32, uint32, uint32)

RGBA returns either all white, gray or black.

func (WB) String

func (c WB) String() string

type WBImage

type WBImage struct {
	// Pix holds images pixels
	Pix []byte
	// Rect is image.Rectangle
	Rect image.Rectangle
}

Image is a Gray3 image

func NewWBImage

func NewWBImage(r image.Rectangle) *WBImage

NewImage returns gray3.Image instance.

func (*WBImage) At

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

At implements draw.Image

func (*WBImage) Bounds

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

Bounds implements draw.Image

func (*WBImage) ColorModel

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

ColorModel implements draw.Image

func (*WBImage) Set

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

Set implements draw.Image

Jump to

Keyboard shortcuts

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