nanovg-0.2.0.0: Haskell bindings for nanovg

Safe HaskellNone
LanguageHaskell2010

NanoVG.Internal.Transformation

Synopsis

Documentation

newtype Transformation

Affine matrix

[sx kx tx]
[ky sy ty]
[ 0  0  1]

Constructors

Transformation (M23 CFloat) 

resetTransform :: Context -> IO ()

Resets current transform to a identity matrix.

transform :: Context -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> IO ()

Premultiplies current coordinate system by specified matrix. The parameters are interpreted as matrix as follows:

[a c e]
[b d f]
[0 0 1]

translate :: Context -> CFloat -> CFloat -> IO ()

Translates current coordinate system.

rotate :: Context -> CFloat -> IO ()

Rotates current coordinate system. Angle is specified in radians.

skewX :: Context -> CFloat -> IO ()

Skews the current coordinate system along X axis. Angle is specified in radians.

skewY :: Context -> CFloat -> IO ()

Skews the current coordinate system along Y axis. Angle is specified in radians.

scale :: Context -> CFloat -> CFloat -> IO ()

Scales the current coordinate system.

currentTransform :: Context -> IO Transformation

Returns the current transformation matrix.

transformIdentity :: IO Transformation

Sets the transform to identity matrix.

transformTranslate :: CFloat -> CFloat -> IO Transformation

Sets the transform to translation matrix matrix.

transformScale :: CFloat -> CFloat -> IO Transformation

Sets the transform to scale matrix.

transformRotate :: CFloat -> IO Transformation

Sets the transform to rotate matrix. Angle is specified in radians.

transformSkewX :: CFloat -> IO Transformation

Sets the transform to skew-x matrix. Angle is specified in radians.

transformSkewY :: CFloat -> IO Transformation

Sets the transform to skew-y matrix. Angle is specified in radians.

transformMultiply :: Transformation -> Transformation -> IO Transformation

Sets the transform to the result of multiplication of two transforms, of A = A*B.

transformPremultiply :: Transformation -> Transformation -> IO Transformation

Sets the transform to the result of multiplication of two transforms, of A = B*A.

transformInverse :: Transformation -> IO Transformation

Sets the destination to inverse of specified transform. Returns 1 if the inverse could be calculated, else 0.

transformPoint :: Transformation -> CFloat -> CFloat -> (CFloat, CFloat)

Transform a point by given transform.

degToRad :: CFloat -> CFloat

Converts degrees to radians.

radToDeg :: CFloat -> CFloat

Converts radians to degrees.

skewX'_ :: Context -> CFloat -> IO ()

skewY'_ :: Context -> CFloat -> IO ()

scale'_ :: Context -> CFloat -> CFloat -> IO ()