ps

package
v0.0.0-...-c077e1a Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Writer

func Writer(w io.Writer, c *canvas.Canvas) error

Writer writes the canvas as a PS file. DEPRECATED

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