Documentation ¶
Index ¶
- func DrawImage(src image.Image, dest draw.Image, tr draw2d.Matrix, op draw.Op, ...)
- func LoadFromPngFile(filePath string) (image.Image, error)
- func SaveToPngFile(filePath string, m image.Image) error
- type FtLineBuilder
- type GraphicContext
- func (gc *GraphicContext) Clear()
- func (gc *GraphicContext) ClearRect(x1, y1, x2, y2 int)
- func (gc *GraphicContext) DrawImage(img image.Image)
- func (gc *GraphicContext) Fill(paths ...*draw2d.Path)
- func (gc *GraphicContext) FillString(text string) (width float64)
- func (gc *GraphicContext) FillStringAt(text string, x, y float64) (width float64)
- func (gc *GraphicContext) FillStroke(paths ...*draw2d.Path)
- func (gc *GraphicContext) Stroke(paths ...*draw2d.Path)
- func (gc *GraphicContext) StrokeString(text string) (width float64)
- func (gc *GraphicContext) StrokeStringAt(text string, x, y float64) (width float64)
- type ImageFilter
- type Painter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawImage ¶
DrawImage draws an image into dest using an affine transformation matrix, an op and a filter
func LoadFromPngFile ¶
LoadFromPngFile Open a png file
Types ¶
type FtLineBuilder ¶
func (FtLineBuilder) Close ¶
func (liner FtLineBuilder) Close()
func (FtLineBuilder) End ¶
func (liner FtLineBuilder) End()
func (FtLineBuilder) LineJoin ¶
func (liner FtLineBuilder) LineJoin()
func (FtLineBuilder) LineTo ¶
func (liner FtLineBuilder) LineTo(x, y float64)
func (FtLineBuilder) MoveTo ¶
func (liner FtLineBuilder) MoveTo(x, y float64)
type GraphicContext ¶
type GraphicContext struct { *draw2dbase.StackGraphicContext // contains filtered or unexported fields }
GraphicContext is the implementation of draw2d.GraphicContext for a raster image
func NewGraphicContext ¶
func NewGraphicContext(img draw.Image) *GraphicContext
NewGraphicContext creates a new Graphic context from an image.
func NewGraphicContextWithPainter ¶
func NewGraphicContextWithPainter(img draw.Image, painter Painter) *GraphicContext
NewGraphicContextWithPainter creates a new Graphic context from an image and a Painter (see Freetype-go)
func (*GraphicContext) Clear ¶
func (gc *GraphicContext) Clear()
Clear fills the current canvas with a default transparent color
func (*GraphicContext) ClearRect ¶
func (gc *GraphicContext) ClearRect(x1, y1, x2, y2 int)
ClearRect fills the current canvas with a default transparent color at the specified rectangle
func (*GraphicContext) DrawImage ¶
func (gc *GraphicContext) DrawImage(img image.Image)
DrawImage draws the raster image in the current canvas
func (*GraphicContext) Fill ¶
func (gc *GraphicContext) Fill(paths ...*draw2d.Path)
Fill fills the paths with the color specified by SetFillColor
func (*GraphicContext) FillString ¶
func (gc *GraphicContext) FillString(text string) (width float64)
FillString draws the text at point (0, 0)
func (*GraphicContext) FillStringAt ¶
func (gc *GraphicContext) FillStringAt(text string, x, y float64) (width float64)
FillStringAt draws the text at the specified point (x, y)
func (*GraphicContext) FillStroke ¶
func (gc *GraphicContext) FillStroke(paths ...*draw2d.Path)
FillStroke first fills the paths and than strokes them
func (*GraphicContext) Stroke ¶
func (gc *GraphicContext) Stroke(paths ...*draw2d.Path)
Stroke strokes the paths with the color specified by SetStrokeColor
func (*GraphicContext) StrokeString ¶
func (gc *GraphicContext) StrokeString(text string) (width float64)
StrokeString draws the contour of the text at point (0, 0)
func (*GraphicContext) StrokeStringAt ¶
func (gc *GraphicContext) StrokeStringAt(text string, x, y float64) (width float64)
StrokeStringAt draws the contour of the text at point (x, y)
type ImageFilter ¶
type ImageFilter int
ImageFilter defines the type of filter to use
const ( // LinearFilter defines a linear filter LinearFilter ImageFilter = iota // BilinearFilter defines a bilinear filter BilinearFilter // BicubicFilter defines a bicubic filter BicubicFilter )