Documentation ¶
Index ¶
- type Font
- type Image
- func Cover(background, foreground Image, at XY) (Image, error)
- func CoverWithPosition(background, foreground Image, at XY, position Position) (Image, error)
- func Crop(image Image, at, size XY) (Image, error)
- func CropWithPosition(image Image, at, size XY, position Position) (Image, error)
- func ImportImage(size XY, path string) (Image, error)
- func Invert(image Image) Image
- func NewBlackImage(size XY) Image
- func NewImage(size XY, data []byte) (Image, error)
- func NewWhiteImage(size XY) Image
- func Render(text string, font Font) Image
- type OverflowError
- type Position
- type XY
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Font ¶
func NewFontFromIndexFile ¶
type Image ¶
type Image struct { Size XY // contains filtered or unexported fields }
func Cover ¶
Cover places a 'foreground' Image over the 'background' Image. Use 'at' to specify the top-left corner into which the foreground should be placed. Use CoverWithPosition to use relative positioning.
Returns OverflowError in case the foreground overflows the background; you may decide to ignore this error.
func CoverWithPosition ¶
CoverWithPosition places a 'foreground' Image over the 'background' Image. Use 'at' to specify the top-left corner into which the foreground should be placed.
Returns OverflowError in case the foreground overflows the background; you may decide to ignore this error.
func CropWithPosition ¶
func ImportImage ¶
ImportImage loads a PNG/JPEG file and converts it to an Image.
func NewBlackImage ¶
NewBlackImage creates a fully black image of given size.
func NewWhiteImage ¶
NewWhiteImage creates a fully white image of given size.
func (Image) ExportWithScale ¶
Export converts the image into a PNG file, with optional scale to increase the size of the image.
type OverflowError ¶
func (*OverflowError) Error ¶
func (e *OverflowError) Error() string