packages feed

gi-gstvideo-0.1.6.13: GI/GstVideo/Structs/VideoColorPrimariesInfo.hs


{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

Structure describing the chromaticity coordinates of an RGB system. These
values can be used to construct a matrix to transform RGB to and from the
XYZ colorspace.
-}

module GI.GstVideo.Structs.VideoColorPrimariesInfo
    ( 

-- * Exported types
    VideoColorPrimariesInfo(..)             ,
    newZeroVideoColorPrimariesInfo          ,
    noVideoColorPrimariesInfo               ,


 -- * Properties
-- ** Bx
    videoColorPrimariesInfoReadBx           ,


-- ** By
    videoColorPrimariesInfoReadBy           ,


-- ** Gx
    videoColorPrimariesInfoReadGx           ,


-- ** Gy
    videoColorPrimariesInfoReadGy           ,


-- ** Primaries
    videoColorPrimariesInfoReadPrimaries    ,


-- ** Rx
    videoColorPrimariesInfoReadRx           ,


-- ** Ry
    videoColorPrimariesInfoReadRy           ,


-- ** Wx
    videoColorPrimariesInfoReadWx           ,


-- ** Wy
    videoColorPrimariesInfoReadWy           ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.GstVideo.Types
import GI.GstVideo.Callbacks

newtype VideoColorPrimariesInfo = VideoColorPrimariesInfo (ForeignPtr VideoColorPrimariesInfo)
-- | Construct a `VideoColorPrimariesInfo` struct initialized to zero.
newZeroVideoColorPrimariesInfo :: MonadIO m => m VideoColorPrimariesInfo
newZeroVideoColorPrimariesInfo = liftIO $ callocBytes 72 >>= wrapPtr VideoColorPrimariesInfo

noVideoColorPrimariesInfo :: Maybe VideoColorPrimariesInfo
noVideoColorPrimariesInfo = Nothing

videoColorPrimariesInfoReadPrimaries :: VideoColorPrimariesInfo -> IO VideoColorPrimaries
videoColorPrimariesInfoReadPrimaries s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO CUInt
    let val' = (toEnum . fromIntegral) val
    return val'

videoColorPrimariesInfoReadWx :: VideoColorPrimariesInfo -> IO Double
videoColorPrimariesInfoReadWx s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO CDouble
    let val' = realToFrac val
    return val'

videoColorPrimariesInfoReadWy :: VideoColorPrimariesInfo -> IO Double
videoColorPrimariesInfoReadWy s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO CDouble
    let val' = realToFrac val
    return val'

videoColorPrimariesInfoReadRx :: VideoColorPrimariesInfo -> IO Double
videoColorPrimariesInfoReadRx s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO CDouble
    let val' = realToFrac val
    return val'

videoColorPrimariesInfoReadRy :: VideoColorPrimariesInfo -> IO Double
videoColorPrimariesInfoReadRy s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 32) :: IO CDouble
    let val' = realToFrac val
    return val'

videoColorPrimariesInfoReadGx :: VideoColorPrimariesInfo -> IO Double
videoColorPrimariesInfoReadGx s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 40) :: IO CDouble
    let val' = realToFrac val
    return val'

videoColorPrimariesInfoReadGy :: VideoColorPrimariesInfo -> IO Double
videoColorPrimariesInfoReadGy s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 48) :: IO CDouble
    let val' = realToFrac val
    return val'

videoColorPrimariesInfoReadBx :: VideoColorPrimariesInfo -> IO Double
videoColorPrimariesInfoReadBx s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 56) :: IO CDouble
    let val' = realToFrac val
    return val'

videoColorPrimariesInfoReadBy :: VideoColorPrimariesInfo -> IO Double
videoColorPrimariesInfoReadBy s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 64) :: IO CDouble
    let val' = realToFrac val
    return val'

type family ResolveVideoColorPrimariesInfoMethod (t :: Symbol) (o :: *) :: * where
    ResolveVideoColorPrimariesInfoMethod l o = MethodResolutionFailed l o

instance (info ~ ResolveVideoColorPrimariesInfoMethod t VideoColorPrimariesInfo, MethodInfo info VideoColorPrimariesInfo p) => IsLabelProxy t (VideoColorPrimariesInfo -> p) where
    fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveVideoColorPrimariesInfoMethod t VideoColorPrimariesInfo, MethodInfo info VideoColorPrimariesInfo p) => IsLabel t (VideoColorPrimariesInfo -> p) where
    fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info)
#endif