graphics

package
v0.0.0-...-c7a45d2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var I = Affine{
	1, 0, 0,
	0, 1, 0,
	0, 0, 1,
}

I is the identity Affine transform matrix.

Functions

func Scale

func Scale(dst draw.Image, src image.Image) error

Scale produces a scaled version of the image using bilinear interpolation.

Types

type Affine

type Affine [9]float64

Affine is a 3x3 2D affine transform matrix. M(i,j) is Affine[i*3+j].

func (Affine) Center

func (a Affine) Center(x, y float64) Affine

Center produces the affine transform, centered around the provided point.

func (Affine) CenterFit

func (a Affine) CenterFit(dst, src image.Rectangle) Affine

CenterFit produces the affine transform, centered around the rectangles. It is equivalent to

I.Translate(-<center of src>).Mul(a).Translate(<center of dst>)

func (Affine) Mul

func (a Affine) Mul(b Affine) Affine

Mul returns the multiplication of two affine transform matrices.

func (Affine) Rotate

func (a Affine) Rotate(angle float64) Affine

Rotate produces a clockwise rotation transform of angle, in radians.

func (Affine) Scale

func (a Affine) Scale(x, y float64) Affine

Scale produces a scaling transform of factors x and y.

func (Affine) Shear

func (a Affine) Shear(x, y float64) Affine

Shear produces a shear transform by the slopes x and y.

func (Affine) Transform

func (a Affine) Transform(dst draw.Image, src image.Image, i interp.Interp) error

Transform applies the affine transform to src and produces dst.

func (Affine) TransformCenter

func (a Affine) TransformCenter(dst draw.Image, src image.Image, i interp.Interp) error

TransformCenter applies the affine transform to src and produces dst. Equivalent to

a.CenterFit(dst, src).Transform(dst, src, i).

func (Affine) Translate

func (a Affine) Translate(x, y float64) Affine

Translate produces a translation transform with pixel distances x and y.

Directories

Path Synopsis
Package interp implements image interpolation.
Package interp implements image interpolation.

Jump to

Keyboard shortcuts

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