ebiten: github.com/hajimehoshi/ebiten/internal/affine Index | Files

package affine

import "github.com/hajimehoshi/ebiten/internal/affine"

Index

Package Files

affine.go colorm.go

Constants

const ColorMDim = 5

ColorMDim is a dimension of a ColorM.

type ColorM Uses

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 Uses

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

Add is deprecated.

func (*ColorM) Apply Uses

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

func (*ColorM) ChangeHSV Uses

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 Uses

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 Uses

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

func (*ColorM) Scale Uses

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

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

func (*ColorM) ScaleOnly Uses

func (c *ColorM) ScaleOnly() bool

func (*ColorM) SetElement Uses

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

SetElement sets an element at (i, j).

func (*ColorM) Translate Uses

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

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

func (*ColorM) UnsafeElements Uses

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

Package affine imports 2 packages (graph) and is imported by 14 packages. Updated 2019-03-10. Refresh now. Tools for package owners.