Back to godoc.org

Package affine

v1.11.8
Latest Go to latest

The latest major version is .

Published: Sep 6, 2020 | License: Apache-2.0 | Module: github.com/hajimehoshi/ebiten

Index

Constants

const ColorMDim = 5

ColorMDim is a dimension of a ColorM.

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 nil and initial value is identity.

func (*ColorM) Add

func (c *ColorM) Add(other *ColorM) *ColorM

Add is deprecated.

func (*ColorM) Apply

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

func (*ColorM) ChangeHSV

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

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) *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) Scale

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

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

func (*ColorM) ScaleOnly

func (c *ColorM) ScaleOnly() bool

func (*ColorM) SetElement

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

SetElement sets an element at (i, j).

func (*ColorM) Translate

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

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

func (*ColorM) UnsafeElements

func (c *ColorM) UnsafeElements() ([]float32, []float32)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier