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

Extra buffer metadata describing an image region of interest
-}

module GI.GstVideo.Structs.VideoRegionOfInterestMeta
    ( 

-- * Exported types
    VideoRegionOfInterestMeta(..)           ,
    newZeroVideoRegionOfInterestMeta        ,
    noVideoRegionOfInterestMeta             ,


 -- * Methods
-- ** getInfo #method:getInfo#
    videoRegionOfInterestMetaGetInfo        ,




 -- * Properties
-- ** h #attr:h#
    getVideoRegionOfInterestMetaH           ,
    setVideoRegionOfInterestMetaH           ,
    videoRegionOfInterestMeta_h             ,


-- ** id #attr:id#
    getVideoRegionOfInterestMetaId          ,
    setVideoRegionOfInterestMetaId          ,
    videoRegionOfInterestMeta_id            ,


-- ** meta #attr:meta#
    getVideoRegionOfInterestMetaMeta        ,
    videoRegionOfInterestMeta_meta          ,


-- ** parentId #attr:parentId#
    getVideoRegionOfInterestMetaParentId    ,
    setVideoRegionOfInterestMetaParentId    ,
    videoRegionOfInterestMeta_parentId      ,


-- ** roiType #attr:roiType#
    getVideoRegionOfInterestMetaRoiType     ,
    setVideoRegionOfInterestMetaRoiType     ,
    videoRegionOfInterestMeta_roiType       ,


-- ** w #attr:w#
    getVideoRegionOfInterestMetaW           ,
    setVideoRegionOfInterestMetaW           ,
    videoRegionOfInterestMeta_w             ,


-- ** x #attr:x#
    getVideoRegionOfInterestMetaX           ,
    setVideoRegionOfInterestMetaX           ,
    videoRegionOfInterestMeta_x             ,


-- ** y #attr:y#
    getVideoRegionOfInterestMetaY           ,
    setVideoRegionOfInterestMetaY           ,
    videoRegionOfInterestMeta_y             ,




    ) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.Gst.Structs.Meta as Gst.Meta
import qualified GI.Gst.Structs.MetaInfo as Gst.MetaInfo

newtype VideoRegionOfInterestMeta = VideoRegionOfInterestMeta (ManagedPtr VideoRegionOfInterestMeta)
instance WrappedPtr VideoRegionOfInterestMeta where
    wrappedPtrCalloc = callocBytes 48
    wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 48 >=> wrapPtr VideoRegionOfInterestMeta)
    wrappedPtrFree = Just ptr_to_g_free

-- | Construct a `VideoRegionOfInterestMeta` struct initialized to zero.
newZeroVideoRegionOfInterestMeta :: MonadIO m => m VideoRegionOfInterestMeta
newZeroVideoRegionOfInterestMeta = liftIO $ wrappedPtrCalloc >>= wrapPtr VideoRegionOfInterestMeta

instance tag ~ 'AttrSet => Constructible VideoRegionOfInterestMeta tag where
    new _ attrs = do
        o <- newZeroVideoRegionOfInterestMeta
        GI.Attributes.set o attrs
        return o


noVideoRegionOfInterestMeta :: Maybe VideoRegionOfInterestMeta
noVideoRegionOfInterestMeta = Nothing

getVideoRegionOfInterestMetaMeta :: MonadIO m => VideoRegionOfInterestMeta -> m Gst.Meta.Meta
getVideoRegionOfInterestMetaMeta s = liftIO $ withManagedPtr s $ \ptr -> do
    let val = ptr `plusPtr` 0 :: (Ptr Gst.Meta.Meta)
    val' <- (newPtr Gst.Meta.Meta) val
    return val'

data VideoRegionOfInterestMetaMetaFieldInfo
instance AttrInfo VideoRegionOfInterestMetaMetaFieldInfo where
    type AttrAllowedOps VideoRegionOfInterestMetaMetaFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint VideoRegionOfInterestMetaMetaFieldInfo = (~) (Ptr Gst.Meta.Meta)
    type AttrBaseTypeConstraint VideoRegionOfInterestMetaMetaFieldInfo = (~) VideoRegionOfInterestMeta
    type AttrGetType VideoRegionOfInterestMetaMetaFieldInfo = Gst.Meta.Meta
    type AttrLabel VideoRegionOfInterestMetaMetaFieldInfo = "meta"
    type AttrOrigin VideoRegionOfInterestMetaMetaFieldInfo = VideoRegionOfInterestMeta
    attrGet _ = getVideoRegionOfInterestMetaMeta
    attrSet _ = undefined
    attrConstruct = undefined
    attrClear _ = undefined

