affine

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ColorMDim = 5

ColorMDim is a dimension of a ColorM.

View Source
const GeoMDim = 3

GeoMDim is a dimension of a GeoM.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorM

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

A ColorM represents a matrix to transform coloring when rendering an image.

A ColorM is applied to the source alpha color while an Image's pixels' format is alpha premultiplied. Before applying a matrix, a color is un-multiplied, and after applying the matrix, the color is multiplied again.

The initial value is identity.

func Monochrome

func Monochrome() ColorM

Monochrome returns a color matrix to make an image monochrome.

func RotateHue

func RotateHue(theta float64) ColorM

RotateHue is deprecated as of 1.2.0-alpha. Use RotateHue member function instead.

func ScaleColor

func ScaleColor(r, g, b, a float64) ColorM

ScaleColor is deprecated as of 1.2.0-alpha. Use Scale instead.

func TranslateColor

func TranslateColor(r, g, b, a float64) ColorM

TranslateColor is deprecated as of 1.2.0-alpha. Use Translate instead.

func (*ColorM) Add

func (c *ColorM) Add(other ColorM)

Add is deprecated.

func (*ColorM) ChangeHSV

func (c *ColorM) ChangeHSV(hueTheta float64, saturationScale float64, valueScale float64)

ChangeHSV changes HSV (Hue-Saturation-Value) elements. hueTheta is a radian value to ratate hue. saturationScale is a value to scale saturation. valueScale is a value to scale value (a.k.a. brightness).

This conversion uses RGB to/from YCrCb conversion.

func (*ColorM) Concat

func (c *ColorM) Concat(other *ColorM)

Concat multiplies a color matrix with the other color matrix. This is same as muptiplying the matrix other and the matrix c in this order.

func (*ColorM) Equals

func (c *ColorM) Equals(other *ColorM) bool

func (*ColorM) Reset

func (c *ColorM) Reset()

func (*ColorM) RotateHue

func (c *ColorM) RotateHue(theta float64)

RotateHue rotates the hue.

func (*ColorM) Scale

func (c *ColorM) Scale(r, g, b, a float64)

Scale scales the matrix by (r, g, b, a).

func (*ColorM) SetElement

func (c *ColorM) SetElement(i, j int, element float64)

SetElement sets an element at (i, j).

func (*ColorM) Translate

func (c *ColorM) Translate(r, g, b, a float64)

Translate translates the matrix by (r, g, b, a).

func (*ColorM) UnsafeElements

func (c *ColorM) UnsafeElements() []float64

type GeoM

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

A GeoM represents a matrix to transform geometry when rendering an image.

The initial value is identity.

func RotateGeo

func RotateGeo(theta float64) GeoM

RotateGeo is deprecated as of 1.2.0-alpha. Use Rotate instead.

func ScaleGeo

func ScaleGeo(x, y float64) GeoM

ScaleGeo is deprecated as of 1.2.0-alpha. Use Scale instead.

func TranslateGeo

func TranslateGeo(tx, ty float64) GeoM

TranslateGeo is deprecated as of 1.2.0-alpha. Use Translate instead.

func (*GeoM) Add

func (g *GeoM) Add(other GeoM)

Add is deprecated.

func (*GeoM) Concat

func (g *GeoM) Concat(other *GeoM)

Concat multiplies a geometry matrix with the other geometry matrix. This is same as muptiplying the matrix other and the matrix g in this order.

func (*GeoM) Elements

func (g *GeoM) Elements() (a, b, c, d, tx, ty float64)

func (*GeoM) Reset

func (g *GeoM) Reset()

func (*GeoM) Rotate

func (g *GeoM) Rotate(theta float64)

Rotate rotates the matrix by theta.

func (*GeoM) Scale

func (g *GeoM) Scale(x, y float64)

Scale scales the matrix by (x, y).

func (*GeoM) SetElement

func (g *GeoM) SetElement(i, j int, element float64)

SetElement sets an element at (i, j).

func (*GeoM) Translate

func (g *GeoM) Translate(tx, ty float64)

Translate translates the matrix by (x, y).

Jump to

Keyboard shortcuts

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