package recorder
import "gonum.org/v1/plot/vg/recorder"
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
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) Comment ¶
Comment adds a comment to a list of Actions..
func (*Canvas) DrawImage ¶
DrawImage implements the DrawImage method of the vg.Canvas interface.
func (*Canvas) Fill ¶
Fill implements the Fill method of the vg.Canvas interface.
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 Canvas onto the destination Canvas.
func (*Canvas) Reset ¶
func (c *Canvas) Reset()
Reset resets the Canvas to the base state.
func (*Canvas) Rotate ¶
Rotate implements the Rotate method of the vg.Canvas interface.
func (*Canvas) Scale ¶
Scale implements the Scale method of the vg.Canvas interface.
func (*Canvas) SetColor ¶
SetColor implements the SetColor method of the vg.Canvas interface.
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.
func (*Canvas) Stroke ¶
Stroke implements the Stroke method of the vg.Canvas interface.
func (*Canvas) Translate ¶
Translate implements the Translate method of the vg.Canvas interface.
type Comment ¶
type Comment struct {
Text string
// contains filtered or unexported fields
}
Comment implements a comment mechanism.
func (*Comment) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*Comment) Call ¶
Call returns the method call that generated the action.
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
func (*DrawImage) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*DrawImage) Call ¶
Call returns the pseudo method call that generated the action.
type Fill ¶
Fill corresponds to the vg.Canvas.Fill method.
func (*Fill) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*Fill) Call ¶
Call returns the method call that generated the action.
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.
func (*Pop) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*Pop) Call ¶
Call returns the method call that generated the action.
type Push ¶
type Push struct {
// contains filtered or unexported fields
}
Push corresponds to the vg.Canvas.Push method.
func (*Push) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*Push) Call ¶
Call returns the method call that generated the action.
type Rotate ¶
type Rotate struct {
Angle float64
// contains filtered or unexported fields
}
Rotate corresponds to the vg.Canvas.Rotate method.
func (*Rotate) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*Rotate) Call ¶
Call returns the method call that generated the action.
type Scale ¶
type Scale struct {
X, Y float64
// contains filtered or unexported fields
}
Scale corresponds to the vg.Canvas.Scale method.
func (*Scale) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*Scale) Call ¶
Call returns the method call that generated the action.
type SetColor ¶
SetColor corresponds to the vg.Canvas.SetColor method.
func (*SetColor) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*SetColor) Call ¶
Call returns the method call that generated the action.
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.
func (*Stroke) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*Stroke) Call ¶
Call returns the method call that generated the action.
type Translate ¶
Translate corresponds to the vg.Canvas.Translate method.
func (*Translate) ApplyTo ¶
ApplyTo applies the action to the given vg.Canvas.
func (*Translate) Call ¶
Call returns the method call that generated the action.
Source Files ¶
recorder.go
- Version
- v0.16.0 (latest)
- Published
- Mar 26, 2025
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 4 months ago –
Tools for package owners.