Documentation ¶
Index ¶
- Constants
- type ColorM
- func (c *ColorM) Add(other *ColorM) *ColorM
- func (c *ColorM) Apply(clr color.Color) color.Color
- func (c *ColorM) ChangeHSV(hueTheta float64, saturationScale float32, valueScale float32) *ColorM
- func (c *ColorM) Concat(other *ColorM) *ColorM
- func (c *ColorM) Element(i, j int) float32
- func (c *ColorM) Equals(other *ColorM) bool
- func (c *ColorM) Invert() *ColorM
- func (c *ColorM) IsInvertible() bool
- func (c *ColorM) Scale(r, g, b, a float32) *ColorM
- func (c *ColorM) ScaleOnly() bool
- func (c *ColorM) SetElement(i, j int, element float32) *ColorM
- func (c *ColorM) Translate(r, g, b, a float32) *ColorM
- func (c *ColorM) UnsafeElements() ([]float32, []float32)
Constants ¶
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 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) ChangeHSV ¶
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 ¶
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) Invert ¶ added in v1.12.0
Invert inverts the matrix. If c is not invertible, Invert panics.
func (*ColorM) IsInvertible ¶ added in v1.12.0
IsInvertible returns a boolean value indicating whether the matrix c is invertible or not.
func (*ColorM) SetElement ¶
SetElement sets an element at (i, j).