vgimg

package
v0.0.0-...-7c6133f Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

vgimg implements the vg.Canvas interface using draw2d (code.google.com/p/draw2d/draw2d) as a backend to output raster images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

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

Canvas implements the vg.Canvas interface, drawing to an image.Image using draw2d.

func New

func New(width, height vg.Length) *Canvas

New returns a new image canvas with the size specified rounded up to the nearest pixel.

func NewImage

func NewImage(img draw.Image) *Canvas

NewImage returns a new image canvas that draws to the given image. The minimum point of the given image should probably be 0,0.

func (*Canvas) DPI

func (c *Canvas) DPI() float64

func (*Canvas) Fill

func (c *Canvas) Fill(p vg.Path)

func (*Canvas) FillString

func (c *Canvas) FillString(font vg.Font, x, y vg.Length, str string)

func (*Canvas) Pop

func (c *Canvas) Pop()

func (*Canvas) Push

func (c *Canvas) Push()

func (*Canvas) Rotate

func (c *Canvas) Rotate(t float64)

func (*Canvas) Scale

func (c *Canvas) Scale(x, y float64)

func (*Canvas) SetColor

func (c *Canvas) SetColor(clr color.Color)

func (*Canvas) SetLineDash

func (c *Canvas) SetLineDash(ds []vg.Length, offs vg.Length)

func (*Canvas) SetLineWidth

func (c *Canvas) SetLineWidth(w vg.Length)

func (*Canvas) Size

func (c *Canvas) Size() (w, h vg.Length)

func (*Canvas) Stroke

func (c *Canvas) Stroke(p vg.Path)

func (*Canvas) Translate

func (c *Canvas) Translate(x, y vg.Length)

type JpegCanvas

type JpegCanvas struct {
	*Canvas
}

A JpegCanvas is an image canvas with a WriteTo method that writes a jpeg image.

func (JpegCanvas) WriteTo

func (c JpegCanvas) WriteTo(w io.Writer) (int64, error)

WriteTo implements the io.WriterTo interface, writing a jpeg image.

type PngCanvas

type PngCanvas struct {
	*Canvas
}

A PngCanvas is an image canvas with a WriteTo method that writes a png image.

func (PngCanvas) WriteTo

func (c PngCanvas) WriteTo(w io.Writer) (int64, error)

WriteTo implements the io.WriterTo interface, writing a png image.

type TiffCanvas

type TiffCanvas struct {
	*Canvas
}

A TiffCanvas is an image canvas with a WriteTo method that writes a tiff image.

func (TiffCanvas) WriteTo

func (c TiffCanvas) WriteTo(w io.Writer) (int64, error)

WriteTo implements the io.WriterTo interface, writing a tiff image.

Jump to

Keyboard shortcuts

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