canvas

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorString

func ColorString(name styleop, value data.Color) string

func FloatString

func FloatString(name styleop, value float32) string

func NewCanvas

func NewCanvas(size data.Size, units data.Unit) data.Canvas

func StyleString

func StyleString(name styleop, value interface{}) string

func UnitString

func UnitString(name styleop, value float32, unit data.Unit) string

Types

type Element

type Element struct {
	XMLName  xml.Name
	XMLAttrs []*xml.Attr
	// contains filtered or unexported fields
}

func NewElement

func NewElement(name string, cdata string, root *Element) *Element

func (*Element) Attr

func (e *Element) Attr(name, value string)

func (*Element) Attrs

func (e *Element) Attrs() []xml.Attr

func (*Element) Circle

func (e *Element) Circle(centre data.Point, radius float32) data.CanvasElement

func (*Element) Class

func (e *Element) Class(value string) data.CanvasElement

func (*Element) ClosePath

func (e *Element) ClosePath() data.CanvasPath

func (*Element) CubicTo

func (e *Element) CubicTo(pt, c1, c2 data.Point) data.CanvasPath

func (*Element) Desc

func (e *Element) Desc(value string) data.CanvasGroup

func (*Element) Ellipse

func (e *Element) Ellipse(centre data.Point, radius data.Size) data.CanvasElement

func (*Element) Fill

func (e *Element) Fill(color data.Color, opacity float32) data.CanvasStyle

func (*Element) FillRule

func (e *Element) FillRule(rule data.FillRule) data.CanvasStyle

func (*Element) FontSize

func (e *Element) FontSize(size float32, unit data.Unit) data.CanvasStyle

func (*Element) Group

func (e *Element) Group(children ...data.CanvasElement) data.CanvasGroup

func (*Element) Id

func (e *Element) Id(value string) data.CanvasElement

func (*Element) Line

func (e *Element) Line(p1, p2 data.Point) data.CanvasElement

func (*Element) LineCap

func (e *Element) LineCap(cap data.LineCap) data.CanvasStyle

func (*Element) LineJoin

func (e *Element) LineJoin(join data.LineJoin) data.CanvasStyle

func (*Element) LineTo

func (e *Element) LineTo(pt data.Point) data.CanvasPath

func (*Element) MarshalXML

func (e *Element) MarshalXML(x *xml.Encoder, start xml.StartElement) error

func (*Element) MiterLimit

func (e *Element) MiterLimit(limit float32) data.CanvasStyle

func (*Element) MoveTo

func (e *Element) MoveTo(pt data.Point) data.CanvasPath

func (*Element) NoFill

func (e *Element) NoFill() data.CanvasStyle

func (*Element) NoStroke

func (e *Element) NoStroke() data.CanvasStyle

func (*Element) Origin

func (e *Element) Origin() data.Point

func (*Element) Path

func (e *Element) Path(pts []data.Point) data.CanvasPath

func (*Element) QuadraticTo

func (e *Element) QuadraticTo(pt, c data.Point) data.CanvasPath

func (*Element) Rect

func (e *Element) Rect(pt data.Point, sz data.Size) data.CanvasElement

func (*Element) Rotate

func (e *Element) Rotate(deg float32) data.CanvasTransform

func (*Element) RotateAround

func (e *Element) RotateAround(deg float32, pt data.Point) data.CanvasTransform

func (*Element) Scale

func (e *Element) Scale(size data.Size) data.CanvasTransform

func (*Element) SetOrigin

func (e *Element) SetOrigin(pt data.Point)

func (*Element) SetSize

func (e *Element) SetSize(sz data.Size)

func (*Element) Size

func (e *Element) Size() data.Size

func (*Element) SkewX

func (e *Element) SkewX(skew float32) data.CanvasTransform

func (*Element) SkewY

func (e *Element) SkewY(skew float32) data.CanvasTransform

func (*Element) Span

func (e *Element) Span(cdata string) data.CanvasText

func (*Element) String

func (e *Element) String() string

func (*Element) Stroke

func (e *Element) Stroke(color data.Color, opacity float32) data.CanvasStyle

func (*Element) StrokeWidth

func (e *Element) StrokeWidth(width float32) data.CanvasStyle

func (*Element) Style

func (e *Element) Style(styles ...data.CanvasStyle) data.CanvasElement

func (*Element) Text

func (e *Element) Text(pt data.Point, children ...data.CanvasText) data.CanvasElement

func (*Element) TextAnchor

func (e *Element) TextAnchor(align data.TextAlign) data.CanvasStyle

func (*Element) Title

func (e *Element) Title(value string) data.Canvas

func (*Element) Transform

func (e *Element) Transform(op ...data.CanvasTransform) data.CanvasElement

func (*Element) Translate

func (e *Element) Translate(pt data.Point) data.CanvasTransform

func (*Element) Version

func (e *Element) Version(value string) data.Canvas

func (*Element) Write

func (e *Element) Write(fmt data.Writer, w io.Writer) error

type Style

type Style struct {
	// contains filtered or unexported fields
}

func NewStyle

func NewStyle(styles []data.CanvasStyle) *Style

func (*Style) Append

func (this *Style) Append(styles []data.CanvasStyle)

func (*Style) DefString

func (s *Style) DefString(op styleop, def *styledef) string

func (*Style) String

func (s *Style) String() string

type Transform

type Transform struct {
	// contains filtered or unexported fields
}

func NewTransform

func NewTransform(op []data.CanvasTransform) *Transform

func (*Transform) String

func (t *Transform) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL