Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Transform ¶
Transform returns a transformation matrix for the generic Draw function that scales, translates, and rotates the source image by the given degrees, to make it fit within the destination rectangle dr, given its original size sr (unrotated). To avoid scaling, ensure that the dr and sr are the same dimensions (post rotation). rotDeg = rotation degrees to apply in the mapping: 90 = left, -90 = right, 180 = invert.
Types ¶
type Matrix ¶
type Matrix struct { // MVP is the vertex projection matrix, // for positioning the vertex points MVP math32.Matrix4 // UVP is the U,V texture coordinate projection matrix // for positioning the texture. For fill mode, the // last column holds the fill color. UVP math32.Matrix4 }
Matrix holds the projection matricies.
func Config ¶
func Config(destSz image.Point, xform math32.Matrix3, txsz image.Point, sr image.Rectangle, flipY bool) *Matrix
Config configures the draw matrix for given draw parameters: xform is the transform mapping source to destination coordinates (translation, scaling), txsz is the size of the texture to draw, sr is the source region (set to tex.Format.Bounds() for all) flipY inverts the Y axis of the source image.