videoRegionOfInterestMeta_meta :: AttrLabelProxy "meta"
videoRegionOfInterestMeta_meta = AttrLabelProxy


getVideoRegionOfInterestMetaRoiType :: MonadIO m => VideoRegionOfInterestMeta -> m Word32
getVideoRegionOfInterestMetaRoiType s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO Word32
    return val

setVideoRegionOfInterestMetaRoiType :: MonadIO m => VideoRegionOfInterestMeta -> Word32 -> m ()
setVideoRegionOfInterestMetaRoiType s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (val :: Word32)

data VideoRegionOfInterestMetaRoiTypeFieldInfo
instance AttrInfo VideoRegionOfInterestMetaRoiTypeFieldInfo where
    type AttrAllowedOps VideoRegionOfInterestMetaRoiTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoRegionOfInterestMetaRoiTypeFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoRegionOfInterestMetaRoiTypeFieldInfo = (~) VideoRegionOfInterestMeta
    type AttrGetType VideoRegionOfInterestMetaRoiTypeFieldInfo = Word32
    type AttrLabel VideoRegionOfInterestMetaRoiTypeFieldInfo = "roi_type"
    type AttrOrigin VideoRegionOfInterestMetaRoiTypeFieldInfo = VideoRegionOfInterestMeta
    attrGet _ = getVideoRegionOfInterestMetaRoiType
    attrSet _ = setVideoRegionOfInterestMetaRoiType
    attrConstruct = undefined
    attrClear _ = undefined

videoRegionOfInterestMeta_roiType :: AttrLabelProxy "roiType"
videoRegionOfInterestMeta_roiType = AttrLabelProxy


getVideoRegionOfInterestMetaId :: MonadIO m => VideoRegionOfInterestMeta -> m Int32
getVideoRegionOfInterestMetaId s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 20) :: IO Int32
    return val

setVideoRegionOfInterestMetaId :: MonadIO m => VideoRegionOfInterestMeta -> Int32 -> m ()
setVideoRegionOfInterestMetaId s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 20) (val :: Int32)

data VideoRegionOfInterestMetaIdFieldInfo
instance AttrInfo VideoRegionOfInterestMetaIdFieldInfo where
    type AttrAllowedOps VideoRegionOfInterestMetaIdFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoRegionOfInterestMetaIdFieldInfo = (~) Int32
    type AttrBaseTypeConstraint VideoRegionOfInterestMetaIdFieldInfo = (~) VideoRegionOfInterestMeta
    type AttrGetType VideoRegionOfInterestMetaIdFieldInfo = Int32
    type AttrLabel VideoRegionOfInterestMetaIdFieldInfo = "id"
    type AttrOrigin VideoRegionOfInterestMetaIdFieldInfo = VideoRegionOfInterestMeta
    attrGet _ = getVideoRegionOfInterestMetaId
    attrSet _ = setVideoRegionOfInterestMetaId
    attrConstruct = undefined
    attrClear _ = undefined

videoRegionOfInterestMeta_id :: AttrLabelProxy "id"
videoRegionOfInterestMeta_id = AttrLabelProxy


getVideoRegionOfInterestMetaParentId :: MonadIO m => VideoRegionOfInterestMeta -> m Int32
getVideoRegionOfInterestMetaParentId s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO Int32
    return val

setVideoRegionOfInterestMetaParentId :: MonadIO m => VideoRegionOfInterestMeta -> Int32 -> m ()
setVideoRegionOfInterestMetaParentId s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (val :: Int32)

