Action is a vector graphics action as defined by the vg.Canvas interface. Each method of Canvas has a corresponding Action type.
type Action interface { Call() string ApplyTo(vg.Canvas) // contains filtered or unexported methods }
Canvas implements vg.Canvas operation serialization.
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 }
func (c *Canvas) Comment(text string)
Comment adds a comment to a list of Actions..
func (c *Canvas) DrawImage(rect vg.Rectangle, img image.Image)
DrawImage implements the DrawImage method of the vg.Canvas interface.
func (c *Canvas) Fill(path vg.Path)
Fill implements the Fill method of the vg.Canvas interface.
func (c *Canvas) FillString(font font.Face, pt vg.Point, str string)
FillString implements the FillString method of the vg.Canvas interface.
func (c *Canvas) Pop()
Pop implements the Pop method of the vg.Canvas interface.
func (c *Canvas) Push()
Push implements the Push method of the vg.Canvas interface.
func (c *Canvas) ReplayOn(dst vg.Canvas) error
ReplayOn applies the set of Actions recorded by the Recorder onto the destination Canvas.
func (c *Canvas) Reset()
Reset resets the Canvas to the base state.
func (c *Canvas) Rotate(a float64)
Rotate implements the Rotate method of the vg.Canvas interface.
func (c *Canvas) Scale(x, y float64)
Scale implements the Scale method of the vg.Canvas interface.
func (c *Canvas) SetColor(col color.Color)
SetColor implements the SetColor method of the vg.Canvas interface.
func (c *Canvas) SetLineDash(dashes []vg.Length, offs vg.Length)
SetLineDash implements the SetLineDash method of the vg.Canvas interface.
func (c *Canvas) SetLineWidth(w vg.Length)
SetLineWidth implements the SetLineWidth method of the vg.Canvas interface.
func (c *Canvas) Stroke(path vg.Path)
Stroke implements the Stroke method of the vg.Canvas interface.
func (c *Canvas) Translate(pt vg.Point)
Translate implements the Translate method of the vg.Canvas interface.
Comment implements a Recorder comment mechanism.
type Comment struct { Text string // contains filtered or unexported fields }
func (a *Comment) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *Comment) Call() string
Call returns the method call that generated the action.
Commenter defines types that can record comments.
type Commenter interface { Comment(string) }
DrawImage corresponds to the vg.Canvas.DrawImage method
type DrawImage struct { Rectangle vg.Rectangle Image image.Image // contains filtered or unexported fields }
func (a *DrawImage) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *DrawImage) Call() string
Call returns the pseudo method call that generated the action.
Fill corresponds to the vg.Canvas.Fill method.
type Fill struct { Path vg.Path // contains filtered or unexported fields }
func (a *Fill) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *Fill) Call() string
Call returns the method call that generated the action.
FillString corresponds to the vg.Canvas.FillString method.
type FillString struct { Font font.Font Size vg.Length Point vg.Point String string // contains filtered or unexported fields }
func (a *FillString) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *FillString) Call() string
Call returns the pseudo method call that generated the action.
Pop corresponds to the vg.Canvas.Pop method.
type Pop struct {
// contains filtered or unexported fields
}
func (a *Pop) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *Pop) Call() string
Call returns the method call that generated the action.
Push corresponds to the vg.Canvas.Push method.
type Push struct {
// contains filtered or unexported fields
}
func (a *Push) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *Push) Call() string
Call returns the method call that generated the action.
Rotate corresponds to the vg.Canvas.Rotate method.
type Rotate struct { Angle float64 // contains filtered or unexported fields }
func (a *Rotate) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *Rotate) Call() string
Call returns the method call that generated the action.
Scale corresponds to the vg.Canvas.Scale method.
type Scale struct { X, Y float64 // contains filtered or unexported fields }
func (a *Scale) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *Scale) Call() string
Call returns the method call that generated the action.
SetColor corresponds to the vg.Canvas.SetColor method.
type SetColor struct { Color color.Color // contains filtered or unexported fields }
func (a *SetColor) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *SetColor) Call() string
Call returns the method call that generated the action.
SetLineDash corresponds to the vg.Canvas.SetLineDash method.
type SetLineDash struct { Dashes []vg.Length Offsets vg.Length // contains filtered or unexported fields }
func (a *SetLineDash) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *SetLineDash) Call() string
Call returns the method call that generated the action.
SetLineWidth corresponds to the vg.Canvas.SetWidth method.
type SetLineWidth struct { Width vg.Length // contains filtered or unexported fields }
func (a *SetLineWidth) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *SetLineWidth) Call() string
Call returns the method call that generated the action.
Stroke corresponds to the vg.Canvas.Stroke method.
type Stroke struct { Path vg.Path // contains filtered or unexported fields }
func (a *Stroke) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *Stroke) Call() string
Call returns the method call that generated the action.
Translate corresponds to the vg.Canvas.Translate method.
type Translate struct { Point vg.Point // contains filtered or unexported fields }
func (a *Translate) ApplyTo(c vg.Canvas)
ApplyTo applies the action to the given vg.Canvas.
func (a *Translate) Call() string
Call returns the method call that generated the action.