recorder

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package recorder provides support for vector graphics serialization.

Index

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) Comment

func (c *Canvas) Comment(text string)

Comment adds a comment to a list of Actions..

func (*Canvas) DrawImage

func (c *Canvas) DrawImage(rect vg.Rectangle, img image.Image)

DrawImage implements the DrawImage method of the vg.Canvas interface.

func (*Canvas) Fill

func (c *Canvas) Fill(path vg.Path)

Fill implements the Fill method of the vg.Canvas interface.

func (*Canvas) FillString

func (c *Canvas) FillString(font font.Face, pt vg.Point, str string)

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

func (c *Canvas) ReplayOn(dst vg.Canvas) error

ReplayOn applies the set of Actions recorded by the Recorder onto the destination Canvas.

func (*Canvas) Reset

func (c *Canvas) Reset()

Reset resets the Canvas to the base state.

func (*Canvas) Rotate

func (c *Canvas) Rotate(a float64)

Rotate implements the Rotate method of the vg.Canvas interface.

func (*Canvas) Scale

func (c *Canvas) Scale(x, y float64)

Scale implements the Scale method of the vg.Canvas interface.

func (*Canvas) SetColor

func (c *Canvas) SetColor(col color.Color)

SetColor implements the SetColor method of the vg.Canvas interface.

func (*Canvas) SetLineDash

func (c *Canvas) SetLineDash(dashes []vg.Length, offs vg.Length)

SetLineDash implements the SetLineDash method of the vg.Canvas interface.

func (*Canvas) SetLineWidth

func (c *Canvas) SetLineWidth(w vg.Length)

SetLineWidth implements the SetLineWidth method of the vg.Canvas interface.

func (*Canvas) Stroke

func (c *Canvas) Stroke(path vg.Path)

Stroke implements the Stroke method of the vg.Canvas interface.

func (*Canvas) Translate

func (c *Canvas) Translate(pt vg.Point)

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 Recorder comment mechanism.

func (*Comment) ApplyTo

func (a *Comment) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Comment) Call

func (a *Comment) Call() string

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

func (a *DrawImage) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*DrawImage) Call

func (a *DrawImage) Call() string

Call returns the pseudo method call that generated the action.

type Fill

type Fill struct {
	Path vg.Path
	// contains filtered or unexported fields
}

Fill corresponds to the vg.Canvas.Fill method.

func (*Fill) ApplyTo

func (a *Fill) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Fill) Call

func (a *Fill) Call() string

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

func (a *Pop) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Pop) Call

func (a *Pop) Call() string

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

func (a *Push) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Push) Call

func (a *Push) Call() string

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

func (a *Rotate) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Rotate) Call

func (a *Rotate) Call() string

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

func (a *Scale) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Scale) Call

func (a *Scale) Call() string

Call returns the method call that generated the action.

type SetColor

type SetColor struct {
	Color color.Color
	// contains filtered or unexported fields
}

SetColor corresponds to the vg.Canvas.SetColor method.

func (*SetColor) ApplyTo

func (a *SetColor) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*SetColor) Call

func (a *SetColor) Call() string

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

type SetLineWidth struct {
	Width vg.Length
	// contains filtered or unexported fields
}

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

type Stroke struct {
	Path vg.Path
	// contains filtered or unexported fields
}

Stroke corresponds to the vg.Canvas.Stroke method.

func (*Stroke) ApplyTo

func (a *Stroke) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Stroke) Call

func (a *Stroke) Call() string

Call returns the method call that generated the action.

type Translate

type Translate struct {
	Point vg.Point
	// contains filtered or unexported fields
}

Translate corresponds to the vg.Canvas.Translate method.

func (*Translate) ApplyTo

func (a *Translate) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Translate) Call

func (a *Translate) Call() string

Call returns the method call that generated the action.

Jump to

Keyboard shortcuts

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