ps

package
v0.0.0-...-f3557b4 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	ImageEncoding: canvas.Lossless,
}

Functions

This section is empty.

Types

type Format

type Format int
const (
	PostScript Format = iota
	EncapsulatedPostScript
)

type Options

type Options struct {
	Format
	canvas.ImageEncoding
}

type PS

type PS struct {
	// contains filtered or unexported fields
}

PS is an PostScript renderer. Be aware that PostScript does not support transparency of colors.

func New

func New(w io.Writer, width, height float64, opts *Options) *PS

New returns an PostScript renderer.

func (*PS) Close

func (r *PS) Close() error

func (*PS) RenderImage

func (r *PS) RenderImage(img image.Image, m canvas.Matrix)

RenderImage renders an image to the canvas using a transformation matrix.

func (*PS) RenderPath

func (r *PS) RenderPath(path *canvas.Path, style canvas.Style, m canvas.Matrix)

RenderPath renders a path to the canvas using a style and a transformation matrix.

func (*PS) RenderText

func (r *PS) RenderText(text *canvas.Text, m canvas.Matrix)

RenderText renders a text object to the canvas using a transformation matrix.

func (*PS) Size

func (r *PS) Size() (float64, float64)

Size returns the size of the canvas in millimeters.

Jump to

Keyboard shortcuts

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