Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BufferFromImage ¶
BufferFromImage copies any image.Image into a core buffer.
func DecodeFile ¶
DecodeFile decodes a raster image file into an image.Image.
func DecodeImageToBuffer ¶
DecodeImageToBuffer decodes raster formats and delegates SVG decoding to pkg/graphics/svg.
Types ¶
type Canvas ¶
type Canvas interface {
Buffer() *core.Buffer
Image() draw.Image
Size() (width, height int)
SetClip(r image.Rectangle)
ClearClip()
Clip() (image.Rectangle, bool)
Clear(fill color.Color)
SetPixel(x, y int, c color.Color)
GetPixel(x, y int) color.NRGBA
FillRect(r image.Rectangle, fill color.Color)
DrawRect(r image.Rectangle, stroke color.Color)
FillRoundedRect(r image.Rectangle, radius int, fill color.Color)
DrawRoundedRect(r image.Rectangle, radius int, stroke color.Color)
DrawLine(x0, y0, x1, y1 int, stroke color.Color)
DrawImage(src image.Image, dst image.Rectangle)
DrawBuffer(src *core.Buffer, dst image.Rectangle)
}
Canvas defines the drawing surface API used by renderers.
type DecodeOptions ¶
type DecodeOptions struct {
SVG gfxsvg.DecodeFileOptions
}
DecodeOptions controls image decode behavior.
Click to show internal directories.
Click to hide internal directories.