Versions in this module Expand all Collapse all v0 v0.2.0 Nov 5, 2024 v0.1.8 Aug 26, 2024 Changes in this version + const CurveRecursionLimit + const DefaultDPI + const HalignCenter + const HalignLeft + const HalignRight + var ColorAqua = Color + var ColorBlack = Color + var ColorBlue = Color + var ColorFuchsia = Color + var ColorGreen = Color + var ColorLime = Color + var ColorMaroon = Color + var ColorNavy = Color + var ColorOlive = Color + var ColorPurple = Color + var ColorRed = Color + var ColorSilver = Color + var ColorTeal = Color + var ColorTransparent = Color + var ColorWhite = Color + var ColorYellow = Color + func Bresenham(img draw.Image, color color.Color, x0, y0, x1, y1 int) + func ColorChannelFromFloat(v float64) uint8 + func DrawContour(path PathBuilder, ps []truetype.Point, dx, dy float64) + func DrawImage(src image.Image, dest draw.Image, tr Matrix, op draw.Op, filter ImageFilter) + func Flatten(path *Path, flattener Flattener, scale float64) + func PointsToPixels(dpi, points float64) (pixels float64) + func PolylineBresenham(img draw.Image, c color.Color, s ...float64) + func SubdivideCubic(c, c1, c2 []float64) + func SubdivideQuad(c, c1, c2 []float64) + func TraceArc(t Liner, x, y, rx, ry, start, angle, scale float64) (lastX, lastY float64) + func TraceCubic(t Liner, cubic []float64, flatteningThreshold float64) + func TraceQuad(t Liner, quad []float64, flatteningThreshold float64) + type Color struct + A uint8 + B uint8 + G uint8 + R uint8 + func ColorFromAlphaMixedRGBA(r, g, b, a uint32) Color + func ColorFromHex(hex string) Color + func ColorFromKnown(known string) Color + func ColorFromRGB(rgb string) (output Color) + func ColorFromRGBA(rgba string) (output Color) + func ParseColor(rawColor string) Color + func (c Color) AverageWith(other Color) Color + func (c Color) Equals(other Color) bool + func (c Color) IsTransparent() bool + func (c Color) IsZero() bool + func (c Color) RGBA() (r, g, b, a uint32) + func (c Color) String() string + func (c Color) WithAlpha(a uint8) Color + type ContextStack struct + Cap LineCap + Dash []float64 + DashOffset float64 + FillColor color.Color + FillRule FillRule + Font *truetype.Font + FontSizePoints float64 + Join LineJoin + LineWidth float64 + Path *Path + Previous *ContextStack + Scale float64 + StrokeColor color.Color + Tr Matrix + type DashVertexConverter struct + func NewDashVertexConverter(dash []float64, dashOffset float64, flattener Flattener) *DashVertexConverter + func (dasher *DashVertexConverter) Close() + func (dasher *DashVertexConverter) End() + func (dasher *DashVertexConverter) LineJoin() + func (dasher *DashVertexConverter) LineTo(x, y float64) + func (dasher *DashVertexConverter) MoveTo(x, y float64) + type DemuxFlattener struct + Flatteners []Flattener + func (dc DemuxFlattener) Close() + func (dc DemuxFlattener) End() + func (dc DemuxFlattener) LineJoin() + func (dc DemuxFlattener) LineTo(x, y float64) + func (dc DemuxFlattener) MoveTo(x, y float64) + type FillRule int + const FillRuleEvenOdd + const FillRuleWinding + type Flattener interface + Close func() + End func() + LineJoin func() + LineTo func(x, y float64) + MoveTo func(x, y float64) + type FontExtents struct + Ascent float64 + Descent float64 + Height float64 + func Extents(font *truetype.Font, size float64) FontExtents + type FtLineBuilder struct + Adder raster.Adder + func (liner FtLineBuilder) Close() + func (liner FtLineBuilder) End() + func (liner FtLineBuilder) LineJoin() + func (liner FtLineBuilder) LineTo(x, y float64) + func (liner FtLineBuilder) MoveTo(x, y float64) + type GraphicContext interface + BeginPath func() + Clear func() + ClearRect func(x1, y1, x2, y2 int) + ComposeMatrixTransform func(tr Matrix) + CreateStringPath func(text string, x, y float64) (cursor float64) + DrawImage func(image image.Image) + Fill func(paths ...*Path) + FillString func(text string) (cursor float64) + FillStringAt func(text string, x, y float64) (cursor float64) + FillStroke func(paths ...*Path) + GetDPI func() int + GetFont func() *truetype.Font + GetFontSize func() float64 + GetMatrixTransform func() Matrix + GetStringBounds func(s string) (left, top, right, bottom float64) + Restore func() + Rotate func(angle float64) + Save func() + Scale func(sx, sy float64) + SetDPI func(dpi int) + SetFillColor func(c color.Color) + SetFillRule func(f FillRule) + SetFont func(f *truetype.Font) + SetFontSize func(fontSize float64) + SetLineCap func(cap LineCap) + SetLineDash func(dash []float64, dashOffset float64) + SetLineJoin func(join LineJoin) + SetLineWidth func(lineWidth float64) + SetMatrixTransform func(tr Matrix) + SetStrokeColor func(c color.Color) + Stroke func(paths ...*Path) + StrokeString func(text string) (cursor float64) + StrokeStringAt func(text string, x, y float64) (cursor float64) + Translate func(tx, ty float64) + type Halign int + type ImageFilter int + const BicubicFilter + const BilinearFilter + const LinearFilter + type ImageScaling struct + Halign Halign + Height float64 + ScalingPolicy ScalingPolicy + Valign Valign + Width float64 + type LineCap int + const ButtCap + const RoundCap + const SquareCap + type LineJoin int + const BevelJoin + const MiterJoin + const RoundJoin + type LineStroker struct + Cap LineCap + Flattener Flattener + HalfLineWidth float64 + Join LineJoin + func NewLineStroker(c LineCap, j LineJoin, flattener Flattener) *LineStroker + func (l *LineStroker) Close() + func (l *LineStroker) End() + func (l *LineStroker) LineJoin() + func (l *LineStroker) LineTo(x, y float64) + func (l *LineStroker) MoveTo(x, y float64) + type Liner interface + LineTo func(x, y float64) + type Matrix [6]float64 + func NewIdentityMatrix() Matrix + func NewMatrixFromRects(rectangle1, rectangle2 [4]float64) Matrix + func NewRotationMatrix(angle float64) Matrix + func NewScaleMatrix(sx, sy float64) Matrix + func NewTranslationMatrix(tx, ty float64) Matrix + func (tr *Matrix) Compose(trToCompose Matrix) + func (tr *Matrix) Copy() Matrix + func (tr *Matrix) Determinant() float64 + func (tr *Matrix) Equals(tr2 Matrix) bool + func (tr *Matrix) GetScale() float64 + func (tr *Matrix) GetScaling() (x, y float64) + func (tr *Matrix) GetTranslation() (x, y float64) + func (tr *Matrix) Inverse() + func (tr *Matrix) InverseTransform(points []float64) + func (tr *Matrix) InverseTransformPoint(x, y float64) (xres, yres float64) + func (tr *Matrix) IsIdentity() bool + func (tr *Matrix) IsTranslation() bool + func (tr *Matrix) Rotate(radians float64) + func (tr *Matrix) Scale(sx, sy float64) + func (tr *Matrix) Transform(points []float64) + func (tr *Matrix) TransformPoint(x, y float64) (xres, yres float64) + func (tr *Matrix) TransformRectangle(x0, y0, x2, y2 float64) (nx0, ny0, nx2, ny2 float64) + func (tr *Matrix) Translate(tx, ty float64) + func (tr *Matrix) VectorTransform(points []float64) + type Painter interface + SetColor func(color color.Color) + type Path struct + Components []PathComponent + Points []float64 + func (p *Path) ArcTo(cx, cy, rx, ry, startAngle, delta float64) + func (p *Path) Clear() + func (p *Path) Close() + func (p *Path) Copy() (dest *Path) + func (p *Path) CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64) + func (p *Path) IsEmpty() bool + func (p *Path) LastPoint() (x, y float64) + func (p *Path) LineTo(x, y float64) + func (p *Path) MoveTo(x, y float64) + func (p *Path) QuadCurveTo(cx, cy, x, y float64) + func (p *Path) String() string + type PathBuilder interface + ArcTo func(cx, cy, rx, ry, startAngle, angle float64) + Close func() + CubicCurveTo func(cx1, cy1, cx2, cy2, x, y float64) + LastPoint func() (x, y float64) + LineTo func(x, y float64) + MoveTo func(x, y float64) + QuadCurveTo func(cx, cy, x, y float64) + type PathComponent int + const ArcToComponent + const CloseComponent + const CubicCurveToComponent + const LineToComponent + const MoveToComponent + const QuadCurveToComponent + type RasterGraphicContext struct + DPI float64 + func NewRasterGraphicContext(img draw.Image) (*RasterGraphicContext, error) + func NewRasterGraphicContextWithPainter(img draw.Image, painter Painter) *RasterGraphicContext + func (rgc *RasterGraphicContext) Clear() + func (rgc *RasterGraphicContext) ClearRect(x1, y1, x2, y2 int) + func (rgc *RasterGraphicContext) CreateStringPath(s string, x, y float64) (cursor float64, err error) + func (rgc *RasterGraphicContext) DrawImage(img image.Image) + func (rgc *RasterGraphicContext) Fill(paths ...*Path) + func (rgc *RasterGraphicContext) FillString(text string) (cursor float64, err error) + func (rgc *RasterGraphicContext) FillStringAt(text string, x, y float64) (cursor float64, err error) + func (rgc *RasterGraphicContext) FillStroke(paths ...*Path) + func (rgc *RasterGraphicContext) GetDPI() float64 + func (rgc *RasterGraphicContext) GetFont() *truetype.Font + func (rgc *RasterGraphicContext) GetStringBounds(s string) (left, top, right, bottom float64, err error) + func (rgc *RasterGraphicContext) SetDPI(dpi float64) + func (rgc *RasterGraphicContext) SetFont(font *truetype.Font) + func (rgc *RasterGraphicContext) SetFontSize(fontSizePoints float64) + func (rgc *RasterGraphicContext) Stroke(paths ...*Path) + func (rgc *RasterGraphicContext) StrokeString(text string) (cursor float64, err error) + func (rgc *RasterGraphicContext) StrokeStringAt(text string, x, y float64) (cursor float64, err error) + type ScalingPolicy int + const ScalingFill + const ScalingFit + const ScalingHeight + const ScalingNone + const ScalingSameArea + const ScalingStretch + const ScalingWidth + type SegmentedPath struct + Points []float64 + func (p *SegmentedPath) Close() + func (p *SegmentedPath) End() + func (p *SegmentedPath) LineJoin() + func (p *SegmentedPath) LineTo(x, y float64) + func (p *SegmentedPath) MoveTo(x, y float64) + type SolidFillStyle struct + Color color.Color + FillRule FillRule + type StackGraphicContext struct + func NewStackGraphicContext() *StackGraphicContext + func (gc *StackGraphicContext) ArcTo(cx, cy, rx, ry, startAngle, delta float64) + func (gc *StackGraphicContext) BeginPath() + func (gc *StackGraphicContext) Close() + func (gc *StackGraphicContext) ComposeMatrixTransform(tr Matrix) + func (gc *StackGraphicContext) CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64) + func (gc *StackGraphicContext) GetFont() *truetype.Font + func (gc *StackGraphicContext) GetFontSize() float64 + func (gc *StackGraphicContext) GetMatrixTransform() Matrix + func (gc *StackGraphicContext) IsEmpty() bool + func (gc *StackGraphicContext) LastPoint() (x float64, y float64) + func (gc *StackGraphicContext) LineTo(x, y float64) + func (gc *StackGraphicContext) MoveTo(x, y float64) + func (gc *StackGraphicContext) QuadCurveTo(cx, cy, x, y float64) + func (gc *StackGraphicContext) Restore() + func (gc *StackGraphicContext) Rotate(angle float64) + func (gc *StackGraphicContext) Save() + func (gc *StackGraphicContext) Scale(sx, sy float64) + func (gc *StackGraphicContext) SetFillColor(c color.Color) + func (gc *StackGraphicContext) SetFillRule(f FillRule) + func (gc *StackGraphicContext) SetFont(f *truetype.Font) + func (gc *StackGraphicContext) SetFontSize(fontSizePoints float64) + func (gc *StackGraphicContext) SetLineCap(cap LineCap) + func (gc *StackGraphicContext) SetLineDash(dash []float64, dashOffset float64) + func (gc *StackGraphicContext) SetLineJoin(join LineJoin) + func (gc *StackGraphicContext) SetLineWidth(lineWidth float64) + func (gc *StackGraphicContext) SetMatrixTransform(tr Matrix) + func (gc *StackGraphicContext) SetStrokeColor(c color.Color) + func (gc *StackGraphicContext) Translate(tx, ty float64) + type StrokeStyle struct + Color color.Color + Dash []float64 + DashOffset float64 + LineCap LineCap + LineJoin LineJoin + Width float64 + type TextStyle struct + Color color.Color + Font *truetype.Font + Halign Halign + Size float64 + Valign Valign + type Transformer struct + Flattener Flattener + Tr Matrix + func (t Transformer) Close() + func (t Transformer) End() + func (t Transformer) LineJoin() + func (t Transformer) LineTo(x, y float64) + func (t Transformer) MoveTo(x, y float64) + type Valign int + const ValignBaseline + const ValignBottom + const ValignCenter + const ValignTop