data VideoRegionOfInterestMetaParentIdFieldInfo
instance AttrInfo VideoRegionOfInterestMetaParentIdFieldInfo where
    type AttrAllowedOps VideoRegionOfInterestMetaParentIdFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoRegionOfInterestMetaParentIdFieldInfo = (~) Int32
    type AttrBaseTypeConstraint VideoRegionOfInterestMetaParentIdFieldInfo = (~) VideoRegionOfInterestMeta
    type AttrGetType VideoRegionOfInterestMetaParentIdFieldInfo = Int32
    type AttrLabel VideoRegionOfInterestMetaParentIdFieldInfo = "parent_id"
    type AttrOrigin VideoRegionOfInterestMetaParentIdFieldInfo = VideoRegionOfInterestMeta
    attrGet _ = getVideoRegionOfInterestMetaParentId
    attrSet _ = setVideoRegionOfInterestMetaParentId
    attrConstruct = undefined
    attrClear _ = undefined

videoRegionOfInterestMeta_parentId :: AttrLabelProxy "parentId"
videoRegionOfInterestMeta_parentId = AttrLabelProxy


getVideoRegionOfInterestMetaX :: MonadIO m => VideoRegionOfInterestMeta -> m Word32
getVideoRegionOfInterestMetaX s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 28) :: IO Word32
    return val

setVideoRegionOfInterestMetaX :: MonadIO m => VideoRegionOfInterestMeta -> Word32 -> m ()
setVideoRegionOfInterestMetaX s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 28) (val :: Word32)

data VideoRegionOfInterestMetaXFieldInfo
instance AttrInfo VideoRegionOfInterestMetaXFieldInfo where
    type AttrAllowedOps VideoRegionOfInterestMetaXFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoRegionOfInterestMetaXFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoRegionOfInterestMetaXFieldInfo = (~) VideoRegionOfInterestMeta
    type AttrGetType VideoRegionOfInterestMetaXFieldInfo = Word32
    type AttrLabel VideoRegionOfInterestMetaXFieldInfo = "x"
    type AttrOrigin VideoRegionOfInterestMetaXFieldInfo = VideoRegionOfInterestMeta
    attrGet _ = getVideoRegionOfInterestMetaX
    attrSet _ = setVideoRegionOfInterestMetaX
    attrConstruct = undefined
    attrClear _ = undefined

videoRegionOfInterestMeta_x :: AttrLabelProxy "x"
videoRegionOfInterestMeta_x = AttrLabelProxy


getVideoRegionOfInterestMetaY :: MonadIO m => VideoRegionOfInterestMeta -> m Word32
getVideoRegionOfInterestMetaY s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 32) :: IO Word32
    return val

setVideoRegionOfInterestMetaY :: MonadIO m => VideoRegionOfInterestMeta -> Word32 -> m ()
setVideoRegionOfInterestMetaY s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 32) (val :: Word32)

data VideoRegionOfInterestMetaYFieldInfo
instance AttrInfo VideoRegionOfInterestMetaYFieldInfo where
    type AttrAllowedOps VideoRegionOfInterestMetaYFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoRegionOfInterestMetaYFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoRegionOfInterestMetaYFieldInfo = (~) VideoRegionOfInterestMeta
    type AttrGetType VideoRegionOfInterestMetaYFieldInfo = Word32
    type AttrLabel VideoRegionOfInterestMetaYFieldInfo = "y"
    type AttrOrigin VideoRegionOfInterestMetaYFieldInfo = VideoRegionOfInterestMeta
    attrGet _ = getVideoRegionOfInterestMetaY
    attrSet _ = setVideoRegionOfInterestMetaY
    attrConstruct = undefined
    attrClear _ = undefined

videoRegionOfInterestMeta_y :: AttrLabelProxy "y"
videoRegionOfInterestMeta_y = AttrLabelProxy


getVideoRegionOfInterestMetaW :: MonadIO m => VideoRegionOfInterestMeta -> m Word32
getVideoRegionOfInterestMetaW s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 36) :: IO Word32
    return val

setVideoRegionOfInterestMetaW :: MonadIO m => VideoRegionOfInterestMeta -> Word32 -> m ()
setVideoRegionOfInterestMetaW s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 36) (val :: Word32)

