2013-06-15 10:07:14 +02:00
|
|
|
package graphics
|
|
|
|
|
|
|
|
type ColorMatrix struct {
|
|
|
|
AffineMatrix
|
|
|
|
}
|
|
|
|
|
|
|
|
const colorMatrixDimension = 5
|
|
|
|
|
|
|
|
func NewColorMatrix() *ColorMatrix {
|
|
|
|
return &ColorMatrix{*NewAffineMatrix(colorMatrixDimension)}
|
|
|
|
}
|
|
|
|
|
|
|
|
func IdentityColorMatrix() *ColorMatrix {
|
|
|
|
return &ColorMatrix{*IdentityAffineMatrix(colorMatrixDimension)}
|
|
|
|
}
|
|
|
|
|
2013-06-19 17:49:44 +02:00
|
|
|
func (matrix *ColorMatrix) Concat(other *ColorMatrix) *ColorMatrix {
|
|
|
|
return &ColorMatrix{*matrix.AffineMatrix.Concat(&other.AffineMatrix)}
|
|
|
|
}
|
|
|
|
|
2013-06-15 10:07:14 +02:00
|
|
|
func (matrix *ColorMatrix) Clone() *ColorMatrix {
|
|
|
|
return &ColorMatrix{*(matrix.AffineMatrix.Clone())}
|
|
|
|
}
|