Documentation ¶
Index ¶
- Constants
- func ColorMString(c ColorM) string
- type ColorM
- type ColorMIdentity
- func (c ColorMIdentity) Apply(clr color.Color) color.Color
- func (c ColorMIdentity) At(i, j int) float32
- func (c ColorMIdentity) Concat(other ColorM) ColorM
- func (c ColorMIdentity) Elements(body *[16]float32, translate *[4]float32)
- func (c ColorMIdentity) Equals(other ColorM) bool
- func (c ColorMIdentity) Invert() ColorM
- func (c ColorMIdentity) IsIdentity() bool
- func (c ColorMIdentity) IsInvertible() bool
- func (c ColorMIdentity) Scale(r, g, b, a float32) ColorM
- func (c ColorMIdentity) ScaleOnly() bool
- func (c ColorMIdentity) Translate(r, g, b, a float32) ColorM
Constants ¶
View Source
const ColorMDim = 5
ColorMDim is a dimension of a ColorM.
Variables ¶
This section is empty.
Functions ¶
func ColorMString ¶ added in v2.2.0
Types ¶
type ColorM ¶
type ColorM interface { IsIdentity() bool ScaleOnly() bool At(i, j int) float32 Elements(body *[16]float32, translate *[4]float32) Apply(clr color.Color) color.Color // IsInvertible returns a boolean value indicating // whether the matrix c is invertible or not. IsInvertible() bool // Invert inverts the matrix. // If c is not invertible, Invert panics. Invert() ColorM Equals(other ColorM) bool // 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. Concat(other ColorM) ColorM // Scale scales the matrix by (r, g, b, a). Scale(r, g, b, a float32) ColorM // Translate translates the matrix by (r, g, b, a). Translate(r, g, b, a float32) ColorM // contains filtered or unexported methods }
ColorM represents a matrix to transform coloring when rendering an image.
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.
type ColorMIdentity ¶ added in v2.2.0
type ColorMIdentity struct{}
func (ColorMIdentity) Apply ¶ added in v2.2.0
func (c ColorMIdentity) Apply(clr color.Color) color.Color
func (ColorMIdentity) At ¶ added in v2.2.0
func (c ColorMIdentity) At(i, j int) float32
func (ColorMIdentity) Concat ¶ added in v2.2.0
func (c ColorMIdentity) Concat(other ColorM) ColorM
func (ColorMIdentity) Elements ¶ added in v2.2.0
func (c ColorMIdentity) Elements(body *[16]float32, translate *[4]float32)
func (ColorMIdentity) Equals ¶ added in v2.2.0
func (c ColorMIdentity) Equals(other ColorM) bool
func (ColorMIdentity) Invert ¶ added in v2.2.0
func (c ColorMIdentity) Invert() ColorM
func (ColorMIdentity) IsIdentity ¶ added in v2.2.0
func (c ColorMIdentity) IsIdentity() bool
func (ColorMIdentity) IsInvertible ¶ added in v2.2.0
func (c ColorMIdentity) IsInvertible() bool
func (ColorMIdentity) Scale ¶ added in v2.2.0
func (c ColorMIdentity) Scale(r, g, b, a float32) ColorM
func (ColorMIdentity) ScaleOnly ¶ added in v2.2.0
func (c ColorMIdentity) ScaleOnly() bool
func (ColorMIdentity) Translate ¶ added in v2.2.0
func (c ColorMIdentity) Translate(r, g, b, a float32) ColorM
Click to show internal directories.
Click to hide internal directories.