affine

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2018 License: Apache-2.0 Imports: 2 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 (*ColorM) Add

func (c *ColorM) Add(other ColorM)

Add is deprecated.

func (*ColorM) Apply added in v1.6.0

func (c *ColorM) Apply(clr color.Color) color.Color

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) 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 (*GeoM) Add

func (g *GeoM) Add(other GeoM)

Add is deprecated.

func (*GeoM) Apply added in v1.6.0

func (g *GeoM) Apply(x, y float64) (x2, y2 float64)

func (*GeoM) Apply32 added in v1.6.0

func (g *GeoM) Apply32(x, y float64) (x2, y2 float32)

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