Documentation ¶
Index ¶
- func AlignPosition(align Align, bounds image.Rectangle, sizeX int, sizeY int) (image.Rectangle, error)
- func DefaultFont() (*truetype.Font, error)
- func DrawImage(canvas *rgb.Canvas, bounds image.Rectangle, img image.Image) error
- func DrawImageAligned(canvas *rgb.Canvas, bounds image.Rectangle, img *image.RGBA, align Align) error
- func DrawRectangle(canvas *rgb.Canvas, startX int, startY int, sizeX int, sizeY int, ...) error
- func FontFromAsset(asset string) (*truetype.Font, error)
- func PlayGIF(ctx context.Context, canvas *rgb.Canvas, gif *gif.GIF) error
- func PlayImages(ctx context.Context, canvas *rgb.Canvas, images []image.Image, ...) error
- func ResizeGIF(g *gif.GIF, bounds image.Rectangle, zoom float64) error
- func ResizeImage(img image.Image, bounds image.Rectangle, zoom float64) image.Image
- func SaveGif(img *gif.GIF, fileName string) error
- func SaveGifAfero(fs afero.Fs, img *gif.GIF, fileName string) error
- func SavePng(img image.Image, fileName string) error
- func SavePngAfero(fs afero.Fs, img image.Image, fileName string) error
- func SetImageAlign(canvas *rgb.Canvas, align Align, img image.Image) (image.Image, error)
- func ShiftedSize(xStart int, yStart int, bounds image.Rectangle) image.Rectangle
- func ZoomImageSize(img image.Image, zoom float64) (int, int)
- type Align
- type TextWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignPosition ¶
func AlignPosition(align Align, bounds image.Rectangle, sizeX int, sizeY int) (image.Rectangle, error)
AlignPosition returns image.Rectangle bounds for an image within a given bounds
func DrawImageAligned ¶
func DrawImageAligned(canvas *rgb.Canvas, bounds image.Rectangle, img *image.RGBA, align Align) error
DrawImageAligned draws an image aligned within the given bounds
func DrawRectangle ¶
func DrawRectangle(canvas *rgb.Canvas, startX int, startY int, sizeX int, sizeY int, fillColor color.Color) error
DrawRectangle ...
func PlayGIF ¶
PlayGIF reads and draw a gif file from r. It use the contained images and delays and loops over it, until a true is sent to the returned chan
func PlayImages ¶
func PlayImages(ctx context.Context, canvas *rgb.Canvas, images []image.Image, delay []time.Duration, loop int) error
PlayImages plays s series of images. If loop == 0, it will play forever until the context is canceled
func ResizeImage ¶
ResizeImage ...
func SaveGifAfero ¶
SaveGifAfero ...
func SavePngAfero ¶
SavePngAfero ...
func SetImageAlign ¶
SetImageAlign ...
func ShiftedSize ¶
ShiftedSize shifts an image's start location and returns its resulting bounds
Types ¶
type TextWriter ¶
type TextWriter struct { XStartCorrection int YStartCorrection int FontSize float64 LineSpace float64 // contains filtered or unexported fields }
TextWriter ...
func NewTextWriter ¶
func NewTextWriter(font *truetype.Font, fontSize float64) *TextWriter
NewTextWriter ...
Click to show internal directories.
Click to hide internal directories.