Documentation ¶
Index ¶
- Constants
- 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 []float32, translate []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) String() string
- 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 ¶
This section is empty.
Types ¶
type ColorM ¶
type ColorM interface { String() string IsIdentity() bool ScaleOnly() bool At(i, j int) float32 Elements(body []float32, translate []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 ¶
type ColorMIdentity struct{}
func (ColorMIdentity) At ¶
func (c ColorMIdentity) At(i, j int) float32
func (ColorMIdentity) Concat ¶
func (c ColorMIdentity) Concat(other ColorM) ColorM
func (ColorMIdentity) Elements ¶
func (c ColorMIdentity) Elements(body []float32, translate []float32)
func (ColorMIdentity) Equals ¶
func (c ColorMIdentity) Equals(other ColorM) bool
func (ColorMIdentity) Invert ¶
func (c ColorMIdentity) Invert() ColorM
func (ColorMIdentity) IsIdentity ¶
func (c ColorMIdentity) IsIdentity() bool
func (ColorMIdentity) IsInvertible ¶
func (c ColorMIdentity) IsInvertible() bool
func (ColorMIdentity) Scale ¶
func (c ColorMIdentity) Scale(r, g, b, a float32) ColorM
func (ColorMIdentity) ScaleOnly ¶
func (c ColorMIdentity) ScaleOnly() bool
func (ColorMIdentity) String ¶
func (c ColorMIdentity) String() string
func (ColorMIdentity) Translate ¶
func (c ColorMIdentity) Translate(r, g, b, a float32) ColorM
Click to show internal directories.
Click to hide internal directories.