Versions in this module Expand all Collapse all v0 v0.1.2 Jan 25, 2021 v0.1.1 Jan 25, 2021 Changes in this version + var DefaultPalette = Palette + var DefaultViewBox = Rectangle + func Decode(dst Destination, src []byte, opts *DecodeOptions) error + type Color struct + func BlendColor(t, c0, c1 uint8) Color + func CRegColor(i uint8) Color + func PaletteIndexColor(i uint8) Color + func RGBAColor(c color.RGBA) Color + func (c Color) Resolve(pal *Palette, cReg *[64]color.RGBA) color.RGBA + type ColorType uint8 + const ColorTypeBlend + const ColorTypeCReg + const ColorTypePaletteIndex + const ColorTypeRGBA + type DecodeOptions struct + Palette *Palette + type Destination interface + AbsArcTo func(rx, ry, xAxisRotation float32, largeArc, sweep bool, x, y float32) + AbsCubeTo func(x1, y1, x2, y2, x, y float32) + AbsHLineTo func(x float32) + AbsLineTo func(x, y float32) + AbsQuadTo func(x1, y1, x, y float32) + AbsSmoothCubeTo func(x2, y2, x, y float32) + AbsSmoothQuadTo func(x, y float32) + AbsVLineTo func(y float32) + ClosePathAbsMoveTo func(x, y float32) + ClosePathEndPath func() + ClosePathRelMoveTo func(x, y float32) + RelArcTo func(rx, ry, xAxisRotation float32, largeArc, sweep bool, x, y float32) + RelCubeTo func(x1, y1, x2, y2, x, y float32) + RelHLineTo func(x float32) + RelLineTo func(x, y float32) + RelQuadTo func(x1, y1, x, y float32) + RelSmoothCubeTo func(x2, y2, x, y float32) + RelSmoothQuadTo func(x, y float32) + RelVLineTo func(y float32) + Reset func(m Metadata) + SetCReg func(adj uint8, incr bool, c Color) + SetCSel func(cSel uint8) + SetLOD func(lod0, lod1 float32) + SetNReg func(adj uint8, incr bool, f float32) + SetNSel func(nSel uint8) + StartPath func(adj uint8, x, y float32) + type Encoder struct + HighResolutionCoordinates bool + func (e *Encoder) AbsArcTo(rx, ry, xAxisRotation float32, largeArc, sweep bool, x, y float32) + func (e *Encoder) AbsCubeTo(x1, y1, x2, y2, x, y float32) + func (e *Encoder) AbsHLineTo(x float32) + func (e *Encoder) AbsLineTo(x, y float32) + func (e *Encoder) AbsQuadTo(x1, y1, x, y float32) + func (e *Encoder) AbsSmoothCubeTo(x2, y2, x, y float32) + func (e *Encoder) AbsSmoothQuadTo(x, y float32) + func (e *Encoder) AbsVLineTo(y float32) + func (e *Encoder) Bytes() ([]byte, error) + func (e *Encoder) CSel() uint8 + func (e *Encoder) ClosePathAbsMoveTo(x, y float32) + func (e *Encoder) ClosePathEndPath() + func (e *Encoder) ClosePathRelMoveTo(x, y float32) + func (e *Encoder) LOD() (lod0, lod1 float32) + func (e *Encoder) NSel() uint8 + func (e *Encoder) RelArcTo(rx, ry, xAxisRotation float32, largeArc, sweep bool, x, y float32) + func (e *Encoder) RelCubeTo(x1, y1, x2, y2, x, y float32) + func (e *Encoder) RelHLineTo(x float32) + func (e *Encoder) RelLineTo(x, y float32) + func (e *Encoder) RelQuadTo(x1, y1, x, y float32) + func (e *Encoder) RelSmoothCubeTo(x2, y2, x, y float32) + func (e *Encoder) RelSmoothQuadTo(x, y float32) + func (e *Encoder) RelVLineTo(y float32) + func (e *Encoder) Reset(m Metadata) + func (e *Encoder) SetCReg(adj uint8, incr bool, c Color) + func (e *Encoder) SetCSel(cSel uint8) + func (e *Encoder) SetCircularGradient(cBase, nBase uint8, cx, cy, rx, ry float32, spread GradientSpread, ...) + func (e *Encoder) SetEllipticalGradient(cBase, nBase uint8, cx, cy, rx, ry, sx, sy float32, spread GradientSpread, ...) + func (e *Encoder) SetGradient(cBase, nBase uint8, radial bool, transform f32.Aff3, spread GradientSpread, ...) + func (e *Encoder) SetLOD(lod0, lod1 float32) + func (e *Encoder) SetLinearGradient(cBase, nBase uint8, x1, y1, x2, y2 float32, spread GradientSpread, ...) + func (e *Encoder) SetNReg(adj uint8, incr bool, f float32) + func (e *Encoder) SetNSel(nSel uint8) + func (e *Encoder) StartPath(adj uint8, x, y float32) + type GradientSpread uint8 + const GradientSpreadNone + const GradientSpreadPad + const GradientSpreadReflect + const GradientSpreadRepeat + type GradientStop struct + Color color.Color + Offset float32 + type Metadata struct + Palette Palette + ViewBox Rectangle + func DecodeMetadata(src []byte) (m Metadata, err error) + type Palette [64]color.RGBA + type Rasterizer struct + func (z *Rasterizer) AbsArcTo(rx, ry, xAxisRotation float32, largeArc, sweep bool, x, y float32) + func (z *Rasterizer) AbsCubeTo(x1, y1, x2, y2, x, y float32) + func (z *Rasterizer) AbsHLineTo(x float32) + func (z *Rasterizer) AbsLineTo(x, y float32) + func (z *Rasterizer) AbsQuadTo(x1, y1, x, y float32) + func (z *Rasterizer) AbsSmoothCubeTo(x2, y2, x, y float32) + func (z *Rasterizer) AbsSmoothQuadTo(x, y float32) + func (z *Rasterizer) AbsVLineTo(y float32) + func (z *Rasterizer) ClosePathAbsMoveTo(x, y float32) + func (z *Rasterizer) ClosePathEndPath() + func (z *Rasterizer) ClosePathRelMoveTo(x, y float32) + func (z *Rasterizer) RelArcTo(rx, ry, xAxisRotation float32, largeArc, sweep bool, x, y float32) + func (z *Rasterizer) RelCubeTo(x1, y1, x2, y2, x, y float32) + func (z *Rasterizer) RelHLineTo(x float32) + func (z *Rasterizer) RelLineTo(x, y float32) + func (z *Rasterizer) RelQuadTo(x1, y1, x, y float32) + func (z *Rasterizer) RelSmoothCubeTo(x2, y2, x, y float32) + func (z *Rasterizer) RelSmoothQuadTo(x, y float32) + func (z *Rasterizer) RelVLineTo(y float32) + func (z *Rasterizer) Reset(m Metadata) + func (z *Rasterizer) SetCReg(adj uint8, incr bool, c Color) + func (z *Rasterizer) SetCSel(cSel uint8) + func (z *Rasterizer) SetDstImage(dst draw.Image, r image.Rectangle, drawOp draw.Op) + func (z *Rasterizer) SetLOD(lod0, lod1 float32) + func (z *Rasterizer) SetNReg(adj uint8, incr bool, f float32) + func (z *Rasterizer) SetNSel(nSel uint8) + func (z *Rasterizer) StartPath(adj uint8, x, y float32) + type Rectangle struct + Max f32.Vec2 + Min f32.Vec2 + func (r *Rectangle) AspectRatio() (dx, dy float32)