data VideoRegionOfInterestMetaWFieldInfo
instance AttrInfo VideoRegionOfInterestMetaWFieldInfo where
    type AttrAllowedOps VideoRegionOfInterestMetaWFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoRegionOfInterestMetaWFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoRegionOfInterestMetaWFieldInfo = (~) VideoRegionOfInterestMeta
    type AttrGetType VideoRegionOfInterestMetaWFieldInfo = Word32
    type AttrLabel VideoRegionOfInterestMetaWFieldInfo = "w"
    type AttrOrigin VideoRegionOfInterestMetaWFieldInfo = VideoRegionOfInterestMeta
    attrGet _ = getVideoRegionOfInterestMetaW
    attrSet _ = setVideoRegionOfInterestMetaW
    attrConstruct = undefined
    attrClear _ = undefined

videoRegionOfInterestMeta_w :: AttrLabelProxy "w"
videoRegionOfInterestMeta_w = AttrLabelProxy


getVideoRegionOfInterestMetaH :: MonadIO m => VideoRegionOfInterestMeta -> m Word32
getVideoRegionOfInterestMetaH s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 40) :: IO Word32
    return val

setVideoRegionOfInterestMetaH :: MonadIO m => VideoRegionOfInterestMeta -> Word32 -> m ()
setVideoRegionOfInterestMetaH s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 40) (val :: Word32)

data VideoRegionOfInterestMetaHFieldInfo
instance AttrInfo VideoRegionOfInterestMetaHFieldInfo where
    type AttrAllowedOps VideoRegionOfInterestMetaHFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoRegionOfInterestMetaHFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoRegionOfInterestMetaHFieldInfo = (~) VideoRegionOfInterestMeta
    type AttrGetType VideoRegionOfInterestMetaHFieldInfo = Word32
    type AttrLabel VideoRegionOfInterestMetaHFieldInfo = "h"
    type AttrOrigin VideoRegionOfInterestMetaHFieldInfo = VideoRegionOfInterestMeta
    attrGet _ = getVideoRegionOfInterestMetaH
    attrSet _ = setVideoRegionOfInterestMetaH
    attrConstruct = undefined
    attrClear _ = undefined

videoRegionOfInterestMeta_h :: AttrLabelProxy "h"
videoRegionOfInterestMeta_h = AttrLabelProxy



instance O.HasAttributeList VideoRegionOfInterestMeta
type instance O.AttributeList VideoRegionOfInterestMeta = VideoRegionOfInterestMetaAttributeList
type VideoRegionOfInterestMetaAttributeList = ('[ '("meta", VideoRegionOfInterestMetaMetaFieldInfo), '("roiType", VideoRegionOfInterestMetaRoiTypeFieldInfo), '("id", VideoRegionOfInterestMetaIdFieldInfo), '("parentId", VideoRegionOfInterestMetaParentIdFieldInfo), '("x", VideoRegionOfInterestMetaXFieldInfo), '("y", VideoRegionOfInterestMetaYFieldInfo), '("w", VideoRegionOfInterestMetaWFieldInfo), '("h", VideoRegionOfInterestMetaHFieldInfo)] :: [(Symbol, *)])

-- method VideoRegionOfInterestMeta::get_info
-- method type : MemberFunction
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "MetaInfo"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_region_of_interest_meta_get_info" gst_video_region_of_interest_meta_get_info :: 
    IO (Ptr Gst.MetaInfo.MetaInfo)

{- |
/No description available in the introspection data./
-}
videoRegionOfInterestMetaGetInfo ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Gst.MetaInfo.MetaInfo
videoRegionOfInterestMetaGetInfo  = liftIO $ do
    result <- gst_video_region_of_interest_meta_get_info
    checkUnexpectedReturnNULL "videoRegionOfInterestMetaGetInfo" result
    result' <- (newPtr Gst.MetaInfo.MetaInfo) result
    return result'

type family ResolveVideoRegionOfInterestMetaMethod (t :: Symbol) (o :: *) :: * where
    ResolveVideoRegionOfInterestMetaMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveVideoRegionOfInterestMetaMethod t VideoRegionOfInterestMeta, O.MethodInfo info VideoRegionOfInterestMeta p) => O.IsLabelProxy t (VideoRegionOfInterestMeta -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

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