package vgop
import "go-hep.org/x/hep/hplot/vgop"
Package vgop provides tools to record a set of vector graphics operations.
Index ¶
- Constants
- type Canvas
- func New(opts ...Option) *Canvas
- 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) Size() (w, h vg.Length)
- func (c *Canvas) Stroke(path vg.Path)
- func (c *Canvas) Translate(pt vg.Point)
- type JSON
- func NewJSON(opts ...Option) *JSON
- func (c *JSON) MarshalJSON() ([]byte, error)
- func (c *JSON) UnmarshalJSON(p []byte) error
- func (c *JSON) WriteTo(w io.Writer) (int64, error)
- type Option
Constants ¶
const ( // DefaultWidth and DefaultHeight are the default canvas // dimensions. DefaultWidth = 4 * vg.Inch DefaultHeight = 4 * vg.Inch )
Types ¶
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas implements vg.Canvas for serialization.
func New ¶
New returns a new canvas.
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 replays the set of vector graphics operations 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) Size ¶
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 JSON ¶
type JSON struct { *Canvas }
JSON implements JSON serialization for vg.Canvas.
func NewJSON ¶
NewJSON creates a new vg.Canvas for JSON serialization.
func (*JSON) MarshalJSON ¶
func (*JSON) UnmarshalJSON ¶
func (*JSON) WriteTo ¶
type Option ¶
type Option func(c *Canvas)
func WithSize ¶
Source Files ¶
canvas.go fonts.go json.go ops.go vgop.go
- Version
- v0.37.1 (latest)
- Published
- Jun 3, 2025
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 2 days ago –
Tools for package owners.