| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Gsk.Structs.Transform
Description
The GskTransform structure contains only private data.
Synopsis
- newtype Transform = Transform (ManagedPtr Transform)
- transformEqual :: (HasCallStack, MonadIO m) => Transform -> Maybe Transform -> m Bool
- transformGetCategory :: (HasCallStack, MonadIO m) => Transform -> m TransformCategory
- transformInvert :: (HasCallStack, MonadIO m) => Transform -> m (Maybe Transform)
- transformMatrix :: (HasCallStack, MonadIO m) => Transform -> Matrix -> m Transform
- transformNew :: (HasCallStack, MonadIO m) => m Transform
- transformParse :: (HasCallStack, MonadIO m) => Text -> m (Bool, Transform)
- transformPerspective :: (HasCallStack, MonadIO m) => Transform -> Float -> m Transform
- transformPrint :: (HasCallStack, MonadIO m) => Transform -> String -> m ()
- transformRef :: (HasCallStack, MonadIO m) => Transform -> m Transform
- transformRotate :: (HasCallStack, MonadIO m) => Transform -> Float -> m Transform
- transformRotate3d :: (HasCallStack, MonadIO m) => Transform -> Float -> Vec3 -> m Transform
- transformScale :: (HasCallStack, MonadIO m) => Transform -> Float -> Float -> m Transform
- transformScale3d :: (HasCallStack, MonadIO m) => Transform -> Float -> Float -> Float -> m Transform
- transformTo2d :: (HasCallStack, MonadIO m) => Transform -> m (Float, Float, Float, Float, Float, Float)
- transformToAffine :: (HasCallStack, MonadIO m) => Transform -> m (Float, Float, Float, Float)
- transformToMatrix :: (HasCallStack, MonadIO m) => Transform -> m Matrix
- transformToString :: (HasCallStack, MonadIO m) => Transform -> m Text
- transformToTranslate :: (HasCallStack, MonadIO m) => Transform -> m (Float, Float)
- transformTransform :: (HasCallStack, MonadIO m) => Transform -> Maybe Transform -> m Transform
- transformTransformBounds :: (HasCallStack, MonadIO m) => Transform -> Rect -> m Rect
- transformTransformPoint :: (HasCallStack, MonadIO m) => Transform -> Point -> m Point
- transformTranslate :: (HasCallStack, MonadIO m) => Transform -> Point -> m Transform
- transformTranslate3d :: (HasCallStack, MonadIO m) => Transform -> Point3D -> m Transform
- transformUnref :: (HasCallStack, MonadIO m) => Transform -> m ()
Exported types
Memory-managed wrapper type.
Instances
| Eq Transform Source # | |
| GBoxed Transform Source # | |
Defined in GI.Gsk.Structs.Transform | |
| ManagedPtrNewtype Transform Source # | |
Defined in GI.Gsk.Structs.Transform Methods toManagedPtr :: Transform -> ManagedPtr Transform | |
| TypedObject Transform Source # | |
Defined in GI.Gsk.Structs.Transform | |
| HasParentTypes Transform Source # | |
Defined in GI.Gsk.Structs.Transform | |
| IsGValue (Maybe Transform) Source # | Convert |
Defined in GI.Gsk.Structs.Transform Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Transform -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Transform) | |
| type ParentTypes Transform Source # | |
Defined in GI.Gsk.Structs.Transform | |
Methods
Click to display all available methods, including inherited ones
Methods
equal, invert, matrix, perspective, print, ref, rotate, rotate3d, scale, scale3d, to2d, toAffine, toMatrix, toString, toTranslate, transform, transformBounds, transformPoint, translate, translate3d, unref.
Getters
Setters
None.
equal
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Maybe Transform |
|
| -> m Bool | Returns: |
Checks two transforms for equality.
getCategory
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> m TransformCategory | Returns: The category of the transform |
Returns the category this transform belongs to.
invert
matrix
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Matrix |
|
| -> m Transform | Returns: The new transform |
Multiplies next with the given matrix.
new
transformNew :: (HasCallStack, MonadIO m) => m Transform Source #
No description available in the introspection data.
parse
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m (Bool, Transform) | Returns: |
Parses the given string into a transform and puts it in
outTransform. Strings printed via transformToString
can be read in again successfully using this function.
If string does not describe a valid transform, False is
returned and Nothing is put in outTransform.
perspective
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Float |
|
| -> m Transform | Returns: The new transform |
Applies a perspective projection transform. This transform scales points in X and Y based on their Z value, scaling points with positive Z values away from the origin, and those with negative Z values towards the origin. Points on the z=0 plane are unchanged.
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> String |
|
| -> m () |
Converts self into a human-readable string representation suitable
for printing that can later be parsed with transformParse.
ref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> m Transform | Returns: the |
Acquires a reference on the given Transform.
rotate
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Float |
|
| -> m Transform | Returns: The new transform |
Rotates next angle degrees in 2D - or in 3Dspeak, around the z axis.
rotate3d
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Float |
|
| -> Vec3 |
|
| -> m Transform | Returns: The new transform |
Rotates next angle degrees around axis.
For a rotation in 2D space, use transformRotate.
scale
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Float |
|
| -> Float |
|
| -> m Transform | Returns: The new transform |
Scales next in 2-dimensional space by the given factors.
Use transformScale3d to scale in all 3 dimensions.
scale3d
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Float |
|
| -> Float |
|
| -> Float |
|
| -> m Transform | Returns: The new transform |
Scales next by the given factors.
to2d
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> m (Float, Float, Float, Float, Float, Float) |
Converts a Transform to a 2D transformation
matrix.
self must be a 2D transformation. If you are not
sure, use transformGetCategory >=
TransformCategory2d to check.
The returned values have the following layout:
plain code
| xx yx | | a b 0 | | xy yy | = | c d 0 | | dx dy | | tx ty 1 |
This function can be used to convert between a Transform
and a matrix type from other 2D drawing libraries, in particular
Cairo.
toAffine
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> m (Float, Float, Float, Float) |
Converts a Transform to 2D affine transformation
factors.
self must be a 2D transformation. If you are not
sure, use transformGetCategory >=
TransformCategory2dAffine to check.
toMatrix
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> m Matrix |
Computes the actual value of self and stores it in outMatrix.
The previous value of outMatrix will be ignored.
toString
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> m Text | Returns: A new string for |
Converts a matrix into a string that is suitable for
printing and can later be parsed with transformParse.
This is a wrapper around transformPrint, see that function
for details.
toTranslate
Converts a Transform to a translation operation.
self must be a 2D transformation. If you are not
sure, use transformGetCategory >=
TransformCategory2dTranslate to check.
transform
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Maybe Transform |
|
| -> m Transform | Returns: The new transform |
Applies all the operations from other to next.
transformBounds
transformTransformBounds Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Rect |
|
| -> m Rect |
Transforms a Rect using the given transform self.
The result is the bounding box containing the coplanar quad.
transformPoint
transformTransformPoint Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Point |
|
| -> m Point |
Transforms a Point using the given transform self.
translate
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Point |
|
| -> m Transform | Returns: The new transform |
Translates next in 2dimensional space by point.
translate3d
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> Point3D |
|
| -> m Transform | Returns: The new transform |
Translates next by point.
unref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Transform |
|
| -> m () |
Releases a reference on the given Transform.
If the reference was the last, the resources associated to the self are
freed.