rasterizer

package
v0.0.0-...-6d3a538 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(c *canvas.Canvas, resolution canvas.DPMM) *image.RGBA

Draw draws the canvas on a new image with given resolution (in dots-per-millimeter). Higher resolution will result in bigger images.

func GIFWriter

func GIFWriter(resolution canvas.DPMM, opts *gif.Options) canvas.Writer

GIFWriter writes the canvas as a GIF file

func JPGWriter

func JPGWriter(resolution canvas.DPMM, opts *jpeg.Options) canvas.Writer

JPGWriter writes the canvas as a JPG file

func PNGWriter

func PNGWriter(resolution canvas.DPMM) canvas.Writer

PNGWriter writes the canvas as a PNG file

Types

type Renderer

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

func New

func New(img draw.Image, resolution canvas.DPMM) *Renderer

New creates a renderer that draws to a rasterized image.

func (*Renderer) RenderImage

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

func (*Renderer) RenderPath

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

func (*Renderer) RenderText

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

func (*Renderer) Size

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

Size returns the width and height in millimeters

Jump to

Keyboard shortcuts

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