Documentation
¶
Overview ¶
package engrave transforms shapes such as text and QR codes into line and move commands for use with an engraver.
Index ¶
- func ManhattanDist(p1, p2 image.Point) int
- func Measure(c Plan) image.Rectangle
- func NewBitmap(w, h int) bitmap
- type Command
- type ConstantStringer
- type Params
- type Plan
- func Commands(plans ...Plan) Plan
- func ConstantQR(strokeWidth, scale int, level qr.Level, content []byte) (Plan, error)
- func DryRun(p Plan) Plan
- func Offset(x, y int, cmd Plan) Plan
- func QR(strokeWidth int, scale int, level qr.Level, content []byte) (Plan, error)
- func Rotate(radians float64, cmd Plan) Plan
- type Rasterizer
- type Rect
- type StringCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ManhattanDist ¶ added in v1.3.0
Types ¶
type ConstantStringer ¶ added in v0.10.0
type ConstantStringer struct {
// contains filtered or unexported fields
}
ConstantStringer can engrave text in a timing insensitive way.
func NewConstantStringer ¶ added in v0.10.0
func NewConstantStringer(face *vector.Face, em int, shortest, longest int) *ConstantStringer
func (*ConstantStringer) String ¶ added in v0.10.0
func (c *ConstantStringer) String(txt string) Plan
type Params ¶ added in v1.3.0
type Params struct { // The StrokeWidth measured in machine units. StrokeWidth int // A Millimeter measured in machine units. Millimeter int }
Params decribe the physical characteristics of an engraver.
type Plan ¶ added in v1.3.0
type Plan func(yield func(Command))
Plan is an iterator over the commands of an engraving.
func ConstantQR ¶ added in v0.10.0
ConstantQR is like QR that engraves the QR code in a pattern independent of content, except for the QR code version (size).
type Rasterizer ¶
type Rasterizer struct {
// contains filtered or unexported fields
}
func NewRasterizer ¶
func (*Rasterizer) Command ¶ added in v1.3.0
func (r *Rasterizer) Command(cmd Command)
func (*Rasterizer) Rasterize ¶
func (r *Rasterizer) Rasterize()
Click to show internal directories.
Click to hide internal directories.