Documentation ¶
Overview ¶
Package recorder provides support for vector graphics serialization.
Index ¶
- type Action
- type Canvas
- func (c *Canvas) Comment(text string)
- func (c *Canvas) DrawImage(rect vg.Rectangle, img image.Image)
- func (c *Canvas) Fill(path vg.Path)
- func (c *Canvas) FillString(font font.Face, pt vg.Point, str string)
- func (c *Canvas) Pop()
- func (c *Canvas) Push()
- func (c *Canvas) ReplayOn(dst vg.Canvas) error
- func (c *Canvas) Reset()
- func (c *Canvas) Rotate(a float64)
- func (c *Canvas) Scale(x, y float64)
- func (c *Canvas) SetColor(col color.Color)
- func (c *Canvas) SetLineDash(dashes []vg.Length, offs vg.Length)
- func (c *Canvas) SetLineWidth(w vg.Length)
- func (c *Canvas) Stroke(path vg.Path)
- func (c *Canvas) Translate(pt vg.Point)
- type Comment
- type Commenter
- type DrawImage
- type Fill
- type FillString
- type Pop
- type Push
- type Rotate
- type Scale
- type SetColor
- type SetLineDash
- type SetLineWidth
- type Stroke
- type Translate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface { Call() string ApplyTo(vg.Canvas) // contains filtered or unexported methods }
Action is a vector graphics action as defined by the vg.Canvas interface. Each method of Canvas has a corresponding Action type.
type Canvas ¶
type Canvas struct { // Actions holds a log of all methods called on // the canvas. Actions []Action // KeepCaller indicates whether the Canvas will // retain runtime caller location for the actions. // This includes source filename and line number. KeepCaller bool // contains filtered or unexported fields }
Canvas implements vg.Canvas operation serialization.
func (*Canvas) FillString ¶
FillString implements the FillString method of the vg.Canvas interface.
func (*Canvas) Pop ¶
func (c *Canvas) Pop()
Pop implements the Pop method of the vg.Canvas interface.
func (*Canvas) Push ¶
func (c *Canvas) Push()
Push implements the Push method of the vg.Canvas interface.
func (*Canvas) ReplayOn ¶
ReplayOn applies the set of Actions recorded by the Recorder onto the destination Canvas.
func (*Canvas) SetLineDash ¶
SetLineDash implements the SetLineDash method of the vg.Canvas interface.
func (*Canvas) SetLineWidth ¶
SetLineWidth implements the SetLineWidth method of the vg.Canvas interface.
type Comment ¶
type Comment struct { Text string // contains filtered or unexported fields }
Comment implements a Recorder comment mechanism.
type Commenter ¶
type Commenter interface {
Comment(string)
}
Commenter defines types that can record comments.
type DrawImage ¶
type DrawImage struct { Rectangle vg.Rectangle Image image.Image // contains filtered or unexported fields }
DrawImage corresponds to the vg.Canvas.DrawImage method
type Fill ¶
Fill corresponds to the vg.Canvas.Fill method.
type FillString ¶
type FillString struct { Font font.Font Size vg.Length Point vg.Point String string // contains filtered or unexported fields }
FillString corresponds to the vg.Canvas.FillString method.
func (*FillString) ApplyTo ¶
func (a *FillString) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (*FillString) Call ¶
func (a *FillString) Call() string
Call returns the pseudo method call that generated the action.
type Pop ¶
type Pop struct {
// contains filtered or unexported fields
}
Pop corresponds to the vg.Canvas.Pop method.
type Push ¶
type Push struct {
// contains filtered or unexported fields
}
Push corresponds to the vg.Canvas.Push method.
type Rotate ¶
type Rotate struct { Angle float64 // contains filtered or unexported fields }
Rotate corresponds to the vg.Canvas.Rotate method.
type Scale ¶
type Scale struct {
X, Y float64
// contains filtered or unexported fields
}
Scale corresponds to the vg.Canvas.Scale method.
type SetColor ¶
SetColor corresponds to the vg.Canvas.SetColor method.
type SetLineDash ¶
type SetLineDash struct { Dashes []vg.Length Offsets vg.Length // contains filtered or unexported fields }
SetLineDash corresponds to the vg.Canvas.SetLineDash method.
func (*SetLineDash) ApplyTo ¶
func (a *SetLineDash) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (*SetLineDash) Call ¶
func (a *SetLineDash) Call() string
Call returns the method call that generated the action.
type SetLineWidth ¶
SetLineWidth corresponds to the vg.Canvas.SetWidth method.
func (*SetLineWidth) ApplyTo ¶
func (a *SetLineWidth) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (*SetLineWidth) Call ¶
func (a *SetLineWidth) Call() string
Call returns the method call that generated the action.
type Stroke ¶
Stroke corresponds to the vg.Canvas.Stroke method.