{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Graphene.Structs.Matrix
(
Matrix(..) ,
newZeroMatrix ,
#if defined(ENABLE_OVERLOADING)
ResolveMatrixMethod ,
#endif
matrixAlloc ,
#if defined(ENABLE_OVERLOADING)
MatrixDecomposeMethodInfo ,
#endif
matrixDecompose ,
#if defined(ENABLE_OVERLOADING)
MatrixDeterminantMethodInfo ,
#endif
matrixDeterminant ,
#if defined(ENABLE_OVERLOADING)
MatrixEqualMethodInfo ,
#endif
matrixEqual ,
#if defined(ENABLE_OVERLOADING)
MatrixEqualFastMethodInfo ,
#endif
matrixEqualFast ,
#if defined(ENABLE_OVERLOADING)
MatrixFreeMethodInfo ,
#endif
matrixFree ,
#if defined(ENABLE_OVERLOADING)
MatrixGetRowMethodInfo ,
#endif
matrixGetRow ,
#if defined(ENABLE_OVERLOADING)
MatrixGetValueMethodInfo ,
#endif
matrixGetValue ,
#if defined(ENABLE_OVERLOADING)
MatrixGetXScaleMethodInfo ,
#endif
matrixGetXScale ,
#if defined(ENABLE_OVERLOADING)
MatrixGetXTranslationMethodInfo ,
#endif
matrixGetXTranslation ,
#if defined(ENABLE_OVERLOADING)
MatrixGetYScaleMethodInfo ,
#endif
matrixGetYScale ,
#if defined(ENABLE_OVERLOADING)
MatrixGetYTranslationMethodInfo ,
#endif
matrixGetYTranslation ,
#if defined(ENABLE_OVERLOADING)
MatrixGetZScaleMethodInfo ,
#endif
matrixGetZScale ,
#if defined(ENABLE_OVERLOADING)
MatrixGetZTranslationMethodInfo ,
#endif
matrixGetZTranslation ,
#if defined(ENABLE_OVERLOADING)
MatrixInitFrom2dMethodInfo ,
#endif
matrixInitFrom2d ,
#if defined(ENABLE_OVERLOADING)
MatrixInitFromFloatMethodInfo ,
#endif
matrixInitFromFloat ,
#if defined(ENABLE_OVERLOADING)
MatrixInitFromMatrixMethodInfo ,
#endif
matrixInitFromMatrix ,
#if defined(ENABLE_OVERLOADING)
MatrixInitFromVec4MethodInfo ,
#endif
matrixInitFromVec4 ,
#if defined(ENABLE_OVERLOADING)
MatrixInitFrustumMethodInfo ,
#endif
matrixInitFrustum ,
#if defined(ENABLE_OVERLOADING)
MatrixInitIdentityMethodInfo ,
#endif
matrixInitIdentity ,
#if defined(ENABLE_OVERLOADING)
MatrixInitLookAtMethodInfo ,
#endif
matrixInitLookAt ,
#if defined(ENABLE_OVERLOADING)
MatrixInitOrthoMethodInfo ,
#endif
matrixInitOrtho ,
#if defined(ENABLE_OVERLOADING)
MatrixInitPerspectiveMethodInfo ,
#endif
matrixInitPerspective ,
#if defined(ENABLE_OVERLOADING)
MatrixInitRotateMethodInfo ,
#endif
matrixInitRotate ,
#if defined(ENABLE_OVERLOADING)
MatrixInitScaleMethodInfo ,
#endif
matrixInitScale ,
#if defined(ENABLE_OVERLOADING)
MatrixInitSkewMethodInfo ,
#endif
matrixInitSkew ,
#if defined(ENABLE_OVERLOADING)
MatrixInitTranslateMethodInfo ,
#endif
matrixInitTranslate ,
#if defined(ENABLE_OVERLOADING)
MatrixInterpolateMethodInfo ,
#endif
matrixInterpolate ,
#if defined(ENABLE_OVERLOADING)
MatrixInverseMethodInfo ,
#endif
matrixInverse ,
#if defined(ENABLE_OVERLOADING)
MatrixIs2dMethodInfo ,
#endif
matrixIs2d ,
#if defined(ENABLE_OVERLOADING)
MatrixIsBackfaceVisibleMethodInfo ,
#endif
matrixIsBackfaceVisible ,
#if defined(ENABLE_OVERLOADING)
MatrixIsIdentityMethodInfo ,
#endif
matrixIsIdentity ,
#if defined(ENABLE_OVERLOADING)
MatrixIsSingularMethodInfo ,
#endif
matrixIsSingular ,
#if defined(ENABLE_OVERLOADING)
MatrixMultiplyMethodInfo ,
#endif
matrixMultiply ,
#if defined(ENABLE_OVERLOADING)
MatrixNearMethodInfo ,
#endif
matrixNear ,
#if defined(ENABLE_OVERLOADING)
MatrixNormalizeMethodInfo ,
#endif
matrixNormalize ,
#if defined(ENABLE_OVERLOADING)
MatrixPerspectiveMethodInfo ,
#endif
matrixPerspective ,
#if defined(ENABLE_OVERLOADING)
MatrixPrintMethodInfo ,
#endif
matrixPrint ,
#if defined(ENABLE_OVERLOADING)
MatrixProjectPointMethodInfo ,
#endif
matrixProjectPoint ,
#if defined(ENABLE_OVERLOADING)
MatrixProjectRectMethodInfo ,
#endif
matrixProjectRect ,
#if defined(ENABLE_OVERLOADING)
MatrixProjectRectBoundsMethodInfo ,
#endif
matrixProjectRectBounds ,
#if defined(ENABLE_OVERLOADING)
MatrixRotateMethodInfo ,
#endif
matrixRotate ,
#if defined(ENABLE_OVERLOADING)
MatrixRotateEulerMethodInfo ,
#endif
matrixRotateEuler ,
#if defined(ENABLE_OVERLOADING)
MatrixRotateQuaternionMethodInfo ,
#endif
matrixRotateQuaternion ,
#if defined(ENABLE_OVERLOADING)
MatrixRotateXMethodInfo ,
#endif
matrixRotateX ,
#if defined(ENABLE_OVERLOADING)
MatrixRotateYMethodInfo ,
#endif
matrixRotateY ,
#if defined(ENABLE_OVERLOADING)
MatrixRotateZMethodInfo ,
#endif
matrixRotateZ ,
#if defined(ENABLE_OVERLOADING)
MatrixScaleMethodInfo ,
#endif
matrixScale ,
#if defined(ENABLE_OVERLOADING)
MatrixSkewXyMethodInfo ,
#endif
matrixSkewXy ,
#if defined(ENABLE_OVERLOADING)
MatrixSkewXzMethodInfo ,
#endif
matrixSkewXz ,
#if defined(ENABLE_OVERLOADING)
MatrixSkewYzMethodInfo ,
#endif
matrixSkewYz ,
#if defined(ENABLE_OVERLOADING)
MatrixTo2dMethodInfo ,
#endif
matrixTo2d ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformBoundsMethodInfo ,
#endif
matrixTransformBounds ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformBoxMethodInfo ,
#endif
matrixTransformBox ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformPointMethodInfo ,
#endif
matrixTransformPoint ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformPoint3dMethodInfo ,
#endif
matrixTransformPoint3d ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformRayMethodInfo ,
#endif
matrixTransformRay ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformRectMethodInfo ,
#endif
matrixTransformRect ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformSphereMethodInfo ,
#endif
matrixTransformSphere ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformVec3MethodInfo ,
#endif
matrixTransformVec3 ,
#if defined(ENABLE_OVERLOADING)
MatrixTransformVec4MethodInfo ,
#endif
matrixTransformVec4 ,
#if defined(ENABLE_OVERLOADING)
MatrixTranslateMethodInfo ,
#endif
matrixTranslate ,
#if defined(ENABLE_OVERLOADING)
MatrixTransposeMethodInfo ,
#endif
matrixTranspose ,
#if defined(ENABLE_OVERLOADING)
MatrixUnprojectPoint3dMethodInfo ,
#endif
matrixUnprojectPoint3d ,
#if defined(ENABLE_OVERLOADING)
MatrixUntransformBoundsMethodInfo ,
#endif
matrixUntransformBounds ,
#if defined(ENABLE_OVERLOADING)
MatrixUntransformPointMethodInfo ,
#endif
matrixUntransformPoint ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import {-# SOURCE #-} qualified GI.Graphene.Structs.Box as Graphene.Box
import {-# SOURCE #-} qualified GI.Graphene.Structs.Euler as Graphene.Euler
import {-# SOURCE #-} qualified GI.Graphene.Structs.Point as Graphene.Point
import {-# SOURCE #-} qualified GI.Graphene.Structs.Point3D as Graphene.Point3D
import {-# SOURCE #-} qualified GI.Graphene.Structs.Quad as Graphene.Quad
import {-# SOURCE #-} qualified GI.Graphene.Structs.Quaternion as Graphene.Quaternion
import {-# SOURCE #-} qualified GI.Graphene.Structs.Ray as Graphene.Ray
import {-# SOURCE #-} qualified GI.Graphene.Structs.Rect as Graphene.Rect
import {-# SOURCE #-} qualified GI.Graphene.Structs.Sphere as Graphene.Sphere
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec4 as Graphene.Vec4
newtype Matrix = Matrix (SP.ManagedPtr Matrix)
deriving (Matrix -> Matrix -> Bool
(Matrix -> Matrix -> Bool)
-> (Matrix -> Matrix -> Bool) -> Eq Matrix
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Matrix -> Matrix -> Bool
== :: Matrix -> Matrix -> Bool
$c/= :: Matrix -> Matrix -> Bool
/= :: Matrix -> Matrix -> Bool
Eq)
instance SP.ManagedPtrNewtype Matrix where
toManagedPtr :: Matrix -> ManagedPtr Matrix
toManagedPtr (Matrix ManagedPtr Matrix
p) = ManagedPtr Matrix
p
foreign import ccall "graphene_matrix_get_type" c_graphene_matrix_get_type ::
IO GType
type instance O.ParentTypes Matrix = '[]
instance O.HasParentTypes Matrix
instance B.Types.TypedObject Matrix where
glibType :: IO GType
glibType = IO GType
c_graphene_matrix_get_type
instance B.Types.GBoxed Matrix
instance B.GValue.IsGValue (Maybe Matrix) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_graphene_matrix_get_type
gvalueSet_ :: Ptr GValue -> Maybe Matrix -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Matrix
P.Nothing = Ptr GValue -> Ptr Matrix -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Matrix
forall a. Ptr a
FP.nullPtr :: FP.Ptr Matrix)
gvalueSet_ Ptr GValue
gv (P.Just Matrix
obj) = Matrix -> (Ptr Matrix -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Matrix
obj (Ptr GValue -> Ptr Matrix -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Matrix)
gvalueGet_ Ptr GValue
gv = do
Ptr Matrix
ptr <- Ptr GValue -> IO (Ptr Matrix)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Matrix)
if Ptr Matrix
ptr Ptr Matrix -> Ptr Matrix -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Matrix
forall a. Ptr a
FP.nullPtr
then Matrix -> Maybe Matrix
forall a. a -> Maybe a
P.Just (Matrix -> Maybe Matrix) -> IO Matrix -> IO (Maybe Matrix)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Matrix -> Matrix
Matrix Ptr Matrix
ptr
else Maybe Matrix -> IO (Maybe Matrix)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Matrix
forall a. Maybe a
P.Nothing
newZeroMatrix :: MonadIO m => m Matrix
newZeroMatrix :: forall (m :: * -> *). MonadIO m => m Matrix
newZeroMatrix = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr Matrix)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
64 IO (Ptr Matrix) -> (Ptr Matrix -> IO Matrix) -> IO Matrix
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Matrix
instance tag ~ 'AttrSet => Constructible Matrix tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr Matrix -> Matrix) -> [AttrOp Matrix tag] -> m Matrix
new ManagedPtr Matrix -> Matrix
_ [AttrOp Matrix tag]
attrs = do
Matrix
o <- m Matrix
forall (m :: * -> *). MonadIO m => m Matrix
newZeroMatrix
Matrix -> [AttrOp Matrix 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Matrix
o [AttrOp Matrix tag]
[AttrOp Matrix 'AttrSet]
attrs
Matrix -> m Matrix
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
o
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Matrix
type instance O.AttributeList Matrix = MatrixAttributeList
type MatrixAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "graphene_matrix_alloc" graphene_matrix_alloc ::
IO (Ptr Matrix)
matrixAlloc ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Matrix
matrixAlloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Matrix
matrixAlloc = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
result <- IO (Ptr Matrix)
graphene_matrix_alloc
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixAlloc" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_matrix_decompose" graphene_matrix_decompose ::
Ptr Matrix ->
Ptr Graphene.Vec3.Vec3 ->
Ptr Graphene.Vec3.Vec3 ->
Ptr Graphene.Quaternion.Quaternion ->
Ptr Graphene.Vec3.Vec3 ->
Ptr Graphene.Vec4.Vec4 ->
IO CInt
matrixDecompose ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m ((Bool, Graphene.Vec3.Vec3, Graphene.Vec3.Vec3, Graphene.Quaternion.Quaternion, Graphene.Vec3.Vec3, Graphene.Vec4.Vec4))
matrixDecompose :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m (Bool, Vec3, Vec3, Quaternion, Vec3, Vec4)
matrixDecompose Matrix
m = IO (Bool, Vec3, Vec3, Quaternion, Vec3, Vec4)
-> m (Bool, Vec3, Vec3, Quaternion, Vec3, Vec4)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Vec3, Vec3, Quaternion, Vec3, Vec4)
-> m (Bool, Vec3, Vec3, Quaternion, Vec3, Vec4))
-> IO (Bool, Vec3, Vec3, Quaternion, Vec3, Vec4)
-> m (Bool, Vec3, Vec3, Quaternion, Vec3, Vec4)
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Vec3
translate <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
Ptr Vec3
scale <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
Ptr Quaternion
rotate <- Int -> IO (Ptr Quaternion)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Quaternion.Quaternion)
Ptr Vec3
shear <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
Ptr Vec4
perspective <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec4.Vec4)
CInt
result <- Ptr Matrix
-> Ptr Vec3
-> Ptr Vec3
-> Ptr Quaternion
-> Ptr Vec3
-> Ptr Vec4
-> IO CInt
graphene_matrix_decompose Ptr Matrix
m' Ptr Vec3
translate Ptr Vec3
scale Ptr Quaternion
rotate Ptr Vec3
shear Ptr Vec4
perspective
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Vec3
translate' <- ((ManagedPtr Vec3 -> Vec3) -> Ptr Vec3 -> IO Vec3
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec3 -> Vec3
Graphene.Vec3.Vec3) Ptr Vec3
translate
Vec3
scale' <- ((ManagedPtr Vec3 -> Vec3) -> Ptr Vec3 -> IO Vec3
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec3 -> Vec3
Graphene.Vec3.Vec3) Ptr Vec3
scale
Quaternion
rotate' <- ((ManagedPtr Quaternion -> Quaternion)
-> Ptr Quaternion -> IO Quaternion
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Quaternion -> Quaternion
Graphene.Quaternion.Quaternion) Ptr Quaternion
rotate
Vec3
shear' <- ((ManagedPtr Vec3 -> Vec3) -> Ptr Vec3 -> IO Vec3
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec3 -> Vec3
Graphene.Vec3.Vec3) Ptr Vec3
shear
Vec4
perspective' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Graphene.Vec4.Vec4) Ptr Vec4
perspective
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
(Bool, Vec3, Vec3, Quaternion, Vec3, Vec4)
-> IO (Bool, Vec3, Vec3, Quaternion, Vec3, Vec4)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Vec3
translate', Vec3
scale', Quaternion
rotate', Vec3
shear', Vec4
perspective')
#if defined(ENABLE_OVERLOADING)
data MatrixDecomposeMethodInfo
instance (signature ~ (m ((Bool, Graphene.Vec3.Vec3, Graphene.Vec3.Vec3, Graphene.Quaternion.Quaternion, Graphene.Vec3.Vec3, Graphene.Vec4.Vec4))), MonadIO m) => O.OverloadedMethod MatrixDecomposeMethodInfo Matrix signature where
overloadedMethod = matrixDecompose
instance O.OverloadedMethodInfo MatrixDecomposeMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixDecompose",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixDecompose"
})
#endif
foreign import ccall "graphene_matrix_determinant" graphene_matrix_determinant ::
Ptr Matrix ->
IO CFloat
matrixDeterminant ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Float
matrixDeterminant :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Float
matrixDeterminant Matrix
m = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CFloat
result <- Ptr Matrix -> IO CFloat
graphene_matrix_determinant Ptr Matrix
m'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data MatrixDeterminantMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod MatrixDeterminantMethodInfo Matrix signature where
overloadedMethod = matrixDeterminant
instance O.OverloadedMethodInfo MatrixDeterminantMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixDeterminant",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixDeterminant"
})
#endif
foreign import ccall "graphene_matrix_equal" graphene_matrix_equal ::
Ptr Matrix ->
Ptr Matrix ->
IO CInt
matrixEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Matrix
-> m Bool
matrixEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Matrix -> m Bool
matrixEqual Matrix
a Matrix
b = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
a' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
a
Ptr Matrix
b' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
b
CInt
result <- Ptr Matrix -> Ptr Matrix -> IO CInt
graphene_matrix_equal Ptr Matrix
a' Ptr Matrix
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
a
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
b
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatrixEqualMethodInfo
instance (signature ~ (Matrix -> m Bool), MonadIO m) => O.OverloadedMethod MatrixEqualMethodInfo Matrix signature where
overloadedMethod = matrixEqual
instance O.OverloadedMethodInfo MatrixEqualMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixEqual"
})
#endif
foreign import ccall "graphene_matrix_equal_fast" graphene_matrix_equal_fast ::
Ptr Matrix ->
Ptr Matrix ->
IO CInt
matrixEqualFast ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Matrix
-> m Bool
matrixEqualFast :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Matrix -> m Bool
matrixEqualFast Matrix
a Matrix
b = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
a' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
a
Ptr Matrix
b' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
b
CInt
result <- Ptr Matrix -> Ptr Matrix -> IO CInt
graphene_matrix_equal_fast Ptr Matrix
a' Ptr Matrix
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
a
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
b
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatrixEqualFastMethodInfo
instance (signature ~ (Matrix -> m Bool), MonadIO m) => O.OverloadedMethod MatrixEqualFastMethodInfo Matrix signature where
overloadedMethod = matrixEqualFast
instance O.OverloadedMethodInfo MatrixEqualFastMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixEqualFast",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixEqualFast"
})
#endif
foreign import ccall "graphene_matrix_free" graphene_matrix_free ::
Ptr Matrix ->
IO ()
matrixFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m ()
matrixFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Matrix -> m ()
matrixFree Matrix
m = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Matrix -> IO ()
graphene_matrix_free Ptr Matrix
m'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod MatrixFreeMethodInfo Matrix signature where
overloadedMethod = matrixFree
instance O.OverloadedMethodInfo MatrixFreeMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixFree"
})
#endif
foreign import ccall "graphene_matrix_get_row" graphene_matrix_get_row ::
Ptr Matrix ->
Word32 ->
Ptr Graphene.Vec4.Vec4 ->
IO ()
matrixGetRow ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Word32
-> m (Graphene.Vec4.Vec4)
matrixGetRow :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Word32 -> m Vec4
matrixGetRow Matrix
m Word32
index_ = IO Vec4 -> m Vec4
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec4.Vec4)
Ptr Matrix -> Word32 -> Ptr Vec4 -> IO ()
graphene_matrix_get_row Ptr Matrix
m' Word32
index_ Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Graphene.Vec4.Vec4) Ptr Vec4
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Vec4 -> IO Vec4
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data MatrixGetRowMethodInfo
instance (signature ~ (Word32 -> m (Graphene.Vec4.Vec4)), MonadIO m) => O.OverloadedMethod MatrixGetRowMethodInfo Matrix signature where
overloadedMethod = matrixGetRow
instance O.OverloadedMethodInfo MatrixGetRowMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixGetRow",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixGetRow"
})
#endif
foreign import ccall "graphene_matrix_get_value" graphene_matrix_get_value ::
Ptr Matrix ->
Word32 ->
Word32 ->
IO CFloat
matrixGetValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Word32
-> Word32
-> m Float
matrixGetValue :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Word32 -> Word32 -> m Float
matrixGetValue Matrix
m Word32
row Word32
col = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CFloat
result <- Ptr Matrix -> Word32 -> Word32 -> IO CFloat
graphene_matrix_get_value Ptr Matrix
m' Word32
row Word32
col
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data MatrixGetValueMethodInfo
instance (signature ~ (Word32 -> Word32 -> m Float), MonadIO m) => O.OverloadedMethod MatrixGetValueMethodInfo Matrix signature where
overloadedMethod = matrixGetValue
instance O.OverloadedMethodInfo MatrixGetValueMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixGetValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixGetValue"
})
#endif
foreign import ccall "graphene_matrix_get_x_scale" graphene_matrix_get_x_scale ::
Ptr Matrix ->
IO CFloat
matrixGetXScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Float
matrixGetXScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Float
matrixGetXScale Matrix
m = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CFloat
result <- Ptr Matrix -> IO CFloat
graphene_matrix_get_x_scale Ptr Matrix
m'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data MatrixGetXScaleMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod MatrixGetXScaleMethodInfo Matrix signature where
overloadedMethod = matrixGetXScale
instance O.OverloadedMethodInfo MatrixGetXScaleMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixGetXScale",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixGetXScale"
})
#endif
foreign import ccall "graphene_matrix_get_x_translation" graphene_matrix_get_x_translation ::
Ptr Matrix ->
IO CFloat
matrixGetXTranslation ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Float
matrixGetXTranslation :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Float
matrixGetXTranslation Matrix
m = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CFloat
result <- Ptr Matrix -> IO CFloat
graphene_matrix_get_x_translation Ptr Matrix
m'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data MatrixGetXTranslationMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod MatrixGetXTranslationMethodInfo Matrix signature where
overloadedMethod = matrixGetXTranslation
instance O.OverloadedMethodInfo MatrixGetXTranslationMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixGetXTranslation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixGetXTranslation"
})
#endif
foreign import ccall "graphene_matrix_get_y_scale" graphene_matrix_get_y_scale ::
Ptr Matrix ->
IO CFloat
matrixGetYScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Float
matrixGetYScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Float
matrixGetYScale Matrix
m = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CFloat
result <- Ptr Matrix -> IO CFloat
graphene_matrix_get_y_scale Ptr Matrix
m'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data MatrixGetYScaleMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod MatrixGetYScaleMethodInfo Matrix signature where
overloadedMethod = matrixGetYScale
instance O.OverloadedMethodInfo MatrixGetYScaleMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixGetYScale",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixGetYScale"
})
#endif
foreign import ccall "graphene_matrix_get_y_translation" graphene_matrix_get_y_translation ::
Ptr Matrix ->
IO CFloat
matrixGetYTranslation ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Float
matrixGetYTranslation :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Float
matrixGetYTranslation Matrix
m = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CFloat
result <- Ptr Matrix -> IO CFloat
graphene_matrix_get_y_translation Ptr Matrix
m'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data MatrixGetYTranslationMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod MatrixGetYTranslationMethodInfo Matrix signature where
overloadedMethod = matrixGetYTranslation
instance O.OverloadedMethodInfo MatrixGetYTranslationMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixGetYTranslation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixGetYTranslation"
})
#endif
foreign import ccall "graphene_matrix_get_z_scale" graphene_matrix_get_z_scale ::
Ptr Matrix ->
IO CFloat
matrixGetZScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Float
matrixGetZScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Float
matrixGetZScale Matrix
m = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CFloat
result <- Ptr Matrix -> IO CFloat
graphene_matrix_get_z_scale Ptr Matrix
m'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data MatrixGetZScaleMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod MatrixGetZScaleMethodInfo Matrix signature where
overloadedMethod = matrixGetZScale
instance O.OverloadedMethodInfo MatrixGetZScaleMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixGetZScale",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixGetZScale"
})
#endif
foreign import ccall "graphene_matrix_get_z_translation" graphene_matrix_get_z_translation ::
Ptr Matrix ->
IO CFloat
matrixGetZTranslation ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Float
matrixGetZTranslation :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Float
matrixGetZTranslation Matrix
m = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CFloat
result <- Ptr Matrix -> IO CFloat
graphene_matrix_get_z_translation Ptr Matrix
m'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data MatrixGetZTranslationMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod MatrixGetZTranslationMethodInfo Matrix signature where
overloadedMethod = matrixGetZTranslation
instance O.OverloadedMethodInfo MatrixGetZTranslationMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixGetZTranslation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixGetZTranslation"
})
#endif
foreign import ccall "graphene_matrix_init_from_2d" graphene_matrix_init_from_2d ::
Ptr Matrix ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
IO (Ptr Matrix)
matrixInitFrom2d ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> m Matrix
matrixInitFrom2d :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> m Matrix
matrixInitFrom2d Matrix
m Double
xx Double
yx Double
xy Double
yy Double
x0 Double
y0 = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let xx' :: CDouble
xx' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
xx
let yx' :: CDouble
yx' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
yx
let xy' :: CDouble
xy' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
xy
let yy' :: CDouble
yy' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
yy
let x0' :: CDouble
x0' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x0
let y0' :: CDouble
y0' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y0
Ptr Matrix
result <- Ptr Matrix
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> IO (Ptr Matrix)
graphene_matrix_init_from_2d Ptr Matrix
m' CDouble
xx' CDouble
yx' CDouble
xy' CDouble
yy' CDouble
x0' CDouble
y0'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitFrom2d" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitFrom2dMethodInfo
instance (signature ~ (Double -> Double -> Double -> Double -> Double -> Double -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitFrom2dMethodInfo Matrix signature where
overloadedMethod = matrixInitFrom2d
instance O.OverloadedMethodInfo MatrixInitFrom2dMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitFrom2d",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitFrom2d"
})
#endif
foreign import ccall "graphene_matrix_init_from_float" graphene_matrix_init_from_float ::
Ptr Matrix ->
Ptr CFloat ->
IO (Ptr Matrix)
matrixInitFromFloat ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> [Float]
-> m Matrix
matrixInitFromFloat :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> [Float] -> m Matrix
matrixInitFromFloat Matrix
m [Float]
v = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr CFloat
v' <- ((Float -> CFloat) -> [Float] -> IO (Ptr CFloat)
forall a b. Storable b => (a -> b) -> [a] -> IO (Ptr b)
packMapStorableArray Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac) [Float]
v
Ptr Matrix
result <- Ptr Matrix -> Ptr CFloat -> IO (Ptr Matrix)
graphene_matrix_init_from_float Ptr Matrix
m' Ptr CFloat
v'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitFromFloat" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
v'
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitFromFloatMethodInfo
instance (signature ~ ([Float] -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitFromFloatMethodInfo Matrix signature where
overloadedMethod = matrixInitFromFloat
instance O.OverloadedMethodInfo MatrixInitFromFloatMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitFromFloat",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitFromFloat"
})
#endif
foreign import ccall "graphene_matrix_init_from_matrix" graphene_matrix_init_from_matrix ::
Ptr Matrix ->
Ptr Matrix ->
IO (Ptr Matrix)
matrixInitFromMatrix ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Matrix
-> m Matrix
matrixInitFromMatrix :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Matrix -> m Matrix
matrixInitFromMatrix Matrix
m Matrix
src = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Matrix
src' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
src
Ptr Matrix
result <- Ptr Matrix -> Ptr Matrix -> IO (Ptr Matrix)
graphene_matrix_init_from_matrix Ptr Matrix
m' Ptr Matrix
src'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitFromMatrix" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
src
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitFromMatrixMethodInfo
instance (signature ~ (Matrix -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitFromMatrixMethodInfo Matrix signature where
overloadedMethod = matrixInitFromMatrix
instance O.OverloadedMethodInfo MatrixInitFromMatrixMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitFromMatrix",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitFromMatrix"
})
#endif
foreign import ccall "graphene_matrix_init_from_vec4" graphene_matrix_init_from_vec4 ::
Ptr Matrix ->
Ptr Graphene.Vec4.Vec4 ->
Ptr Graphene.Vec4.Vec4 ->
Ptr Graphene.Vec4.Vec4 ->
Ptr Graphene.Vec4.Vec4 ->
IO (Ptr Matrix)
matrixInitFromVec4 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Vec4.Vec4
-> Graphene.Vec4.Vec4
-> Graphene.Vec4.Vec4
-> Graphene.Vec4.Vec4
-> m Matrix
matrixInitFromVec4 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Vec4 -> Vec4 -> Vec4 -> Vec4 -> m Matrix
matrixInitFromVec4 Matrix
m Vec4
v0 Vec4
v1 Vec4
v2 Vec4
v3 = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Vec4
v0' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v0
Ptr Vec4
v1' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v1
Ptr Vec4
v2' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v2
Ptr Vec4
v3' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v3
Ptr Matrix
result <- Ptr Matrix
-> Ptr Vec4 -> Ptr Vec4 -> Ptr Vec4 -> Ptr Vec4 -> IO (Ptr Matrix)
graphene_matrix_init_from_vec4 Ptr Matrix
m' Ptr Vec4
v0' Ptr Vec4
v1' Ptr Vec4
v2' Ptr Vec4
v3'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitFromVec4" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v0
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v1
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v2
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v3
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitFromVec4MethodInfo
instance (signature ~ (Graphene.Vec4.Vec4 -> Graphene.Vec4.Vec4 -> Graphene.Vec4.Vec4 -> Graphene.Vec4.Vec4 -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitFromVec4MethodInfo Matrix signature where
overloadedMethod = matrixInitFromVec4
instance O.OverloadedMethodInfo MatrixInitFromVec4MethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitFromVec4",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitFromVec4"
})
#endif
foreign import ccall "graphene_matrix_init_frustum" graphene_matrix_init_frustum ::
Ptr Matrix ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
IO (Ptr Matrix)
matrixInitFrustum ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> Float
-> Float
-> Float
-> Float
-> Float
-> m Matrix
matrixInitFrustum :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix
-> Float -> Float -> Float -> Float -> Float -> Float -> m Matrix
matrixInitFrustum Matrix
m Float
left Float
right Float
bottom Float
top Float
zNear Float
zFar = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let left' :: CFloat
left' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
left
let right' :: CFloat
right' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
right
let bottom' :: CFloat
bottom' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
bottom
let top' :: CFloat
top' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
top
let zNear' :: CFloat
zNear' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
zNear
let zFar' :: CFloat
zFar' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
zFar
Ptr Matrix
result <- Ptr Matrix
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> IO (Ptr Matrix)
graphene_matrix_init_frustum Ptr Matrix
m' CFloat
left' CFloat
right' CFloat
bottom' CFloat
top' CFloat
zNear' CFloat
zFar'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitFrustum" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitFrustumMethodInfo
instance (signature ~ (Float -> Float -> Float -> Float -> Float -> Float -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitFrustumMethodInfo Matrix signature where
overloadedMethod = matrixInitFrustum
instance O.OverloadedMethodInfo MatrixInitFrustumMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitFrustum",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitFrustum"
})
#endif
foreign import ccall "graphene_matrix_init_identity" graphene_matrix_init_identity ::
Ptr Matrix ->
IO (Ptr Matrix)
matrixInitIdentity ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Matrix
matrixInitIdentity :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Matrix
matrixInitIdentity Matrix
m = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Matrix
result <- Ptr Matrix -> IO (Ptr Matrix)
graphene_matrix_init_identity Ptr Matrix
m'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitIdentity" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitIdentityMethodInfo
instance (signature ~ (m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitIdentityMethodInfo Matrix signature where
overloadedMethod = matrixInitIdentity
instance O.OverloadedMethodInfo MatrixInitIdentityMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitIdentity",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitIdentity"
})
#endif
foreign import ccall "graphene_matrix_init_look_at" graphene_matrix_init_look_at ::
Ptr Matrix ->
Ptr Graphene.Vec3.Vec3 ->
Ptr Graphene.Vec3.Vec3 ->
Ptr Graphene.Vec3.Vec3 ->
IO (Ptr Matrix)
matrixInitLookAt ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Vec3.Vec3
-> Graphene.Vec3.Vec3
-> Graphene.Vec3.Vec3
-> m Matrix
matrixInitLookAt :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Vec3 -> Vec3 -> Vec3 -> m Matrix
matrixInitLookAt Matrix
m Vec3
eye Vec3
center Vec3
up = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Vec3
eye' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
eye
Ptr Vec3
center' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
center
Ptr Vec3
up' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
up
Ptr Matrix
result <- Ptr Matrix -> Ptr Vec3 -> Ptr Vec3 -> Ptr Vec3 -> IO (Ptr Matrix)
graphene_matrix_init_look_at Ptr Matrix
m' Ptr Vec3
eye' Ptr Vec3
center' Ptr Vec3
up'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitLookAt" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
eye
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
center
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
up
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitLookAtMethodInfo
instance (signature ~ (Graphene.Vec3.Vec3 -> Graphene.Vec3.Vec3 -> Graphene.Vec3.Vec3 -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitLookAtMethodInfo Matrix signature where
overloadedMethod = matrixInitLookAt
instance O.OverloadedMethodInfo MatrixInitLookAtMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitLookAt",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitLookAt"
})
#endif
foreign import ccall "graphene_matrix_init_ortho" graphene_matrix_init_ortho ::
Ptr Matrix ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
IO (Ptr Matrix)
matrixInitOrtho ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> Float
-> Float
-> Float
-> Float
-> Float
-> m Matrix
matrixInitOrtho :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix
-> Float -> Float -> Float -> Float -> Float -> Float -> m Matrix
matrixInitOrtho Matrix
m Float
left Float
right Float
top Float
bottom Float
zNear Float
zFar = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let left' :: CFloat
left' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
left
let right' :: CFloat
right' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
right
let top' :: CFloat
top' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
top
let bottom' :: CFloat
bottom' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
bottom
let zNear' :: CFloat
zNear' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
zNear
let zFar' :: CFloat
zFar' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
zFar
Ptr Matrix
result <- Ptr Matrix
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> IO (Ptr Matrix)
graphene_matrix_init_ortho Ptr Matrix
m' CFloat
left' CFloat
right' CFloat
top' CFloat
bottom' CFloat
zNear' CFloat
zFar'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitOrtho" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitOrthoMethodInfo
instance (signature ~ (Float -> Float -> Float -> Float -> Float -> Float -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitOrthoMethodInfo Matrix signature where
overloadedMethod = matrixInitOrtho
instance O.OverloadedMethodInfo MatrixInitOrthoMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitOrtho",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitOrtho"
})
#endif
foreign import ccall "graphene_matrix_init_perspective" graphene_matrix_init_perspective ::
Ptr Matrix ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
IO (Ptr Matrix)
matrixInitPerspective ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> Float
-> Float
-> Float
-> m Matrix
matrixInitPerspective :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> Float -> Float -> Float -> m Matrix
matrixInitPerspective Matrix
m Float
fovy Float
aspect Float
zNear Float
zFar = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let fovy' :: CFloat
fovy' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
fovy
let aspect' :: CFloat
aspect' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
aspect
let zNear' :: CFloat
zNear' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
zNear
let zFar' :: CFloat
zFar' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
zFar
Ptr Matrix
result <- Ptr Matrix
-> CFloat -> CFloat -> CFloat -> CFloat -> IO (Ptr Matrix)
graphene_matrix_init_perspective Ptr Matrix
m' CFloat
fovy' CFloat
aspect' CFloat
zNear' CFloat
zFar'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitPerspective" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitPerspectiveMethodInfo
instance (signature ~ (Float -> Float -> Float -> Float -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitPerspectiveMethodInfo Matrix signature where
overloadedMethod = matrixInitPerspective
instance O.OverloadedMethodInfo MatrixInitPerspectiveMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitPerspective",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitPerspective"
})
#endif
foreign import ccall "graphene_matrix_init_rotate" graphene_matrix_init_rotate ::
Ptr Matrix ->
CFloat ->
Ptr Graphene.Vec3.Vec3 ->
IO (Ptr Matrix)
matrixInitRotate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> Graphene.Vec3.Vec3
-> m Matrix
matrixInitRotate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> Vec3 -> m Matrix
matrixInitRotate Matrix
m Float
angle Vec3
axis = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let angle' :: CFloat
angle' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
angle
Ptr Vec3
axis' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
axis
Ptr Matrix
result <- Ptr Matrix -> CFloat -> Ptr Vec3 -> IO (Ptr Matrix)
graphene_matrix_init_rotate Ptr Matrix
m' CFloat
angle' Ptr Vec3
axis'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitRotate" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
axis
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitRotateMethodInfo
instance (signature ~ (Float -> Graphene.Vec3.Vec3 -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitRotateMethodInfo Matrix signature where
overloadedMethod = matrixInitRotate
instance O.OverloadedMethodInfo MatrixInitRotateMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitRotate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitRotate"
})
#endif
foreign import ccall "graphene_matrix_init_scale" graphene_matrix_init_scale ::
Ptr Matrix ->
CFloat ->
CFloat ->
CFloat ->
IO (Ptr Matrix)
matrixInitScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> Float
-> Float
-> m Matrix
matrixInitScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> Float -> Float -> m Matrix
matrixInitScale Matrix
m Float
x Float
y Float
z = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let x' :: CFloat
x' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
x
let y' :: CFloat
y' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
y
let z' :: CFloat
z' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
z
Ptr Matrix
result <- Ptr Matrix -> CFloat -> CFloat -> CFloat -> IO (Ptr Matrix)
graphene_matrix_init_scale Ptr Matrix
m' CFloat
x' CFloat
y' CFloat
z'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitScale" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitScaleMethodInfo
instance (signature ~ (Float -> Float -> Float -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitScaleMethodInfo Matrix signature where
overloadedMethod = matrixInitScale
instance O.OverloadedMethodInfo MatrixInitScaleMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitScale",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitScale"
})
#endif
foreign import ccall "graphene_matrix_init_skew" graphene_matrix_init_skew ::
Ptr Matrix ->
CFloat ->
CFloat ->
IO (Ptr Matrix)
matrixInitSkew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> Float
-> m Matrix
matrixInitSkew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> Float -> m Matrix
matrixInitSkew Matrix
m Float
xSkew Float
ySkew = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let xSkew' :: CFloat
xSkew' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
xSkew
let ySkew' :: CFloat
ySkew' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
ySkew
Ptr Matrix
result <- Ptr Matrix -> CFloat -> CFloat -> IO (Ptr Matrix)
graphene_matrix_init_skew Ptr Matrix
m' CFloat
xSkew' CFloat
ySkew'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitSkew" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitSkewMethodInfo
instance (signature ~ (Float -> Float -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitSkewMethodInfo Matrix signature where
overloadedMethod = matrixInitSkew
instance O.OverloadedMethodInfo MatrixInitSkewMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitSkew",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitSkew"
})
#endif
foreign import ccall "graphene_matrix_init_translate" graphene_matrix_init_translate ::
Ptr Matrix ->
Ptr Graphene.Point3D.Point3D ->
IO (Ptr Matrix)
matrixInitTranslate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Point3D.Point3D
-> m Matrix
matrixInitTranslate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Point3D -> m Matrix
matrixInitTranslate Matrix
m Point3D
p = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
Ptr Matrix
result <- Ptr Matrix -> Ptr Point3D -> IO (Ptr Matrix)
graphene_matrix_init_translate Ptr Matrix
m' Ptr Point3D
p'
Text -> Ptr Matrix -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"matrixInitTranslate" Ptr Matrix
result
Matrix
result' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result'
#if defined(ENABLE_OVERLOADING)
data MatrixInitTranslateMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m Matrix), MonadIO m) => O.OverloadedMethod MatrixInitTranslateMethodInfo Matrix signature where
overloadedMethod = matrixInitTranslate
instance O.OverloadedMethodInfo MatrixInitTranslateMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInitTranslate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInitTranslate"
})
#endif
foreign import ccall "graphene_matrix_interpolate" graphene_matrix_interpolate ::
Ptr Matrix ->
Ptr Matrix ->
CDouble ->
Ptr Matrix ->
IO ()
matrixInterpolate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Matrix
-> Double
-> m (Matrix)
matrixInterpolate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Matrix -> Double -> m Matrix
matrixInterpolate Matrix
a Matrix
b Double
factor = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
a' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
a
Ptr Matrix
b' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
b
let factor' :: CDouble
factor' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
factor
Ptr Matrix
res <- Int -> IO (Ptr Matrix)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
64 :: IO (Ptr Matrix)
Ptr Matrix -> Ptr Matrix -> CDouble -> Ptr Matrix -> IO ()
graphene_matrix_interpolate Ptr Matrix
a' Ptr Matrix
b' CDouble
factor' Ptr Matrix
res
Matrix
res' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
a
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
b
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
res'
#if defined(ENABLE_OVERLOADING)
data MatrixInterpolateMethodInfo
instance (signature ~ (Matrix -> Double -> m (Matrix)), MonadIO m) => O.OverloadedMethod MatrixInterpolateMethodInfo Matrix signature where
overloadedMethod = matrixInterpolate
instance O.OverloadedMethodInfo MatrixInterpolateMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInterpolate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInterpolate"
})
#endif
foreign import ccall "graphene_matrix_inverse" graphene_matrix_inverse ::
Ptr Matrix ->
Ptr Matrix ->
IO CInt
matrixInverse ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m ((Bool, Matrix))
matrixInverse :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m (Bool, Matrix)
matrixInverse Matrix
m = IO (Bool, Matrix) -> m (Bool, Matrix)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Matrix) -> m (Bool, Matrix))
-> IO (Bool, Matrix) -> m (Bool, Matrix)
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Matrix
res <- Int -> IO (Ptr Matrix)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
64 :: IO (Ptr Matrix)
CInt
result <- Ptr Matrix -> Ptr Matrix -> IO CInt
graphene_matrix_inverse Ptr Matrix
m' Ptr Matrix
res
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Matrix
res' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
(Bool, Matrix) -> IO (Bool, Matrix)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Matrix
res')
#if defined(ENABLE_OVERLOADING)
data MatrixInverseMethodInfo
instance (signature ~ (m ((Bool, Matrix))), MonadIO m) => O.OverloadedMethod MatrixInverseMethodInfo Matrix signature where
overloadedMethod = matrixInverse
instance O.OverloadedMethodInfo MatrixInverseMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixInverse",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixInverse"
})
#endif
foreign import ccall "graphene_matrix_is_2d" graphene_matrix_is_2d ::
Ptr Matrix ->
IO CInt
matrixIs2d ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Bool
matrixIs2d :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Matrix -> m Bool
matrixIs2d Matrix
m = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CInt
result <- Ptr Matrix -> IO CInt
graphene_matrix_is_2d Ptr Matrix
m'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatrixIs2dMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod MatrixIs2dMethodInfo Matrix signature where
overloadedMethod = matrixIs2d
instance O.OverloadedMethodInfo MatrixIs2dMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixIs2d",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixIs2d"
})
#endif
foreign import ccall "graphene_matrix_is_backface_visible" graphene_matrix_is_backface_visible ::
Ptr Matrix ->
IO CInt
matrixIsBackfaceVisible ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Bool
matrixIsBackfaceVisible :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Matrix -> m Bool
matrixIsBackfaceVisible Matrix
m = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CInt
result <- Ptr Matrix -> IO CInt
graphene_matrix_is_backface_visible Ptr Matrix
m'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatrixIsBackfaceVisibleMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod MatrixIsBackfaceVisibleMethodInfo Matrix signature where
overloadedMethod = matrixIsBackfaceVisible
instance O.OverloadedMethodInfo MatrixIsBackfaceVisibleMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixIsBackfaceVisible",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixIsBackfaceVisible"
})
#endif
foreign import ccall "graphene_matrix_is_identity" graphene_matrix_is_identity ::
Ptr Matrix ->
IO CInt
matrixIsIdentity ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Bool
matrixIsIdentity :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Matrix -> m Bool
matrixIsIdentity Matrix
m = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CInt
result <- Ptr Matrix -> IO CInt
graphene_matrix_is_identity Ptr Matrix
m'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatrixIsIdentityMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod MatrixIsIdentityMethodInfo Matrix signature where
overloadedMethod = matrixIsIdentity
instance O.OverloadedMethodInfo MatrixIsIdentityMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixIsIdentity",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixIsIdentity"
})
#endif
foreign import ccall "graphene_matrix_is_singular" graphene_matrix_is_singular ::
Ptr Matrix ->
IO CInt
matrixIsSingular ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m Bool
matrixIsSingular :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Matrix -> m Bool
matrixIsSingular Matrix
m = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
CInt
result <- Ptr Matrix -> IO CInt
graphene_matrix_is_singular Ptr Matrix
m'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatrixIsSingularMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod MatrixIsSingularMethodInfo Matrix signature where
overloadedMethod = matrixIsSingular
instance O.OverloadedMethodInfo MatrixIsSingularMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixIsSingular",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixIsSingular"
})
#endif
foreign import ccall "graphene_matrix_multiply" graphene_matrix_multiply ::
Ptr Matrix ->
Ptr Matrix ->
Ptr Matrix ->
IO ()
matrixMultiply ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Matrix
-> m (Matrix)
matrixMultiply :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Matrix -> m Matrix
matrixMultiply Matrix
a Matrix
b = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
a' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
a
Ptr Matrix
b' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
b
Ptr Matrix
res <- Int -> IO (Ptr Matrix)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
64 :: IO (Ptr Matrix)
Ptr Matrix -> Ptr Matrix -> Ptr Matrix -> IO ()
graphene_matrix_multiply Ptr Matrix
a' Ptr Matrix
b' Ptr Matrix
res
Matrix
res' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
a
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
b
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
res'
#if defined(ENABLE_OVERLOADING)
data MatrixMultiplyMethodInfo
instance (signature ~ (Matrix -> m (Matrix)), MonadIO m) => O.OverloadedMethod MatrixMultiplyMethodInfo Matrix signature where
overloadedMethod = matrixMultiply
instance O.OverloadedMethodInfo MatrixMultiplyMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixMultiply",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixMultiply"
})
#endif
foreign import ccall "graphene_matrix_near" graphene_matrix_near ::
Ptr Matrix ->
Ptr Matrix ->
CFloat ->
IO CInt
matrixNear ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Matrix
-> Float
-> m Bool
matrixNear :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Matrix -> Float -> m Bool
matrixNear Matrix
a Matrix
b Float
epsilon = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
a' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
a
Ptr Matrix
b' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
b
let epsilon' :: CFloat
epsilon' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
epsilon
CInt
result <- Ptr Matrix -> Ptr Matrix -> CFloat -> IO CInt
graphene_matrix_near Ptr Matrix
a' Ptr Matrix
b' CFloat
epsilon'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
a
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
b
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatrixNearMethodInfo
instance (signature ~ (Matrix -> Float -> m Bool), MonadIO m) => O.OverloadedMethod MatrixNearMethodInfo Matrix signature where
overloadedMethod = matrixNear
instance O.OverloadedMethodInfo MatrixNearMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixNear",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixNear"
})
#endif
foreign import ccall "graphene_matrix_normalize" graphene_matrix_normalize ::
Ptr Matrix ->
Ptr Matrix ->
IO ()
matrixNormalize ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m (Matrix)
matrixNormalize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Matrix
matrixNormalize Matrix
m = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Matrix
res <- Int -> IO (Ptr Matrix)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
64 :: IO (Ptr Matrix)
Ptr Matrix -> Ptr Matrix -> IO ()
graphene_matrix_normalize Ptr Matrix
m' Ptr Matrix
res
Matrix
res' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
res'
#if defined(ENABLE_OVERLOADING)
data MatrixNormalizeMethodInfo
instance (signature ~ (m (Matrix)), MonadIO m) => O.OverloadedMethod MatrixNormalizeMethodInfo Matrix signature where
overloadedMethod = matrixNormalize
instance O.OverloadedMethodInfo MatrixNormalizeMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixNormalize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixNormalize"
})
#endif
foreign import ccall "graphene_matrix_perspective" graphene_matrix_perspective ::
Ptr Matrix ->
CFloat ->
Ptr Matrix ->
IO ()
matrixPerspective ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> m (Matrix)
matrixPerspective :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> m Matrix
matrixPerspective Matrix
m Float
depth = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let depth' :: CFloat
depth' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
depth
Ptr Matrix
res <- Int -> IO (Ptr Matrix)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
64 :: IO (Ptr Matrix)
Ptr Matrix -> CFloat -> Ptr Matrix -> IO ()
graphene_matrix_perspective Ptr Matrix
m' CFloat
depth' Ptr Matrix
res
Matrix
res' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
res'
#if defined(ENABLE_OVERLOADING)
data MatrixPerspectiveMethodInfo
instance (signature ~ (Float -> m (Matrix)), MonadIO m) => O.OverloadedMethod MatrixPerspectiveMethodInfo Matrix signature where
overloadedMethod = matrixPerspective
instance O.OverloadedMethodInfo MatrixPerspectiveMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixPerspective",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixPerspective"
})
#endif
foreign import ccall "graphene_matrix_print" graphene_matrix_print ::
Ptr Matrix ->
IO ()
matrixPrint ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m ()
matrixPrint :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Matrix -> m ()
matrixPrint Matrix
m = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Matrix -> IO ()
graphene_matrix_print Ptr Matrix
m'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixPrintMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod MatrixPrintMethodInfo Matrix signature where
overloadedMethod = matrixPrint
instance O.OverloadedMethodInfo MatrixPrintMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixPrint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixPrint"
})
#endif
foreign import ccall "graphene_matrix_project_point" graphene_matrix_project_point ::
Ptr Matrix ->
Ptr Graphene.Point.Point ->
Ptr Graphene.Point.Point ->
IO ()
matrixProjectPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Point.Point
-> m (Graphene.Point.Point)
matrixProjectPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Point -> m Point
matrixProjectPoint Matrix
m Point
p = IO Point -> m Point
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Point
p' <- Point -> IO (Ptr Point)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point
p
Ptr Point
res <- Int -> IO (Ptr Point)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
8 :: IO (Ptr Graphene.Point.Point)
Ptr Matrix -> Ptr Point -> Ptr Point -> IO ()
graphene_matrix_project_point Ptr Matrix
m' Ptr Point
p' Ptr Point
res
Point
res' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Point -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point
p
Point -> IO Point
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point
res'
#if defined(ENABLE_OVERLOADING)
data MatrixProjectPointMethodInfo
instance (signature ~ (Graphene.Point.Point -> m (Graphene.Point.Point)), MonadIO m) => O.OverloadedMethod MatrixProjectPointMethodInfo Matrix signature where
overloadedMethod = matrixProjectPoint
instance O.OverloadedMethodInfo MatrixProjectPointMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixProjectPoint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixProjectPoint"
})
#endif
foreign import ccall "graphene_matrix_project_rect" graphene_matrix_project_rect ::
Ptr Matrix ->
Ptr Graphene.Rect.Rect ->
Ptr Graphene.Quad.Quad ->
IO ()
matrixProjectRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Rect.Rect
-> m (Graphene.Quad.Quad)
matrixProjectRect :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Rect -> m Quad
matrixProjectRect Matrix
m Rect
r = IO Quad -> m Quad
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Quad -> m Quad) -> IO Quad -> m Quad
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Quad
res <- Int -> IO (Ptr Quad)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Graphene.Quad.Quad)
Ptr Matrix -> Ptr Rect -> Ptr Quad -> IO ()
graphene_matrix_project_rect Ptr Matrix
m' Ptr Rect
r' Ptr Quad
res
Quad
res' <- ((ManagedPtr Quad -> Quad) -> Ptr Quad -> IO Quad
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Quad -> Quad
Graphene.Quad.Quad) Ptr Quad
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Quad -> IO Quad
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Quad
res'
#if defined(ENABLE_OVERLOADING)
data MatrixProjectRectMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> m (Graphene.Quad.Quad)), MonadIO m) => O.OverloadedMethod MatrixProjectRectMethodInfo Matrix signature where
overloadedMethod = matrixProjectRect
instance O.OverloadedMethodInfo MatrixProjectRectMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixProjectRect",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixProjectRect"
})
#endif
foreign import ccall "graphene_matrix_project_rect_bounds" graphene_matrix_project_rect_bounds ::
Ptr Matrix ->
Ptr Graphene.Rect.Rect ->
Ptr Graphene.Rect.Rect ->
IO ()
matrixProjectRectBounds ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Rect.Rect
-> m (Graphene.Rect.Rect)
matrixProjectRectBounds :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Rect -> m Rect
matrixProjectRectBounds Matrix
m Rect
r = IO Rect -> m Rect
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Rect.Rect)
Ptr Matrix -> Ptr Rect -> Ptr Rect -> IO ()
graphene_matrix_project_rect_bounds Ptr Matrix
m' Ptr Rect
r' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Graphene.Rect.Rect) Ptr Rect
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data MatrixProjectRectBoundsMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> m (Graphene.Rect.Rect)), MonadIO m) => O.OverloadedMethod MatrixProjectRectBoundsMethodInfo Matrix signature where
overloadedMethod = matrixProjectRectBounds
instance O.OverloadedMethodInfo MatrixProjectRectBoundsMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixProjectRectBounds",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixProjectRectBounds"
})
#endif
foreign import ccall "graphene_matrix_rotate" graphene_matrix_rotate ::
Ptr Matrix ->
CFloat ->
Ptr Graphene.Vec3.Vec3 ->
IO ()
matrixRotate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> Graphene.Vec3.Vec3
-> m ()
matrixRotate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> Vec3 -> m ()
matrixRotate Matrix
m Float
angle Vec3
axis = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let angle' :: CFloat
angle' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
angle
Ptr Vec3
axis' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
axis
Ptr Matrix -> CFloat -> Ptr Vec3 -> IO ()
graphene_matrix_rotate Ptr Matrix
m' CFloat
angle' Ptr Vec3
axis'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
axis
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixRotateMethodInfo
instance (signature ~ (Float -> Graphene.Vec3.Vec3 -> m ()), MonadIO m) => O.OverloadedMethod MatrixRotateMethodInfo Matrix signature where
overloadedMethod = matrixRotate
instance O.OverloadedMethodInfo MatrixRotateMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixRotate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixRotate"
})
#endif
foreign import ccall "graphene_matrix_rotate_euler" graphene_matrix_rotate_euler ::
Ptr Matrix ->
Ptr Graphene.Euler.Euler ->
IO ()
matrixRotateEuler ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Euler.Euler
-> m ()
matrixRotateEuler :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Euler -> m ()
matrixRotateEuler Matrix
m Euler
e = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Euler
e' <- Euler -> IO (Ptr Euler)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Euler
e
Ptr Matrix -> Ptr Euler -> IO ()
graphene_matrix_rotate_euler Ptr Matrix
m' Ptr Euler
e'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Euler -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Euler
e
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixRotateEulerMethodInfo
instance (signature ~ (Graphene.Euler.Euler -> m ()), MonadIO m) => O.OverloadedMethod MatrixRotateEulerMethodInfo Matrix signature where
overloadedMethod = matrixRotateEuler
instance O.OverloadedMethodInfo MatrixRotateEulerMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixRotateEuler",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixRotateEuler"
})
#endif
foreign import ccall "graphene_matrix_rotate_quaternion" graphene_matrix_rotate_quaternion ::
Ptr Matrix ->
Ptr Graphene.Quaternion.Quaternion ->
IO ()
matrixRotateQuaternion ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Quaternion.Quaternion
-> m ()
matrixRotateQuaternion :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Quaternion -> m ()
matrixRotateQuaternion Matrix
m Quaternion
q = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Quaternion
q' <- Quaternion -> IO (Ptr Quaternion)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Quaternion
q
Ptr Matrix -> Ptr Quaternion -> IO ()
graphene_matrix_rotate_quaternion Ptr Matrix
m' Ptr Quaternion
q'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Quaternion -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Quaternion
q
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixRotateQuaternionMethodInfo
instance (signature ~ (Graphene.Quaternion.Quaternion -> m ()), MonadIO m) => O.OverloadedMethod MatrixRotateQuaternionMethodInfo Matrix signature where
overloadedMethod = matrixRotateQuaternion
instance O.OverloadedMethodInfo MatrixRotateQuaternionMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixRotateQuaternion",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixRotateQuaternion"
})
#endif
foreign import ccall "graphene_matrix_rotate_x" graphene_matrix_rotate_x ::
Ptr Matrix ->
CFloat ->
IO ()
matrixRotateX ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> m ()
matrixRotateX :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> m ()
matrixRotateX Matrix
m Float
angle = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let angle' :: CFloat
angle' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
angle
Ptr Matrix -> CFloat -> IO ()
graphene_matrix_rotate_x Ptr Matrix
m' CFloat
angle'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixRotateXMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m) => O.OverloadedMethod MatrixRotateXMethodInfo Matrix signature where
overloadedMethod = matrixRotateX
instance O.OverloadedMethodInfo MatrixRotateXMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixRotateX",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixRotateX"
})
#endif
foreign import ccall "graphene_matrix_rotate_y" graphene_matrix_rotate_y ::
Ptr Matrix ->
CFloat ->
IO ()
matrixRotateY ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> m ()
matrixRotateY :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> m ()
matrixRotateY Matrix
m Float
angle = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let angle' :: CFloat
angle' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
angle
Ptr Matrix -> CFloat -> IO ()
graphene_matrix_rotate_y Ptr Matrix
m' CFloat
angle'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixRotateYMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m) => O.OverloadedMethod MatrixRotateYMethodInfo Matrix signature where
overloadedMethod = matrixRotateY
instance O.OverloadedMethodInfo MatrixRotateYMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixRotateY",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixRotateY"
})
#endif
foreign import ccall "graphene_matrix_rotate_z" graphene_matrix_rotate_z ::
Ptr Matrix ->
CFloat ->
IO ()
matrixRotateZ ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> m ()
matrixRotateZ :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> m ()
matrixRotateZ Matrix
m Float
angle = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let angle' :: CFloat
angle' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
angle
Ptr Matrix -> CFloat -> IO ()
graphene_matrix_rotate_z Ptr Matrix
m' CFloat
angle'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixRotateZMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m) => O.OverloadedMethod MatrixRotateZMethodInfo Matrix signature where
overloadedMethod = matrixRotateZ
instance O.OverloadedMethodInfo MatrixRotateZMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixRotateZ",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixRotateZ"
})
#endif
foreign import ccall "graphene_matrix_scale" graphene_matrix_scale ::
Ptr Matrix ->
CFloat ->
CFloat ->
CFloat ->
IO ()
matrixScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> Float
-> Float
-> m ()
matrixScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> Float -> Float -> m ()
matrixScale Matrix
m Float
factorX Float
factorY Float
factorZ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let factorX' :: CFloat
factorX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factorX
let factorY' :: CFloat
factorY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factorY
let factorZ' :: CFloat
factorZ' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factorZ
Ptr Matrix -> CFloat -> CFloat -> CFloat -> IO ()
graphene_matrix_scale Ptr Matrix
m' CFloat
factorX' CFloat
factorY' CFloat
factorZ'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixScaleMethodInfo
instance (signature ~ (Float -> Float -> Float -> m ()), MonadIO m) => O.OverloadedMethod MatrixScaleMethodInfo Matrix signature where
overloadedMethod = matrixScale
instance O.OverloadedMethodInfo MatrixScaleMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixScale",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixScale"
})
#endif
foreign import ccall "graphene_matrix_skew_xy" graphene_matrix_skew_xy ::
Ptr Matrix ->
CFloat ->
IO ()
matrixSkewXy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> m ()
matrixSkewXy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> m ()
matrixSkewXy Matrix
m Float
factor = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let factor' :: CFloat
factor' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factor
Ptr Matrix -> CFloat -> IO ()
graphene_matrix_skew_xy Ptr Matrix
m' CFloat
factor'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixSkewXyMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m) => O.OverloadedMethod MatrixSkewXyMethodInfo Matrix signature where
overloadedMethod = matrixSkewXy
instance O.OverloadedMethodInfo MatrixSkewXyMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixSkewXy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixSkewXy"
})
#endif
foreign import ccall "graphene_matrix_skew_xz" graphene_matrix_skew_xz ::
Ptr Matrix ->
CFloat ->
IO ()
matrixSkewXz ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> m ()
matrixSkewXz :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> m ()
matrixSkewXz Matrix
m Float
factor = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let factor' :: CFloat
factor' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factor
Ptr Matrix -> CFloat -> IO ()
graphene_matrix_skew_xz Ptr Matrix
m' CFloat
factor'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixSkewXzMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m) => O.OverloadedMethod MatrixSkewXzMethodInfo Matrix signature where
overloadedMethod = matrixSkewXz
instance O.OverloadedMethodInfo MatrixSkewXzMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixSkewXz",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixSkewXz"
})
#endif
foreign import ccall "graphene_matrix_skew_yz" graphene_matrix_skew_yz ::
Ptr Matrix ->
CFloat ->
IO ()
matrixSkewYz ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Float
-> m ()
matrixSkewYz :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Float -> m ()
matrixSkewYz Matrix
m Float
factor = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
let factor' :: CFloat
factor' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factor
Ptr Matrix -> CFloat -> IO ()
graphene_matrix_skew_yz Ptr Matrix
m' CFloat
factor'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixSkewYzMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m) => O.OverloadedMethod MatrixSkewYzMethodInfo Matrix signature where
overloadedMethod = matrixSkewYz
instance O.OverloadedMethodInfo MatrixSkewYzMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixSkewYz",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixSkewYz"
})
#endif
foreign import ccall "graphene_matrix_to_2d" graphene_matrix_to_2d ::
Ptr Matrix ->
Ptr CDouble ->
Ptr CDouble ->
Ptr CDouble ->
Ptr CDouble ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
matrixTo2d ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m ((Bool, Double, Double, Double, Double, Double, Double))
matrixTo2d :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m (Bool, Double, Double, Double, Double, Double, Double)
matrixTo2d Matrix
m = IO (Bool, Double, Double, Double, Double, Double, Double)
-> m (Bool, Double, Double, Double, Double, Double, Double)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double, Double, Double, Double, Double, Double)
-> m (Bool, Double, Double, Double, Double, Double, Double))
-> IO (Bool, Double, Double, Double, Double, Double, Double)
-> m (Bool, Double, Double, Double, Double, Double, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr CDouble
xx <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
yx <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
xy <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
yy <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
x0 <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
y0 <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Matrix
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> IO CInt
graphene_matrix_to_2d Ptr Matrix
m' Ptr CDouble
xx Ptr CDouble
yx Ptr CDouble
xy Ptr CDouble
yy Ptr CDouble
x0 Ptr CDouble
y0
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CDouble
xx' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
xx
let xx'' :: Double
xx'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
xx'
CDouble
yx' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
yx
let yx'' :: Double
yx'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
yx'
CDouble
xy' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
xy
let xy'' :: Double
xy'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
xy'
CDouble
yy' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
yy
let yy'' :: Double
yy'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
yy'
CDouble
x0' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
x0
let x0'' :: Double
x0'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
x0'
CDouble
y0' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
y0
let y0'' :: Double
y0'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
y0'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
xx
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
yx
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
xy
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
yy
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
x0
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
y0
(Bool, Double, Double, Double, Double, Double, Double)
-> IO (Bool, Double, Double, Double, Double, Double, Double)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
xx'', Double
yx'', Double
xy'', Double
yy'', Double
x0'', Double
y0'')
#if defined(ENABLE_OVERLOADING)
data MatrixTo2dMethodInfo
instance (signature ~ (m ((Bool, Double, Double, Double, Double, Double, Double))), MonadIO m) => O.OverloadedMethod MatrixTo2dMethodInfo Matrix signature where
overloadedMethod = matrixTo2d
instance O.OverloadedMethodInfo MatrixTo2dMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTo2d",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTo2d"
})
#endif
foreign import ccall "graphene_matrix_transform_bounds" graphene_matrix_transform_bounds ::
Ptr Matrix ->
Ptr Graphene.Rect.Rect ->
Ptr Graphene.Rect.Rect ->
IO ()
matrixTransformBounds ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Rect.Rect
-> m (Graphene.Rect.Rect)
matrixTransformBounds :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Rect -> m Rect
matrixTransformBounds Matrix
m Rect
r = IO Rect -> m Rect
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Rect.Rect)
Ptr Matrix -> Ptr Rect -> Ptr Rect -> IO ()
graphene_matrix_transform_bounds Ptr Matrix
m' Ptr Rect
r' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Graphene.Rect.Rect) Ptr Rect
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformBoundsMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> m (Graphene.Rect.Rect)), MonadIO m) => O.OverloadedMethod MatrixTransformBoundsMethodInfo Matrix signature where
overloadedMethod = matrixTransformBounds
instance O.OverloadedMethodInfo MatrixTransformBoundsMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformBounds",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformBounds"
})
#endif
foreign import ccall "graphene_matrix_transform_box" graphene_matrix_transform_box ::
Ptr Matrix ->
Ptr Graphene.Box.Box ->
Ptr Graphene.Box.Box ->
IO ()
matrixTransformBox ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Box.Box
-> m (Graphene.Box.Box)
matrixTransformBox :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Box -> m Box
matrixTransformBox Matrix
m Box
b = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Box
b' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
b
Ptr Box
res <- Int -> IO (Ptr Box)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Graphene.Box.Box)
Ptr Matrix -> Ptr Box -> Ptr Box -> IO ()
graphene_matrix_transform_box Ptr Matrix
m' Ptr Box
b' Ptr Box
res
Box
res' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Graphene.Box.Box) Ptr Box
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
b
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformBoxMethodInfo
instance (signature ~ (Graphene.Box.Box -> m (Graphene.Box.Box)), MonadIO m) => O.OverloadedMethod MatrixTransformBoxMethodInfo Matrix signature where
overloadedMethod = matrixTransformBox
instance O.OverloadedMethodInfo MatrixTransformBoxMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformBox",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformBox"
})
#endif
foreign import ccall "graphene_matrix_transform_point" graphene_matrix_transform_point ::
Ptr Matrix ->
Ptr Graphene.Point.Point ->
Ptr Graphene.Point.Point ->
IO ()
matrixTransformPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Point.Point
-> m (Graphene.Point.Point)
matrixTransformPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Point -> m Point
matrixTransformPoint Matrix
m Point
p = IO Point -> m Point
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Point
p' <- Point -> IO (Ptr Point)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point
p
Ptr Point
res <- Int -> IO (Ptr Point)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
8 :: IO (Ptr Graphene.Point.Point)
Ptr Matrix -> Ptr Point -> Ptr Point -> IO ()
graphene_matrix_transform_point Ptr Matrix
m' Ptr Point
p' Ptr Point
res
Point
res' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Point -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point
p
Point -> IO Point
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformPointMethodInfo
instance (signature ~ (Graphene.Point.Point -> m (Graphene.Point.Point)), MonadIO m) => O.OverloadedMethod MatrixTransformPointMethodInfo Matrix signature where
overloadedMethod = matrixTransformPoint
instance O.OverloadedMethodInfo MatrixTransformPointMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformPoint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformPoint"
})
#endif
foreign import ccall "graphene_matrix_transform_point3d" graphene_matrix_transform_point3d ::
Ptr Matrix ->
Ptr Graphene.Point3D.Point3D ->
Ptr Graphene.Point3D.Point3D ->
IO ()
matrixTransformPoint3d ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Point3D.Point3D
-> m (Graphene.Point3D.Point3D)
matrixTransformPoint3d :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Point3D -> m Point3D
matrixTransformPoint3d Matrix
m Point3D
p = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
Ptr Point3D
res <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Graphene.Point3D.Point3D)
Ptr Matrix -> Ptr Point3D -> Ptr Point3D -> IO ()
graphene_matrix_transform_point3d Ptr Matrix
m' Ptr Point3D
p' Ptr Point3D
res
Point3D
res' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Graphene.Point3D.Point3D) Ptr Point3D
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformPoint3dMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m (Graphene.Point3D.Point3D)), MonadIO m) => O.OverloadedMethod MatrixTransformPoint3dMethodInfo Matrix signature where
overloadedMethod = matrixTransformPoint3d
instance O.OverloadedMethodInfo MatrixTransformPoint3dMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformPoint3d",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformPoint3d"
})
#endif
foreign import ccall "graphene_matrix_transform_ray" graphene_matrix_transform_ray ::
Ptr Matrix ->
Ptr Graphene.Ray.Ray ->
Ptr Graphene.Ray.Ray ->
IO ()
matrixTransformRay ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Ray.Ray
-> m (Graphene.Ray.Ray)
matrixTransformRay :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Ray -> m Ray
matrixTransformRay Matrix
m Ray
r = IO Ray -> m Ray
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Ray -> m Ray) -> IO Ray -> m Ray
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Ray
r' <- Ray -> IO (Ptr Ray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Ray
r
Ptr Ray
res <- Int -> IO (Ptr Ray)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Graphene.Ray.Ray)
Ptr Matrix -> Ptr Ray -> Ptr Ray -> IO ()
graphene_matrix_transform_ray Ptr Matrix
m' Ptr Ray
r' Ptr Ray
res
Ray
res' <- ((ManagedPtr Ray -> Ray) -> Ptr Ray -> IO Ray
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Ray -> Ray
Graphene.Ray.Ray) Ptr Ray
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Ray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Ray
r
Ray -> IO Ray
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ray
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformRayMethodInfo
instance (signature ~ (Graphene.Ray.Ray -> m (Graphene.Ray.Ray)), MonadIO m) => O.OverloadedMethod MatrixTransformRayMethodInfo Matrix signature where
overloadedMethod = matrixTransformRay
instance O.OverloadedMethodInfo MatrixTransformRayMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformRay",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformRay"
})
#endif
foreign import ccall "graphene_matrix_transform_rect" graphene_matrix_transform_rect ::
Ptr Matrix ->
Ptr Graphene.Rect.Rect ->
Ptr Graphene.Quad.Quad ->
IO ()
matrixTransformRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Rect.Rect
-> m (Graphene.Quad.Quad)
matrixTransformRect :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Rect -> m Quad
matrixTransformRect Matrix
m Rect
r = IO Quad -> m Quad
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Quad -> m Quad) -> IO Quad -> m Quad
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Quad
res <- Int -> IO (Ptr Quad)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Graphene.Quad.Quad)
Ptr Matrix -> Ptr Rect -> Ptr Quad -> IO ()
graphene_matrix_transform_rect Ptr Matrix
m' Ptr Rect
r' Ptr Quad
res
Quad
res' <- ((ManagedPtr Quad -> Quad) -> Ptr Quad -> IO Quad
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Quad -> Quad
Graphene.Quad.Quad) Ptr Quad
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Quad -> IO Quad
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Quad
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformRectMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> m (Graphene.Quad.Quad)), MonadIO m) => O.OverloadedMethod MatrixTransformRectMethodInfo Matrix signature where
overloadedMethod = matrixTransformRect
instance O.OverloadedMethodInfo MatrixTransformRectMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformRect",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformRect"
})
#endif
foreign import ccall "graphene_matrix_transform_sphere" graphene_matrix_transform_sphere ::
Ptr Matrix ->
Ptr Graphene.Sphere.Sphere ->
Ptr Graphene.Sphere.Sphere ->
IO ()
matrixTransformSphere ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Sphere.Sphere
-> m (Graphene.Sphere.Sphere)
matrixTransformSphere :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Sphere -> m Sphere
matrixTransformSphere Matrix
m Sphere
s = IO Sphere -> m Sphere
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sphere -> m Sphere) -> IO Sphere -> m Sphere
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
Ptr Sphere
res <- Int -> IO (Ptr Sphere)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
20 :: IO (Ptr Graphene.Sphere.Sphere)
Ptr Matrix -> Ptr Sphere -> Ptr Sphere -> IO ()
graphene_matrix_transform_sphere Ptr Matrix
m' Ptr Sphere
s' Ptr Sphere
res
Sphere
res' <- ((ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Sphere -> Sphere
Graphene.Sphere.Sphere) Ptr Sphere
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
Sphere -> IO Sphere
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Sphere
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformSphereMethodInfo
instance (signature ~ (Graphene.Sphere.Sphere -> m (Graphene.Sphere.Sphere)), MonadIO m) => O.OverloadedMethod MatrixTransformSphereMethodInfo Matrix signature where
overloadedMethod = matrixTransformSphere
instance O.OverloadedMethodInfo MatrixTransformSphereMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformSphere",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformSphere"
})
#endif
foreign import ccall "graphene_matrix_transform_vec3" graphene_matrix_transform_vec3 ::
Ptr Matrix ->
Ptr Graphene.Vec3.Vec3 ->
Ptr Graphene.Vec3.Vec3 ->
IO ()
matrixTransformVec3 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Vec3.Vec3
-> m (Graphene.Vec3.Vec3)
matrixTransformVec3 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Vec3 -> m Vec3
matrixTransformVec3 Matrix
m Vec3
v = IO Vec3 -> m Vec3
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec3 -> m Vec3) -> IO Vec3 -> m Vec3
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Vec3
v' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
v
Ptr Vec3
res <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
Ptr Matrix -> Ptr Vec3 -> Ptr Vec3 -> IO ()
graphene_matrix_transform_vec3 Ptr Matrix
m' Ptr Vec3
v' Ptr Vec3
res
Vec3
res' <- ((ManagedPtr Vec3 -> Vec3) -> Ptr Vec3 -> IO Vec3
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec3 -> Vec3
Graphene.Vec3.Vec3) Ptr Vec3
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
v
Vec3 -> IO Vec3
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Vec3
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformVec3MethodInfo
instance (signature ~ (Graphene.Vec3.Vec3 -> m (Graphene.Vec3.Vec3)), MonadIO m) => O.OverloadedMethod MatrixTransformVec3MethodInfo Matrix signature where
overloadedMethod = matrixTransformVec3
instance O.OverloadedMethodInfo MatrixTransformVec3MethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformVec3",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformVec3"
})
#endif
foreign import ccall "graphene_matrix_transform_vec4" graphene_matrix_transform_vec4 ::
Ptr Matrix ->
Ptr Graphene.Vec4.Vec4 ->
Ptr Graphene.Vec4.Vec4 ->
IO ()
matrixTransformVec4 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Vec4.Vec4
-> m (Graphene.Vec4.Vec4)
matrixTransformVec4 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Vec4 -> m Vec4
matrixTransformVec4 Matrix
m Vec4
v = IO Vec4 -> m Vec4
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec4.Vec4)
Ptr Matrix -> Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_matrix_transform_vec4 Ptr Matrix
m' Ptr Vec4
v' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Graphene.Vec4.Vec4) Ptr Vec4
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec4 -> IO Vec4
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransformVec4MethodInfo
instance (signature ~ (Graphene.Vec4.Vec4 -> m (Graphene.Vec4.Vec4)), MonadIO m) => O.OverloadedMethod MatrixTransformVec4MethodInfo Matrix signature where
overloadedMethod = matrixTransformVec4
instance O.OverloadedMethodInfo MatrixTransformVec4MethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTransformVec4",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTransformVec4"
})
#endif
foreign import ccall "graphene_matrix_translate" graphene_matrix_translate ::
Ptr Matrix ->
Ptr Graphene.Point3D.Point3D ->
IO ()
matrixTranslate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Point3D.Point3D
-> m ()
matrixTranslate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Point3D -> m ()
matrixTranslate Matrix
m Point3D
pos = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Point3D
pos' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
pos
Ptr Matrix -> Ptr Point3D -> IO ()
graphene_matrix_translate Ptr Matrix
m' Ptr Point3D
pos'
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
pos
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatrixTranslateMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m ()), MonadIO m) => O.OverloadedMethod MatrixTranslateMethodInfo Matrix signature where
overloadedMethod = matrixTranslate
instance O.OverloadedMethodInfo MatrixTranslateMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTranslate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTranslate"
})
#endif
foreign import ccall "graphene_matrix_transpose" graphene_matrix_transpose ::
Ptr Matrix ->
Ptr Matrix ->
IO ()
matrixTranspose ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> m (Matrix)
matrixTranspose :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> m Matrix
matrixTranspose Matrix
m = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Matrix
res <- Int -> IO (Ptr Matrix)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
64 :: IO (Ptr Matrix)
Ptr Matrix -> Ptr Matrix -> IO ()
graphene_matrix_transpose Ptr Matrix
m' Ptr Matrix
res
Matrix
res' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Matrix) Ptr Matrix
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
res'
#if defined(ENABLE_OVERLOADING)
data MatrixTransposeMethodInfo
instance (signature ~ (m (Matrix)), MonadIO m) => O.OverloadedMethod MatrixTransposeMethodInfo Matrix signature where
overloadedMethod = matrixTranspose
instance O.OverloadedMethodInfo MatrixTransposeMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixTranspose",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixTranspose"
})
#endif
foreign import ccall "graphene_matrix_unproject_point3d" graphene_matrix_unproject_point3d ::
Ptr Matrix ->
Ptr Matrix ->
Ptr Graphene.Point3D.Point3D ->
Ptr Graphene.Point3D.Point3D ->
IO ()
matrixUnprojectPoint3d ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Matrix
-> Graphene.Point3D.Point3D
-> m (Graphene.Point3D.Point3D)
matrixUnprojectPoint3d :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Matrix -> Point3D -> m Point3D
matrixUnprojectPoint3d Matrix
projection Matrix
modelview Point3D
point = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
projection' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
projection
Ptr Matrix
modelview' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
modelview
Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
Ptr Point3D
res <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Graphene.Point3D.Point3D)
Ptr Matrix -> Ptr Matrix -> Ptr Point3D -> Ptr Point3D -> IO ()
graphene_matrix_unproject_point3d Ptr Matrix
projection' Ptr Matrix
modelview' Ptr Point3D
point' Ptr Point3D
res
Point3D
res' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Graphene.Point3D.Point3D) Ptr Point3D
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
projection
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
modelview
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
res'
#if defined(ENABLE_OVERLOADING)
data MatrixUnprojectPoint3dMethodInfo
instance (signature ~ (Matrix -> Graphene.Point3D.Point3D -> m (Graphene.Point3D.Point3D)), MonadIO m) => O.OverloadedMethod MatrixUnprojectPoint3dMethodInfo Matrix signature where
overloadedMethod = matrixUnprojectPoint3d
instance O.OverloadedMethodInfo MatrixUnprojectPoint3dMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixUnprojectPoint3d",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixUnprojectPoint3d"
})
#endif
foreign import ccall "graphene_matrix_untransform_bounds" graphene_matrix_untransform_bounds ::
Ptr Matrix ->
Ptr Graphene.Rect.Rect ->
Ptr Graphene.Rect.Rect ->
Ptr Graphene.Rect.Rect ->
IO ()
matrixUntransformBounds ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Rect.Rect
-> Graphene.Rect.Rect
-> m (Graphene.Rect.Rect)
matrixUntransformBounds :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Rect -> Rect -> m Rect
matrixUntransformBounds Matrix
m Rect
r Rect
bounds = IO Rect -> m Rect
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
bounds' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
bounds
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Rect.Rect)
Ptr Matrix -> Ptr Rect -> Ptr Rect -> Ptr Rect -> IO ()
graphene_matrix_untransform_bounds Ptr Matrix
m' Ptr Rect
r' Ptr Rect
bounds' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Graphene.Rect.Rect) Ptr Rect
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
bounds
Rect -> IO Rect
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data MatrixUntransformBoundsMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> Graphene.Rect.Rect -> m (Graphene.Rect.Rect)), MonadIO m) => O.OverloadedMethod MatrixUntransformBoundsMethodInfo Matrix signature where
overloadedMethod = matrixUntransformBounds
instance O.OverloadedMethodInfo MatrixUntransformBoundsMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixUntransformBounds",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixUntransformBounds"
})
#endif
foreign import ccall "graphene_matrix_untransform_point" graphene_matrix_untransform_point ::
Ptr Matrix ->
Ptr Graphene.Point.Point ->
Ptr Graphene.Rect.Rect ->
Ptr Graphene.Point.Point ->
IO CInt
matrixUntransformPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
Matrix
-> Graphene.Point.Point
-> Graphene.Rect.Rect
-> m ((Bool, Graphene.Point.Point))
matrixUntransformPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Matrix -> Point -> Rect -> m (Bool, Point)
matrixUntransformPoint Matrix
m Point
p Rect
bounds = IO (Bool, Point) -> m (Bool, Point)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Point) -> m (Bool, Point))
-> IO (Bool, Point) -> m (Bool, Point)
forall a b. (a -> b) -> a -> b
$ do
Ptr Matrix
m' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
m
Ptr Point
p' <- Point -> IO (Ptr Point)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point
p
Ptr Rect
bounds' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
bounds
Ptr Point
res <- Int -> IO (Ptr Point)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
8 :: IO (Ptr Graphene.Point.Point)
CInt
result <- Ptr Matrix -> Ptr Point -> Ptr Rect -> Ptr Point -> IO CInt
graphene_matrix_untransform_point Ptr Matrix
m' Ptr Point
p' Ptr Rect
bounds' Ptr Point
res
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Point
res' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
res
Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
m
Point -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point
p
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
bounds
(Bool, Point) -> IO (Bool, Point)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Point
res')
#if defined(ENABLE_OVERLOADING)
data MatrixUntransformPointMethodInfo
instance (signature ~ (Graphene.Point.Point -> Graphene.Rect.Rect -> m ((Bool, Graphene.Point.Point))), MonadIO m) => O.OverloadedMethod MatrixUntransformPointMethodInfo Matrix signature where
overloadedMethod = matrixUntransformPoint
instance O.OverloadedMethodInfo MatrixUntransformPointMethodInfo Matrix where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Matrix.matrixUntransformPoint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Matrix.html#v:matrixUntransformPoint"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveMatrixMethod (t :: Symbol) (o :: *) :: * where
ResolveMatrixMethod "decompose" o = MatrixDecomposeMethodInfo
ResolveMatrixMethod "determinant" o = MatrixDeterminantMethodInfo
ResolveMatrixMethod "equal" o = MatrixEqualMethodInfo
ResolveMatrixMethod "equalFast" o = MatrixEqualFastMethodInfo
ResolveMatrixMethod "free" o = MatrixFreeMethodInfo
ResolveMatrixMethod "initFrom2d" o = MatrixInitFrom2dMethodInfo
ResolveMatrixMethod "initFromFloat" o = MatrixInitFromFloatMethodInfo
ResolveMatrixMethod "initFromMatrix" o = MatrixInitFromMatrixMethodInfo
ResolveMatrixMethod "initFromVec4" o = MatrixInitFromVec4MethodInfo
ResolveMatrixMethod "initFrustum" o = MatrixInitFrustumMethodInfo
ResolveMatrixMethod "initIdentity" o = MatrixInitIdentityMethodInfo
ResolveMatrixMethod "initLookAt" o = MatrixInitLookAtMethodInfo
ResolveMatrixMethod "initOrtho" o = MatrixInitOrthoMethodInfo
ResolveMatrixMethod "initPerspective" o = MatrixInitPerspectiveMethodInfo
ResolveMatrixMethod "initRotate" o = MatrixInitRotateMethodInfo
ResolveMatrixMethod "initScale" o = MatrixInitScaleMethodInfo
ResolveMatrixMethod "initSkew" o = MatrixInitSkewMethodInfo
ResolveMatrixMethod "initTranslate" o = MatrixInitTranslateMethodInfo
ResolveMatrixMethod "interpolate" o = MatrixInterpolateMethodInfo
ResolveMatrixMethod "inverse" o = MatrixInverseMethodInfo
ResolveMatrixMethod "is2d" o = MatrixIs2dMethodInfo
ResolveMatrixMethod "isBackfaceVisible" o = MatrixIsBackfaceVisibleMethodInfo
ResolveMatrixMethod "isIdentity" o = MatrixIsIdentityMethodInfo
ResolveMatrixMethod "isSingular" o = MatrixIsSingularMethodInfo
ResolveMatrixMethod "multiply" o = MatrixMultiplyMethodInfo
ResolveMatrixMethod "near" o = MatrixNearMethodInfo
ResolveMatrixMethod "normalize" o = MatrixNormalizeMethodInfo
ResolveMatrixMethod "perspective" o = MatrixPerspectiveMethodInfo
ResolveMatrixMethod "print" o = MatrixPrintMethodInfo
ResolveMatrixMethod "projectPoint" o = MatrixProjectPointMethodInfo
ResolveMatrixMethod "projectRect" o = MatrixProjectRectMethodInfo
ResolveMatrixMethod "projectRectBounds" o = MatrixProjectRectBoundsMethodInfo
ResolveMatrixMethod "rotate" o = MatrixRotateMethodInfo
ResolveMatrixMethod "rotateEuler" o = MatrixRotateEulerMethodInfo
ResolveMatrixMethod "rotateQuaternion" o = MatrixRotateQuaternionMethodInfo
ResolveMatrixMethod "rotateX" o = MatrixRotateXMethodInfo
ResolveMatrixMethod "rotateY" o = MatrixRotateYMethodInfo
ResolveMatrixMethod "rotateZ" o = MatrixRotateZMethodInfo
ResolveMatrixMethod "scale" o = MatrixScaleMethodInfo
ResolveMatrixMethod "skewXy" o = MatrixSkewXyMethodInfo
ResolveMatrixMethod "skewXz" o = MatrixSkewXzMethodInfo
ResolveMatrixMethod "skewYz" o = MatrixSkewYzMethodInfo
ResolveMatrixMethod "to2d" o = MatrixTo2dMethodInfo
ResolveMatrixMethod "transformBounds" o = MatrixTransformBoundsMethodInfo
ResolveMatrixMethod "transformBox" o = MatrixTransformBoxMethodInfo
ResolveMatrixMethod "transformPoint" o = MatrixTransformPointMethodInfo
ResolveMatrixMethod "transformPoint3d" o = MatrixTransformPoint3dMethodInfo
ResolveMatrixMethod "transformRay" o = MatrixTransformRayMethodInfo
ResolveMatrixMethod "transformRect" o = MatrixTransformRectMethodInfo
ResolveMatrixMethod "transformSphere" o = MatrixTransformSphereMethodInfo
ResolveMatrixMethod "transformVec3" o = MatrixTransformVec3MethodInfo
ResolveMatrixMethod "transformVec4" o = MatrixTransformVec4MethodInfo
ResolveMatrixMethod "translate" o = MatrixTranslateMethodInfo
ResolveMatrixMethod "transpose" o = MatrixTransposeMethodInfo
ResolveMatrixMethod "unprojectPoint3d" o = MatrixUnprojectPoint3dMethodInfo
ResolveMatrixMethod "untransformBounds" o = MatrixUntransformBoundsMethodInfo
ResolveMatrixMethod "untransformPoint" o = MatrixUntransformPointMethodInfo
ResolveMatrixMethod "getRow" o = MatrixGetRowMethodInfo
ResolveMatrixMethod "getValue" o = MatrixGetValueMethodInfo
ResolveMatrixMethod "getXScale" o = MatrixGetXScaleMethodInfo
ResolveMatrixMethod "getXTranslation" o = MatrixGetXTranslationMethodInfo
ResolveMatrixMethod "getYScale" o = MatrixGetYScaleMethodInfo
ResolveMatrixMethod "getYTranslation" o = MatrixGetYTranslationMethodInfo
ResolveMatrixMethod "getZScale" o = MatrixGetZScaleMethodInfo
ResolveMatrixMethod "getZTranslation" o = MatrixGetZTranslationMethodInfo
ResolveMatrixMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMatrixMethod t Matrix, O.OverloadedMethod info Matrix p) => OL.IsLabel t (Matrix -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveMatrixMethod t Matrix, O.OverloadedMethod info Matrix p, R.HasField t Matrix p) => R.HasField t Matrix p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveMatrixMethod t Matrix, O.OverloadedMethodInfo info Matrix) => OL.IsLabel t (O.MethodProxy info Matrix) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif