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

An opaque video overlay rectangle object. A rectangle contains a single
overlay rectangle which can be added to a composition.
-}

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.GstVideo.Structs.VideoOverlayRectangle
    (

-- * Exported types
    VideoOverlayRectangle(..)               ,
    noVideoOverlayRectangle                 ,


 -- * Methods
-- ** copy #method:copy#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleCopyMethodInfo     ,
#endif
    videoOverlayRectangleCopy               ,


-- ** getFlags #method:getFlags#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetFlagsMethodInfo ,
#endif
    videoOverlayRectangleGetFlags           ,


-- ** getGlobalAlpha #method:getGlobalAlpha#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetGlobalAlphaMethodInfo,
#endif
    videoOverlayRectangleGetGlobalAlpha     ,


-- ** getPixelsArgb #method:getPixelsArgb#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetPixelsArgbMethodInfo,
#endif
    videoOverlayRectangleGetPixelsArgb      ,


-- ** getPixelsAyuv #method:getPixelsAyuv#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetPixelsAyuvMethodInfo,
#endif
    videoOverlayRectangleGetPixelsAyuv      ,


-- ** getPixelsRaw #method:getPixelsRaw#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetPixelsRawMethodInfo,
#endif
    videoOverlayRectangleGetPixelsRaw       ,


-- ** getPixelsUnscaledArgb #method:getPixelsUnscaledArgb#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetPixelsUnscaledArgbMethodInfo,
#endif
    videoOverlayRectangleGetPixelsUnscaledArgb,


-- ** getPixelsUnscaledAyuv #method:getPixelsUnscaledAyuv#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetPixelsUnscaledAyuvMethodInfo,
#endif
    videoOverlayRectangleGetPixelsUnscaledAyuv,


-- ** getPixelsUnscaledRaw #method:getPixelsUnscaledRaw#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetPixelsUnscaledRawMethodInfo,
#endif
    videoOverlayRectangleGetPixelsUnscaledRaw,


-- ** getRenderRectangle #method:getRenderRectangle#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetRenderRectangleMethodInfo,
#endif
    videoOverlayRectangleGetRenderRectangle ,


-- ** getSeqnum #method:getSeqnum#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleGetSeqnumMethodInfo,
#endif
    videoOverlayRectangleGetSeqnum          ,


-- ** newRaw #method:newRaw#

    videoOverlayRectangleNewRaw             ,


-- ** setGlobalAlpha #method:setGlobalAlpha#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleSetGlobalAlphaMethodInfo,
#endif
    videoOverlayRectangleSetGlobalAlpha     ,


-- ** setRenderRectangle #method:setRenderRectangle#

#if ENABLE_OVERLOADING
    VideoOverlayRectangleSetRenderRectangleMethodInfo,
#endif
    videoOverlayRectangleSetRenderRectangle ,




    ) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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.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 GI.Gst.Structs.Buffer as Gst.Buffer
import {-# SOURCE #-} qualified GI.GstVideo.Flags as GstVideo.Flags

-- | Memory-managed wrapper type.
newtype VideoOverlayRectangle = VideoOverlayRectangle (ManagedPtr VideoOverlayRectangle)
foreign import ccall "gst_video_overlay_rectangle_get_type" c_gst_video_overlay_rectangle_get_type ::
    IO GType

instance BoxedObject VideoOverlayRectangle where
    boxedType _ = c_gst_video_overlay_rectangle_get_type

-- | A convenience alias for `Nothing` :: `Maybe` `VideoOverlayRectangle`.
noVideoOverlayRectangle :: Maybe VideoOverlayRectangle
noVideoOverlayRectangle = Nothing


#if ENABLE_OVERLOADING
instance O.HasAttributeList VideoOverlayRectangle
type instance O.AttributeList VideoOverlayRectangle = VideoOverlayRectangleAttributeList
type VideoOverlayRectangleAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method VideoOverlayRectangle::new_raw
-- method type : Constructor
-- Args : [Arg {argCName = "pixels", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer pointing to the pixel memory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the X co-ordinate on the video where the top-left corner of this\n    overlay rectangle should be rendered to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_y", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the Y co-ordinate on the video where the top-left corner of this\n    overlay rectangle should be rendered to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_width", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the render width of this rectangle on the video", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_height", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the render height of this rectangle on the video", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_new_raw" gst_video_overlay_rectangle_new_raw ::
    Ptr Gst.Buffer.Buffer ->                -- pixels : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Int32 ->                                -- render_x : TBasicType TInt
    Int32 ->                                -- render_y : TBasicType TInt
    Word32 ->                               -- render_width : TBasicType TUInt
    Word32 ->                               -- render_height : TBasicType TUInt
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"})
    IO (Ptr VideoOverlayRectangle)

{- |
Creates a new video overlay rectangle with ARGB or AYUV pixel data.
The layout in case of ARGB of the components in memory is B-G-R-A
on little-endian platforms
(corresponding to @/GST_VIDEO_FORMAT_BGRA/@) and A-R-G-B on big-endian
platforms (corresponding to @/GST_VIDEO_FORMAT_ARGB/@). In other words,
pixels are treated as 32-bit words and the lowest 8 bits then contain
the blue component value and the highest 8 bits contain the alpha
component value. Unless specified in the flags, the RGB values are
non-premultiplied. This is the format that is used by most hardware,
and also many rendering libraries such as Cairo, for example.
The pixel data buffer must have 'GI.GstVideo.Structs.VideoMeta.VideoMeta' set.
-}
videoOverlayRectangleNewRaw ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@pixels@/: a 'GI.Gst.Structs.Buffer.Buffer' pointing to the pixel memory -}
    -> Int32
    {- ^ /@renderX@/: the X co-ordinate on the video where the top-left corner of this
    overlay rectangle should be rendered to -}
    -> Int32
    {- ^ /@renderY@/: the Y co-ordinate on the video where the top-left corner of this
    overlay rectangle should be rendered to -}
    -> Word32
    {- ^ /@renderWidth@/: the render width of this rectangle on the video -}
    -> Word32
    {- ^ /@renderHeight@/: the render height of this rectangle on the video -}
    -> [GstVideo.Flags.VideoOverlayFormatFlags]
    {- ^ /@flags@/: flags -}
    -> m VideoOverlayRectangle
    {- ^ __Returns:__ a new 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle'. Unref with
    @/gst_video_overlay_rectangle_unref()/@ when no longer needed. -}
videoOverlayRectangleNewRaw pixels renderX renderY renderWidth renderHeight flags = liftIO $ do
    pixels' <- unsafeManagedPtrGetPtr pixels
    let flags' = gflagsToWord flags
    result <- gst_video_overlay_rectangle_new_raw pixels' renderX renderY renderWidth renderHeight flags'
    checkUnexpectedReturnNULL "videoOverlayRectangleNewRaw" result
    result' <- (wrapBoxed VideoOverlayRectangle) result
    touchManagedPtr pixels
    return result'

#if ENABLE_OVERLOADING
#endif

-- method VideoOverlayRectangle::copy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle to copy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_copy" gst_video_overlay_rectangle_copy ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    IO (Ptr VideoOverlayRectangle)

{- |
Makes a copy of /@rectangle@/, so that it is possible to modify it
(e.g. to change the render co-ordinates or render dimension). The
actual overlay pixel data buffers contained in the rectangle are not
copied.
-}
videoOverlayRectangleCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' to copy -}
    -> m VideoOverlayRectangle
    {- ^ __Returns:__ a new 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' equivalent
    to /@rectangle@/. -}
videoOverlayRectangleCopy rectangle = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    result <- gst_video_overlay_rectangle_copy rectangle'
    checkUnexpectedReturnNULL "videoOverlayRectangleCopy" result
    result' <- (wrapBoxed VideoOverlayRectangle) result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleCopyMethodInfo
instance (signature ~ (m VideoOverlayRectangle), MonadIO m) => O.MethodInfo VideoOverlayRectangleCopyMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleCopy

#endif

-- method VideoOverlayRectangle::get_flags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_flags" gst_video_overlay_rectangle_get_flags ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    IO CUInt

{- |
Retrieves the flags associated with a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle'.
This is useful if the caller can handle both premultiplied alpha and
non premultiplied alpha, for example. By knowing whether the rectangle
uses premultiplied or not, it can request the pixel data in the format
it is stored in, to avoid unnecessary conversion.
-}
videoOverlayRectangleGetFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> m [GstVideo.Flags.VideoOverlayFormatFlags]
    {- ^ __Returns:__ the 'GI.GstVideo.Flags.VideoOverlayFormatFlags' associated with the rectangle. -}
videoOverlayRectangleGetFlags rectangle = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    result <- gst_video_overlay_rectangle_get_flags rectangle'
    let result' = wordToGFlags result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetFlagsMethodInfo
instance (signature ~ (m [GstVideo.Flags.VideoOverlayFormatFlags]), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetFlagsMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetFlags

#endif

-- method VideoOverlayRectangle::get_global_alpha
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_global_alpha" gst_video_overlay_rectangle_get_global_alpha ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    IO CFloat

{- |
Retrieves the global-alpha value associated with a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle'.
-}
videoOverlayRectangleGetGlobalAlpha ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> m Float
    {- ^ __Returns:__ the global-alpha value associated with the rectangle. -}
videoOverlayRectangleGetGlobalAlpha rectangle = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    result <- gst_video_overlay_rectangle_get_global_alpha rectangle'
    let result' = realToFrac result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetGlobalAlphaMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetGlobalAlphaMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetGlobalAlpha

#endif

-- method VideoOverlayRectangle::get_pixels_argb
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags\n   If a global_alpha value != 1 is set for the rectangle, the caller\n   should set the #GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag\n   if he wants to apply global-alpha himself. If the flag is not set\n   global_alpha is applied internally before returning the pixel-data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_pixels_argb" gst_video_overlay_rectangle_get_pixels_argb ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"})
    IO (Ptr Gst.Buffer.Buffer)

{- |
/No description available in the introspection data./
-}
videoOverlayRectangleGetPixelsArgb ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> [GstVideo.Flags.VideoOverlayFormatFlags]
    {- ^ /@flags@/: flags
   If a global_alpha value != 1 is set for the rectangle, the caller
   should set the @/GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA/@ flag
   if he wants to apply global-alpha himself. If the flag is not set
   global_alpha is applied internally before returning the pixel-data. -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ a 'GI.Gst.Structs.Buffer.Buffer' holding the ARGB pixel data with
   width and height of the render dimensions as per
   'GI.GstVideo.Structs.VideoOverlayRectangle.videoOverlayRectangleGetRenderRectangle'. This function does
   not return a reference, the caller should obtain a reference of her own
   with @/gst_buffer_ref()/@ if needed. -}
videoOverlayRectangleGetPixelsArgb rectangle flags = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    let flags' = gflagsToWord flags
    result <- gst_video_overlay_rectangle_get_pixels_argb rectangle' flags'
    checkUnexpectedReturnNULL "videoOverlayRectangleGetPixelsArgb" result
    result' <- (newBoxed Gst.Buffer.Buffer) result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetPixelsArgbMethodInfo
instance (signature ~ ([GstVideo.Flags.VideoOverlayFormatFlags] -> m Gst.Buffer.Buffer), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetPixelsArgbMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetPixelsArgb

#endif

-- method VideoOverlayRectangle::get_pixels_ayuv
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags\n   If a global_alpha value != 1 is set for the rectangle, the caller\n   should set the #GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag\n   if he wants to apply global-alpha himself. If the flag is not set\n   global_alpha is applied internally before returning the pixel-data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_pixels_ayuv" gst_video_overlay_rectangle_get_pixels_ayuv ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"})
    IO (Ptr Gst.Buffer.Buffer)

{- |
/No description available in the introspection data./
-}
videoOverlayRectangleGetPixelsAyuv ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> [GstVideo.Flags.VideoOverlayFormatFlags]
    {- ^ /@flags@/: flags
   If a global_alpha value != 1 is set for the rectangle, the caller
   should set the @/GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA/@ flag
   if he wants to apply global-alpha himself. If the flag is not set
   global_alpha is applied internally before returning the pixel-data. -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ a 'GI.Gst.Structs.Buffer.Buffer' holding the AYUV pixel data with
   width and height of the render dimensions as per
   'GI.GstVideo.Structs.VideoOverlayRectangle.videoOverlayRectangleGetRenderRectangle'. This function does
   not return a reference, the caller should obtain a reference of her own
   with @/gst_buffer_ref()/@ if needed. -}
videoOverlayRectangleGetPixelsAyuv rectangle flags = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    let flags' = gflagsToWord flags
    result <- gst_video_overlay_rectangle_get_pixels_ayuv rectangle' flags'
    checkUnexpectedReturnNULL "videoOverlayRectangleGetPixelsAyuv" result
    result' <- (newBoxed Gst.Buffer.Buffer) result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetPixelsAyuvMethodInfo
instance (signature ~ ([GstVideo.Flags.VideoOverlayFormatFlags] -> m Gst.Buffer.Buffer), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetPixelsAyuvMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetPixelsAyuv

#endif

-- method VideoOverlayRectangle::get_pixels_raw
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags\n   If a global_alpha value != 1 is set for the rectangle, the caller\n   should set the #GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag\n   if he wants to apply global-alpha himself. If the flag is not set\n   global_alpha is applied internally before returning the pixel-data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_pixels_raw" gst_video_overlay_rectangle_get_pixels_raw ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"})
    IO (Ptr Gst.Buffer.Buffer)

{- |
/No description available in the introspection data./
-}
videoOverlayRectangleGetPixelsRaw ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> [GstVideo.Flags.VideoOverlayFormatFlags]
    {- ^ /@flags@/: flags
   If a global_alpha value != 1 is set for the rectangle, the caller
   should set the @/GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA/@ flag
   if he wants to apply global-alpha himself. If the flag is not set
   global_alpha is applied internally before returning the pixel-data. -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ a 'GI.Gst.Structs.Buffer.Buffer' holding the pixel data with
   format as originally provided and specified in video meta with
   width and height of the render dimensions as per
   'GI.GstVideo.Structs.VideoOverlayRectangle.videoOverlayRectangleGetRenderRectangle'. This function does
   not return a reference, the caller should obtain a reference of her own
   with @/gst_buffer_ref()/@ if needed. -}
videoOverlayRectangleGetPixelsRaw rectangle flags = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    let flags' = gflagsToWord flags
    result <- gst_video_overlay_rectangle_get_pixels_raw rectangle' flags'
    checkUnexpectedReturnNULL "videoOverlayRectangleGetPixelsRaw" result
    result' <- (newBoxed Gst.Buffer.Buffer) result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetPixelsRawMethodInfo
instance (signature ~ ([GstVideo.Flags.VideoOverlayFormatFlags] -> m Gst.Buffer.Buffer), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetPixelsRawMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetPixelsRaw

#endif

-- method VideoOverlayRectangle::get_pixels_unscaled_argb
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags.\n   If a global_alpha value != 1 is set for the rectangle, the caller\n   should set the #GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag\n   if he wants to apply global-alpha himself. If the flag is not set\n   global_alpha is applied internally before returning the pixel-data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_pixels_unscaled_argb" gst_video_overlay_rectangle_get_pixels_unscaled_argb ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"})
    IO (Ptr Gst.Buffer.Buffer)

{- |
Retrieves the pixel data as it is. This is useful if the caller can
do the scaling itself when handling the overlaying. The rectangle will
need to be scaled to the render dimensions, which can be retrieved using
'GI.GstVideo.Structs.VideoOverlayRectangle.videoOverlayRectangleGetRenderRectangle'.
-}
videoOverlayRectangleGetPixelsUnscaledArgb ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> [GstVideo.Flags.VideoOverlayFormatFlags]
    {- ^ /@flags@/: flags.
   If a global_alpha value != 1 is set for the rectangle, the caller
   should set the @/GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA/@ flag
   if he wants to apply global-alpha himself. If the flag is not set
   global_alpha is applied internally before returning the pixel-data. -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ a 'GI.Gst.Structs.Buffer.Buffer' holding the ARGB pixel data with
   'GI.GstVideo.Structs.VideoMeta.VideoMeta' set. This function does not return a reference, the caller
   should obtain a reference of her own with @/gst_buffer_ref()/@ if needed. -}
videoOverlayRectangleGetPixelsUnscaledArgb rectangle flags = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    let flags' = gflagsToWord flags
    result <- gst_video_overlay_rectangle_get_pixels_unscaled_argb rectangle' flags'
    checkUnexpectedReturnNULL "videoOverlayRectangleGetPixelsUnscaledArgb" result
    result' <- (newBoxed Gst.Buffer.Buffer) result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetPixelsUnscaledArgbMethodInfo
instance (signature ~ ([GstVideo.Flags.VideoOverlayFormatFlags] -> m Gst.Buffer.Buffer), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetPixelsUnscaledArgbMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetPixelsUnscaledArgb

#endif

-- method VideoOverlayRectangle::get_pixels_unscaled_ayuv
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags.\n   If a global_alpha value != 1 is set for the rectangle, the caller\n   should set the #GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag\n   if he wants to apply global-alpha himself. If the flag is not set\n   global_alpha is applied internally before returning the pixel-data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_pixels_unscaled_ayuv" gst_video_overlay_rectangle_get_pixels_unscaled_ayuv ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"})
    IO (Ptr Gst.Buffer.Buffer)

{- |
Retrieves the pixel data as it is. This is useful if the caller can
do the scaling itself when handling the overlaying. The rectangle will
need to be scaled to the render dimensions, which can be retrieved using
'GI.GstVideo.Structs.VideoOverlayRectangle.videoOverlayRectangleGetRenderRectangle'.
-}
videoOverlayRectangleGetPixelsUnscaledAyuv ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> [GstVideo.Flags.VideoOverlayFormatFlags]
    {- ^ /@flags@/: flags.
   If a global_alpha value != 1 is set for the rectangle, the caller
   should set the @/GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA/@ flag
   if he wants to apply global-alpha himself. If the flag is not set
   global_alpha is applied internally before returning the pixel-data. -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ a 'GI.Gst.Structs.Buffer.Buffer' holding the AYUV pixel data with
   'GI.GstVideo.Structs.VideoMeta.VideoMeta' set. This function does not return a reference, the caller
   should obtain a reference of her own with @/gst_buffer_ref()/@ if needed. -}
videoOverlayRectangleGetPixelsUnscaledAyuv rectangle flags = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    let flags' = gflagsToWord flags
    result <- gst_video_overlay_rectangle_get_pixels_unscaled_ayuv rectangle' flags'
    checkUnexpectedReturnNULL "videoOverlayRectangleGetPixelsUnscaledAyuv" result
    result' <- (newBoxed Gst.Buffer.Buffer) result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetPixelsUnscaledAyuvMethodInfo
instance (signature ~ ([GstVideo.Flags.VideoOverlayFormatFlags] -> m Gst.Buffer.Buffer), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetPixelsUnscaledAyuvMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetPixelsUnscaledAyuv

#endif

-- method VideoOverlayRectangle::get_pixels_unscaled_raw
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags.\n   If a global_alpha value != 1 is set for the rectangle, the caller\n   should set the #GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag\n   if he wants to apply global-alpha himself. If the flag is not set\n   global_alpha is applied internally before returning the pixel-data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_pixels_unscaled_raw" gst_video_overlay_rectangle_get_pixels_unscaled_raw ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayFormatFlags"})
    IO (Ptr Gst.Buffer.Buffer)

{- |
Retrieves the pixel data as it is. This is useful if the caller can
do the scaling itself when handling the overlaying. The rectangle will
need to be scaled to the render dimensions, which can be retrieved using
'GI.GstVideo.Structs.VideoOverlayRectangle.videoOverlayRectangleGetRenderRectangle'.
-}
videoOverlayRectangleGetPixelsUnscaledRaw ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> [GstVideo.Flags.VideoOverlayFormatFlags]
    {- ^ /@flags@/: flags.
   If a global_alpha value != 1 is set for the rectangle, the caller
   should set the @/GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA/@ flag
   if he wants to apply global-alpha himself. If the flag is not set
   global_alpha is applied internally before returning the pixel-data. -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ a 'GI.Gst.Structs.Buffer.Buffer' holding the pixel data with
   'GI.GstVideo.Structs.VideoMeta.VideoMeta' set. This function does not return a reference, the caller
   should obtain a reference of her own with @/gst_buffer_ref()/@ if needed. -}
videoOverlayRectangleGetPixelsUnscaledRaw rectangle flags = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    let flags' = gflagsToWord flags
    result <- gst_video_overlay_rectangle_get_pixels_unscaled_raw rectangle' flags'
    checkUnexpectedReturnNULL "videoOverlayRectangleGetPixelsUnscaledRaw" result
    result' <- (newBoxed Gst.Buffer.Buffer) result
    touchManagedPtr rectangle
    return result'

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetPixelsUnscaledRawMethodInfo
instance (signature ~ ([GstVideo.Flags.VideoOverlayFormatFlags] -> m Gst.Buffer.Buffer), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetPixelsUnscaledRawMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetPixelsUnscaledRaw

#endif

-- method VideoOverlayRectangle::get_render_rectangle
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_x", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "address where to store the X render offset", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "render_y", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "address where to store the Y render offset", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "render_width", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "address where to store the render width", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "render_height", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "address where to store the render height", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_render_rectangle" gst_video_overlay_rectangle_get_render_rectangle ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    Ptr Int32 ->                            -- render_x : TBasicType TInt
    Ptr Int32 ->                            -- render_y : TBasicType TInt
    Ptr Word32 ->                           -- render_width : TBasicType TUInt
    Ptr Word32 ->                           -- render_height : TBasicType TUInt
    IO CInt

{- |
Retrieves the render position and render dimension of the overlay
rectangle on the video.
-}
videoOverlayRectangleGetRenderRectangle ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> m ((Bool, Int32, Int32, Word32, Word32))
    {- ^ __Returns:__ TRUE if valid render dimensions were retrieved. -}
videoOverlayRectangleGetRenderRectangle rectangle = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    renderX <- allocMem :: IO (Ptr Int32)
    renderY <- allocMem :: IO (Ptr Int32)
    renderWidth <- allocMem :: IO (Ptr Word32)
    renderHeight <- allocMem :: IO (Ptr Word32)
    result <- gst_video_overlay_rectangle_get_render_rectangle rectangle' renderX renderY renderWidth renderHeight
    let result' = (/= 0) result
    renderX' <- peek renderX
    renderY' <- peek renderY
    renderWidth' <- peek renderWidth
    renderHeight' <- peek renderHeight
    touchManagedPtr rectangle
    freeMem renderX
    freeMem renderY
    freeMem renderWidth
    freeMem renderHeight
    return (result', renderX', renderY', renderWidth', renderHeight')

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetRenderRectangleMethodInfo
instance (signature ~ (m ((Bool, Int32, Int32, Word32, Word32))), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetRenderRectangleMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetRenderRectangle

#endif

-- method VideoOverlayRectangle::get_seqnum
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_get_seqnum" gst_video_overlay_rectangle_get_seqnum ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    IO Word32

{- |
Returns the sequence number of this rectangle. Sequence numbers are
monotonically increasing and unique for overlay compositions and rectangles
(meaning there will never be a rectangle with the same sequence number as
a composition).

Using the sequence number of a rectangle as an indicator for changed
pixel-data of a rectangle is dangereous. Some API calls, like e.g.
'GI.GstVideo.Structs.VideoOverlayRectangle.videoOverlayRectangleSetGlobalAlpha', automatically update
the per rectangle sequence number, which is misleading for renderers\/
consumers, that handle global-alpha themselves. For them  the
pixel-data returned by gst_video_overlay_rectangle_get_pixels_*()
wont be different for different global-alpha values. In this case a
renderer could also use the GstBuffer pointers as a hint for changed
pixel-data.
-}
videoOverlayRectangleGetSeqnum ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> m Word32
    {- ^ __Returns:__ the sequence number of /@rectangle@/ -}
videoOverlayRectangleGetSeqnum rectangle = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    result <- gst_video_overlay_rectangle_get_seqnum rectangle'
    touchManagedPtr rectangle
    return result

#if ENABLE_OVERLOADING
data VideoOverlayRectangleGetSeqnumMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.MethodInfo VideoOverlayRectangleGetSeqnumMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleGetSeqnum

#endif

-- method VideoOverlayRectangle::set_global_alpha
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "global_alpha", argType = TBasicType TFloat, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Global alpha value (0 to 1.0)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_set_global_alpha" gst_video_overlay_rectangle_set_global_alpha ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    CFloat ->                               -- global_alpha : TBasicType TFloat
    IO ()

{- |
Sets the global alpha value associated with a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle'. Per-
pixel alpha values are multiplied with this value. Valid
values: 0 \<= global_alpha \<= 1; 1 to deactivate.

/@rectangle@/ must be writable, meaning its refcount must be 1. You can
make the rectangles inside a 'GI.GstVideo.Structs.VideoOverlayComposition.VideoOverlayComposition' writable using
'GI.GstVideo.Structs.VideoOverlayComposition.videoOverlayCompositionMakeWritable' or
'GI.GstVideo.Structs.VideoOverlayComposition.videoOverlayCompositionCopy'.
-}
videoOverlayRectangleSetGlobalAlpha ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> Float
    {- ^ /@globalAlpha@/: Global alpha value (0 to 1.0) -}
    -> m ()
videoOverlayRectangleSetGlobalAlpha rectangle globalAlpha = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    let globalAlpha' = realToFrac globalAlpha
    gst_video_overlay_rectangle_set_global_alpha rectangle' globalAlpha'
    touchManagedPtr rectangle
    return ()

#if ENABLE_OVERLOADING
data VideoOverlayRectangleSetGlobalAlphaMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m) => O.MethodInfo VideoOverlayRectangleSetGlobalAlphaMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleSetGlobalAlpha

#endif

-- method VideoOverlayRectangle::set_render_rectangle
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rectangle", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "render X position of rectangle on video", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_y", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "render Y position of rectangle on video", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_width", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "render width of rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "render_height", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "render height of rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_rectangle_set_render_rectangle" gst_video_overlay_rectangle_set_render_rectangle ::
    Ptr VideoOverlayRectangle ->            -- rectangle : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayRectangle"})
    Int32 ->                                -- render_x : TBasicType TInt
    Int32 ->                                -- render_y : TBasicType TInt
    Word32 ->                               -- render_width : TBasicType TUInt
    Word32 ->                               -- render_height : TBasicType TUInt
    IO ()

{- |
Sets the render position and dimensions of the rectangle on the video.
This function is mainly for elements that modify the size of the video
in some way (e.g. through scaling or cropping) and need to adjust the
details of any overlays to match the operation that changed the size.

/@rectangle@/ must be writable, meaning its refcount must be 1. You can
make the rectangles inside a 'GI.GstVideo.Structs.VideoOverlayComposition.VideoOverlayComposition' writable using
'GI.GstVideo.Structs.VideoOverlayComposition.videoOverlayCompositionMakeWritable' or
'GI.GstVideo.Structs.VideoOverlayComposition.videoOverlayCompositionCopy'.
-}
videoOverlayRectangleSetRenderRectangle ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoOverlayRectangle
    {- ^ /@rectangle@/: a 'GI.GstVideo.Structs.VideoOverlayRectangle.VideoOverlayRectangle' -}
    -> Int32
    {- ^ /@renderX@/: render X position of rectangle on video -}
    -> Int32
    {- ^ /@renderY@/: render Y position of rectangle on video -}
    -> Word32
    {- ^ /@renderWidth@/: render width of rectangle -}
    -> Word32
    {- ^ /@renderHeight@/: render height of rectangle -}
    -> m ()
videoOverlayRectangleSetRenderRectangle rectangle renderX renderY renderWidth renderHeight = liftIO $ do
    rectangle' <- unsafeManagedPtrGetPtr rectangle
    gst_video_overlay_rectangle_set_render_rectangle rectangle' renderX renderY renderWidth renderHeight
    touchManagedPtr rectangle
    return ()

#if ENABLE_OVERLOADING
data VideoOverlayRectangleSetRenderRectangleMethodInfo
instance (signature ~ (Int32 -> Int32 -> Word32 -> Word32 -> m ()), MonadIO m) => O.MethodInfo VideoOverlayRectangleSetRenderRectangleMethodInfo VideoOverlayRectangle signature where
    overloadedMethod _ = videoOverlayRectangleSetRenderRectangle

#endif

#if ENABLE_OVERLOADING
type family ResolveVideoOverlayRectangleMethod (t :: Symbol) (o :: *) :: * where
    ResolveVideoOverlayRectangleMethod "copy" o = VideoOverlayRectangleCopyMethodInfo
    ResolveVideoOverlayRectangleMethod "getFlags" o = VideoOverlayRectangleGetFlagsMethodInfo
    ResolveVideoOverlayRectangleMethod "getGlobalAlpha" o = VideoOverlayRectangleGetGlobalAlphaMethodInfo
    ResolveVideoOverlayRectangleMethod "getPixelsArgb" o = VideoOverlayRectangleGetPixelsArgbMethodInfo
    ResolveVideoOverlayRectangleMethod "getPixelsAyuv" o = VideoOverlayRectangleGetPixelsAyuvMethodInfo
    ResolveVideoOverlayRectangleMethod "getPixelsRaw" o = VideoOverlayRectangleGetPixelsRawMethodInfo
    ResolveVideoOverlayRectangleMethod "getPixelsUnscaledArgb" o = VideoOverlayRectangleGetPixelsUnscaledArgbMethodInfo
    ResolveVideoOverlayRectangleMethod "getPixelsUnscaledAyuv" o = VideoOverlayRectangleGetPixelsUnscaledAyuvMethodInfo
    ResolveVideoOverlayRectangleMethod "getPixelsUnscaledRaw" o = VideoOverlayRectangleGetPixelsUnscaledRawMethodInfo
    ResolveVideoOverlayRectangleMethod "getRenderRectangle" o = VideoOverlayRectangleGetRenderRectangleMethodInfo
    ResolveVideoOverlayRectangleMethod "getSeqnum" o = VideoOverlayRectangleGetSeqnumMethodInfo
    ResolveVideoOverlayRectangleMethod "setGlobalAlpha" o = VideoOverlayRectangleSetGlobalAlphaMethodInfo
    ResolveVideoOverlayRectangleMethod "setRenderRectangle" o = VideoOverlayRectangleSetRenderRectangleMethodInfo
    ResolveVideoOverlayRectangleMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveVideoOverlayRectangleMethod t VideoOverlayRectangle, O.MethodInfo info VideoOverlayRectangle p) => OL.IsLabel t (VideoOverlayRectangle -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif