mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
24 lines
553 B
Go
24 lines
553 B
Go
package graphics
|
|
|
|
type ColorMatrix struct {
|
|
AffineMatrix
|
|
}
|
|
|
|
const colorMatrixDimension = 5
|
|
|
|
func NewColorMatrix() *ColorMatrix {
|
|
return &ColorMatrix{*NewAffineMatrix(colorMatrixDimension)}
|
|
}
|
|
|
|
func IdentityColorMatrix() *ColorMatrix {
|
|
return &ColorMatrix{*IdentityAffineMatrix(colorMatrixDimension)}
|
|
}
|
|
|
|
func (matrix *ColorMatrix) Concat(other *ColorMatrix) *ColorMatrix {
|
|
return &ColorMatrix{*matrix.AffineMatrix.Concat(&other.AffineMatrix)}
|
|
}
|
|
|
|
func (matrix *ColorMatrix) Clone() *ColorMatrix {
|
|
return &ColorMatrix{*(matrix.AffineMatrix.Clone())}
|
|
}
|