image

package
v0.0.0-...-38c0a4c Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedMan = tile.TileEnd + iota
	RedPin
	RedSou
	BackTile
	BlankTile
)

Variables

This section is empty.

Functions

func DecodePNG

func DecodePNG(data []byte) (image.Image, error)

func EncodePNG

func EncodePNG(src image.Image) ([]byte, error)

func LoadPNG

func LoadPNG(filename string) (image.Image, error)

func Transform

func Transform(img image.Image, rotate int, flip bool) image.Image

func WritePNG

func WritePNG(filename string, src image.Image) error

Types

type Blank

type Blank struct {
	// contains filtered or unexported fields
}

func BlankFromImage

func BlankFromImage(img image.Image) *Blank

func (*Blank) At

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

func (*Blank) Bounds

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

func (*Blank) ColorModel

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

type Drawer

type Drawer interface {
	Draw(r image.Rectangle, src image.Image, sp image.Point)
}

type Flip

type Flip struct {
	image.Image
	X bool
	Y bool
}

func (*Flip) At

func (t *Flip) At(x, y int) color.Color

type Group

type Group struct {
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(x ...image.Image) *Group

func (*Group) At

func (g *Group) At(x, y int) color.Color

func (*Group) Bounds

func (g *Group) Bounds() image.Rectangle

func (*Group) ColorModel

func (g *Group) ColorModel() color.Model

type Handler

type Handler struct {
	Sprites Images
	MaxLen  int
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type ImageDrawer

type ImageDrawer struct {
	Dest draw.Image
}

func (*ImageDrawer) Draw

func (d *ImageDrawer) Draw(r image.Rectangle, src image.Image, sp image.Point)

type Images

type Images []image.Image

func DefaultSprites

func DefaultSprites(src image.Image) Images

func Sprites

func Sprites(src image.Image, cols, rows int) Images

func (Images) InitBlank

func (i Images) InitBlank()

func (Images) Parse

func (s Images) Parse(str string) ([]image.Image, error)

func (Images) Tile

func (i Images) Tile(t tile.Tile) image.Image

type RecordDrawer

type RecordDrawer struct {
	// contains filtered or unexported fields
}

func (*RecordDrawer) Draw

func (d *RecordDrawer) Draw(r image.Rectangle, src image.Image, sp image.Point)

func (*RecordDrawer) Repeat

func (d *RecordDrawer) Repeat(x Drawer)

type Rotate

type Rotate struct {
	image.Image
	Count int
}

func (*Rotate) At

func (t *Rotate) At(x, y int) color.Color

func (*Rotate) Bounds

func (t *Rotate) Bounds() image.Rectangle

type SizeDrawer

type SizeDrawer struct {
	Bounds image.Rectangle
}

func (*SizeDrawer) Draw

func (d *SizeDrawer) Draw(r image.Rectangle, src image.Image, sp image.Point)

func (*SizeDrawer) NewRGBA

func (d *SizeDrawer) NewRGBA() draw.Image

type SubImager

type SubImager interface {
	SubImage(r image.Rectangle) image.Image
}

type Translate

type Translate struct {
	image.Image
	Point image.Point
}

func (*Translate) At

func (t *Translate) At(x, y int) color.Color

func (*Translate) Bounds

func (t *Translate) Bounds() image.Rectangle

type Writer

type Writer struct {
	Drawer Drawer
	Point  image.Point
}

func (*Writer) SkipX

func (w *Writer) SkipX(x int)

func (*Writer) Write

func (w *Writer) Write(img image.Image)

func (*Writer) WriteImages

func (w *Writer) WriteImages(img []image.Image)

Jump to

Keyboard shortcuts

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