nanovg-0.6.0.0: Haskell bindings for nanovg

Safe HaskellNone
LanguageHaskell2010

NanoVG.Internal.Transformation

Synopsis

Documentation

newtype Transformation Source #

Affine matrix

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

Constructors

Transformation (M23 CFloat) 
Instances
Eq Transformation Source # 
Instance details

Defined in NanoVG.Internal.Transformation

Ord Transformation Source # 
Instance details

Defined in NanoVG.Internal.Transformation

Read Transformation Source # 
Instance details

Defined in NanoVG.Internal.Transformation

Show Transformation Source # 
Instance details

Defined in NanoVG.Internal.Transformation

Storable Transformation Source # 
Instance details

Defined in NanoVG.Internal.Transformation

resetTransform :: Context -> IO () Source #

Resets current transform to a identity matrix.

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

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 () Source #

Translates current coordinate system.

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

Rotates current coordinate system. Angle is specified in radians.

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

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

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

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

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

Scales the current coordinate system.

currentTransform :: Context -> IO Transformation Source #

Returns the current transformation matrix.

transformIdentity :: IO Transformation Source #

Sets the transform to identity matrix.

transformTranslate :: CFloat -> CFloat -> IO Transformation Source #

Sets the transform to translation matrix matrix.

transformScale :: CFloat -> CFloat -> IO Transformation Source #

Sets the transform to scale matrix.

transformRotate :: CFloat -> IO Transformation Source #

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

transformSkewX :: CFloat -> IO Transformation Source #

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

transformSkewY :: CFloat -> IO Transformation Source #

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

transformMultiply :: Transformation -> Transformation -> IO Transformation Source #

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

transformPremultiply :: Transformation -> Transformation -> IO Transformation Source #

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

transformInverse :: Transformation -> IO Transformation Source #

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

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

Transform a point by given transform.

degToRad :: CFloat -> CFloat Source #

Converts degrees to radians.

radToDeg :: CFloat -> CFloat Source #

Converts radians to degrees.