Documentation
¶
Overview ¶
Package raster contains some convenience functions for creating "golang.org/x/image/vector" paths and rendering them into images.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LineTo ¶
LineTo renders a line segment from (oX,oY) to (nX,nY) with the specified perpendicular width. The capped value adds rounded end-caps to the line of radius half of the width (as approximated with Bezier curves).
Types ¶
type Rasterizer ¶ added in v0.6.0
type Rasterizer struct {
Entries []Entry
}
Rasterizer is a wrapper for the golang.org/x/image/vector.Rasterizer type which maps float64 arguments to float32 bit calls.
func NewRasterizer ¶ added in v0.6.0
func NewRasterizer() *Rasterizer
NewRasterizer allocates a new rasterizer.
func (*Rasterizer) ClosePath ¶ added in v0.6.0
func (r *Rasterizer) ClosePath()
ClosePath forms a loop back line from the pen to the start of the path.
func (*Rasterizer) CubeTo ¶ added in v0.6.0
func (r *Rasterizer) CubeTo(a, b, c, d, e, f float64)
CubeTo constructs a cubic Bezier curve using the supplied parameters, from the pen location to point (e,f), which becomes the updated pen location.
func (*Rasterizer) LineTo ¶ added in v0.6.0
func (r *Rasterizer) LineTo(x, y float64)
LineTo constructs a straight line from the pen to the target (x,y) coordinate, and updates the pen to this location.
func (*Rasterizer) MoveTo ¶ added in v0.6.0
func (r *Rasterizer) MoveTo(x, y float64)
MoveTo sets the rasterizer pen to the coordinate (x,y).
func (*Rasterizer) Render ¶ added in v0.6.1
Render places the entries of r into the im at (x,y) offset.
func (*Rasterizer) Reset ¶ added in v0.6.0
func (r *Rasterizer) Reset()
Reset resets the memory of the rasterizer.