pixel: maze.io/x/pixel Index | Files | Directories

package pixel

import "maze.io/x/pixel"

Package pixel contains common pixel formats.

Index

Package Files

doc.go draw.go fx.go fx_bit.go image.go util.go

func Circle Uses

func Circle(b Image, p image.Point, r int, c color.Color)

Circle draws a circle at point p with radius r.

func FadeOutDither Uses

func FadeOutDither(buffer *Bitmap, duration time.Duration) <-chan time.Time

FadeOutDither applies gradual 4×4 Bayes dithering to all pixels off.

func Fill Uses

func Fill(b Image, c color.Color)

func FillRectangle Uses

func FillRectangle(b Image, r image.Rectangle, c color.Color)

FillRectangle draws a filled rectangle between the two points.

func HLine Uses

func HLine(b Image, p image.Point, width int, c color.Color)

HLine draws a horizontal line at p with the given width.

func Line Uses

func Line(b Image, p0, p1 image.Point, c color.Color)

Line draws a line between two points.

func Rectangle Uses

func Rectangle(b Image, r image.Rectangle, c color.Color)

Rectangle draws a rectangle outline between the two points.

func ScrollDown Uses

func ScrollDown(b Image)

func ScrollUp Uses

func ScrollUp(b Image)

func VLine Uses

func VLine(b Image, p image.Point, height int, c color.Color)

VLine draws a vertical line at p with the given height.

type Bitmap Uses

type Bitmap struct {
    Rect   image.Rectangle
    Pix    []byte
    Stride int
    Format Format
}

func NewBitmap Uses

func NewBitmap(w, h int) *Bitmap

func (*Bitmap) At Uses

func (b *Bitmap) At(x, y int) color.Color

func (*Bitmap) Bounds Uses

func (b *Bitmap) Bounds() image.Rectangle

func (*Bitmap) ColorModel Uses

func (b *Bitmap) ColorModel() color.Model

func (*Bitmap) PixOffset Uses

func (b *Bitmap) PixOffset(x, y int) (int, uint)

func (*Bitmap) Set Uses

func (b *Bitmap) Set(x, y int, c color.Color)

func (*Bitmap) SetBit Uses

func (b *Bitmap) SetBit(x, y int, c pixelcolor.Bit)

type Format Uses

type Format int
const (
    UnknownFormat Format = iota
    MHMSBFormat
    MVLSBFormat
    RGB332Format
    RGB565Format
    RGB888Format
    RGBA4444Format
    RGBA5551Format
)

func (Format) ColorModel Uses

func (f Format) ColorModel() color.Model

type Image Uses

type Image interface {
    draw.Image
}

func Must Uses

func Must(width, height int, format Format) Image

func New Uses

func New(width, height int, format Format) (Image, error)

type RGB332 Uses

type RGB332 struct {
    Rect   image.Rectangle
    Pix    []byte
    Stride int
}

func NewRGB332 Uses

func NewRGB332(w, h int) *RGB332

func (*RGB332) At Uses

func (b *RGB332) At(x, y int) color.Color

func (*RGB332) Bounds Uses

func (b *RGB332) Bounds() image.Rectangle

func (RGB332) ColorModel Uses

func (RGB332) ColorModel() color.Model

func (*RGB332) Set Uses

func (b *RGB332) Set(x, y int, c color.Color)

type RGB565 Uses

type RGB565 struct {
    Rect   image.Rectangle
    Pix    []byte
    Stride int
}

func NewRGB565 Uses

func NewRGB565(w, h int) *RGB565

func (*RGB565) At Uses

func (b *RGB565) At(x, y int) color.Color

func (*RGB565) Bounds Uses

func (b *RGB565) Bounds() image.Rectangle

func (RGB565) ColorModel Uses

func (RGB565) ColorModel() color.Model

func (*RGB565) OffsetOf Uses

func (b *RGB565) OffsetOf(x, y int) (offset int)

func (*RGB565) Set Uses

func (b *RGB565) Set(x, y int, c color.Color)

type RGB888 Uses

type RGB888 struct {
    Rect   image.Rectangle
    Pix    []byte
    Stride int
}

func NewRGB888 Uses

func NewRGB888(w, h int) *RGB888

func (*RGB888) At Uses

func (b *RGB888) At(x, y int) color.Color

func (*RGB888) Bounds Uses

func (b *RGB888) Bounds() image.Rectangle

func (*RGB888) ColorModel Uses

func (b *RGB888) ColorModel() color.Model

func (*RGB888) OffsetOf Uses

func (b *RGB888) OffsetOf(x, y int) (offset int)

func (*RGB888) Set Uses

func (b *RGB888) Set(x, y int, c color.Color)

type RGBA4444 Uses

type RGBA4444 struct {
    Rect   image.Rectangle
    Pix    []byte
    Stride int
}

func NewRGBA4444 Uses

func NewRGBA4444(w, h int) *RGBA4444

func (*RGBA4444) At Uses

func (b *RGBA4444) At(x, y int) color.Color

func (*RGBA4444) Bounds Uses

func (b *RGBA4444) Bounds() image.Rectangle

func (*RGBA4444) ColorModel Uses

func (b *RGBA4444) ColorModel() color.Model

func (*RGBA4444) OffsetOf Uses

func (b *RGBA4444) OffsetOf(x, y int) (offset int)

func (*RGBA4444) Set Uses

func (b *RGBA4444) Set(x, y int, c color.Color)

type RGBA5551 Uses

type RGBA5551 struct {
    Rect   image.Rectangle
    Pix    []byte
    Stride int
}

func NewRGBA5551 Uses

func NewRGBA5551(w, h int) *RGBA5551

func (*RGBA5551) At Uses

func (b *RGBA5551) At(x, y int) color.Color

func (*RGBA5551) Bounds Uses

func (b *RGBA5551) Bounds() image.Rectangle

func (*RGBA5551) ColorModel Uses

func (b *RGBA5551) ColorModel() color.Model

func (*RGBA5551) OffsetOf Uses

func (b *RGBA5551) OffsetOf(x, y int) (offset int)

func (*RGBA5551) Set Uses

func (b *RGBA5551) Set(x, y int, c color.Color)

Directories

PathSynopsis
pixelcolorPackage pixelcolor contains common color formats.
pixeleffect
pixelfont
pixelterm

Package pixel imports 7 packages (graph) and is imported by 2 packages. Updated 2020-07-28. Refresh now. Tools for package owners.