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

'GI.GstVideo.Structs.VideoResampler.VideoResampler' is a structure which holds the information
required to perform various kinds of resampling filtering.
-}

module GI.GstVideo.Structs.VideoResampler
    ( 

-- * Exported types
    VideoResampler(..)                      ,
    newZeroVideoResampler                   ,
    noVideoResampler                        ,


 -- * Methods
-- ** clear #method:clear#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoResamplerClearMethodInfo           ,
#endif
    videoResamplerClear                     ,


-- ** init #method:init#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoResamplerInitMethodInfo            ,
#endif
    videoResamplerInit                      ,




 -- * Properties
-- ** inSize #attr:inSize#
    getVideoResamplerInSize                 ,
    setVideoResamplerInSize                 ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    videoResampler_inSize                   ,
#endif


-- ** maxTaps #attr:maxTaps#
    getVideoResamplerMaxTaps                ,
    setVideoResamplerMaxTaps                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    videoResampler_maxTaps                  ,
#endif


-- ** nPhases #attr:nPhases#
    getVideoResamplerNPhases                ,
    setVideoResamplerNPhases                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    videoResampler_nPhases                  ,
#endif


-- ** nTaps #attr:nTaps#
    getVideoResamplerNTaps                  ,
    setVideoResamplerNTaps                  ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    videoResampler_nTaps                    ,
#endif


-- ** offset #attr:offset#
    getVideoResamplerOffset                 ,
    setVideoResamplerOffset                 ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    videoResampler_offset                   ,
#endif


-- ** outSize #attr:outSize#
    getVideoResamplerOutSize                ,
    setVideoResamplerOutSize                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    videoResampler_outSize                  ,
#endif


-- ** phase #attr:phase#
    getVideoResamplerPhase                  ,
    setVideoResamplerPhase                  ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    videoResampler_phase                    ,
#endif


-- ** taps #attr:taps#
    getVideoResamplerTaps                   ,
    setVideoResamplerTaps                   ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    videoResampler_taps                     ,
#endif




    ) 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.Structure as Gst.Structure
import {-# SOURCE #-} qualified GI.GstVideo.Enums as GstVideo.Enums
import {-# SOURCE #-} qualified GI.GstVideo.Flags as GstVideo.Flags

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

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

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


noVideoResampler :: Maybe VideoResampler
noVideoResampler = Nothing

getVideoResamplerInSize :: MonadIO m => VideoResampler -> m Int32
getVideoResamplerInSize s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO Int32
    return val

setVideoResamplerInSize :: MonadIO m => VideoResampler -> Int32 -> m ()
setVideoResamplerInSize s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (val :: Int32)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerInSizeFieldInfo
instance AttrInfo VideoResamplerInSizeFieldInfo where
    type AttrAllowedOps VideoResamplerInSizeFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoResamplerInSizeFieldInfo = (~) Int32
    type AttrBaseTypeConstraint VideoResamplerInSizeFieldInfo = (~) VideoResampler
    type AttrGetType VideoResamplerInSizeFieldInfo = Int32
    type AttrLabel VideoResamplerInSizeFieldInfo = "in_size"
    type AttrOrigin VideoResamplerInSizeFieldInfo = VideoResampler
    attrGet _ = getVideoResamplerInSize
    attrSet _ = setVideoResamplerInSize
    attrConstruct = undefined
    attrClear _ = undefined

videoResampler_inSize :: AttrLabelProxy "inSize"
videoResampler_inSize = AttrLabelProxy

#endif


getVideoResamplerOutSize :: MonadIO m => VideoResampler -> m Int32
getVideoResamplerOutSize s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 4) :: IO Int32
    return val

setVideoResamplerOutSize :: MonadIO m => VideoResampler -> Int32 -> m ()
setVideoResamplerOutSize s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 4) (val :: Int32)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerOutSizeFieldInfo
instance AttrInfo VideoResamplerOutSizeFieldInfo where
    type AttrAllowedOps VideoResamplerOutSizeFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoResamplerOutSizeFieldInfo = (~) Int32
    type AttrBaseTypeConstraint VideoResamplerOutSizeFieldInfo = (~) VideoResampler
    type AttrGetType VideoResamplerOutSizeFieldInfo = Int32
    type AttrLabel VideoResamplerOutSizeFieldInfo = "out_size"
    type AttrOrigin VideoResamplerOutSizeFieldInfo = VideoResampler
    attrGet _ = getVideoResamplerOutSize
    attrSet _ = setVideoResamplerOutSize
    attrConstruct = undefined
    attrClear _ = undefined

videoResampler_outSize :: AttrLabelProxy "outSize"
videoResampler_outSize = AttrLabelProxy

#endif


getVideoResamplerMaxTaps :: MonadIO m => VideoResampler -> m Word32
getVideoResamplerMaxTaps s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO Word32
    return val

setVideoResamplerMaxTaps :: MonadIO m => VideoResampler -> Word32 -> m ()
setVideoResamplerMaxTaps s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (val :: Word32)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerMaxTapsFieldInfo
instance AttrInfo VideoResamplerMaxTapsFieldInfo where
    type AttrAllowedOps VideoResamplerMaxTapsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoResamplerMaxTapsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoResamplerMaxTapsFieldInfo = (~) VideoResampler
    type AttrGetType VideoResamplerMaxTapsFieldInfo = Word32
    type AttrLabel VideoResamplerMaxTapsFieldInfo = "max_taps"
    type AttrOrigin VideoResamplerMaxTapsFieldInfo = VideoResampler
    attrGet _ = getVideoResamplerMaxTaps
    attrSet _ = setVideoResamplerMaxTaps
    attrConstruct = undefined
    attrClear _ = undefined

videoResampler_maxTaps :: AttrLabelProxy "maxTaps"
videoResampler_maxTaps = AttrLabelProxy

#endif


getVideoResamplerNPhases :: MonadIO m => VideoResampler -> m Word32
getVideoResamplerNPhases s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 12) :: IO Word32
    return val

setVideoResamplerNPhases :: MonadIO m => VideoResampler -> Word32 -> m ()
setVideoResamplerNPhases s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 12) (val :: Word32)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerNPhasesFieldInfo
instance AttrInfo VideoResamplerNPhasesFieldInfo where
    type AttrAllowedOps VideoResamplerNPhasesFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoResamplerNPhasesFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoResamplerNPhasesFieldInfo = (~) VideoResampler
    type AttrGetType VideoResamplerNPhasesFieldInfo = Word32
    type AttrLabel VideoResamplerNPhasesFieldInfo = "n_phases"
    type AttrOrigin VideoResamplerNPhasesFieldInfo = VideoResampler
    attrGet _ = getVideoResamplerNPhases
    attrSet _ = setVideoResamplerNPhases
    attrConstruct = undefined
    attrClear _ = undefined

videoResampler_nPhases :: AttrLabelProxy "nPhases"
videoResampler_nPhases = AttrLabelProxy

#endif


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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerOffsetFieldInfo
instance AttrInfo VideoResamplerOffsetFieldInfo where
    type AttrAllowedOps VideoResamplerOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoResamplerOffsetFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoResamplerOffsetFieldInfo = (~) VideoResampler
    type AttrGetType VideoResamplerOffsetFieldInfo = Word32
    type AttrLabel VideoResamplerOffsetFieldInfo = "offset"
    type AttrOrigin VideoResamplerOffsetFieldInfo = VideoResampler
    attrGet _ = getVideoResamplerOffset
    attrSet _ = setVideoResamplerOffset
    attrConstruct = undefined
    attrClear _ = undefined

videoResampler_offset :: AttrLabelProxy "offset"
videoResampler_offset = AttrLabelProxy

#endif


getVideoResamplerPhase :: MonadIO m => VideoResampler -> m Word32
getVideoResamplerPhase s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO Word32
    return val

setVideoResamplerPhase :: MonadIO m => VideoResampler -> Word32 -> m ()
setVideoResamplerPhase s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (val :: Word32)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerPhaseFieldInfo
instance AttrInfo VideoResamplerPhaseFieldInfo where
    type AttrAllowedOps VideoResamplerPhaseFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoResamplerPhaseFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoResamplerPhaseFieldInfo = (~) VideoResampler
    type AttrGetType VideoResamplerPhaseFieldInfo = Word32
    type AttrLabel VideoResamplerPhaseFieldInfo = "phase"
    type AttrOrigin VideoResamplerPhaseFieldInfo = VideoResampler
    attrGet _ = getVideoResamplerPhase
    attrSet _ = setVideoResamplerPhase
    attrConstruct = undefined
    attrClear _ = undefined

videoResampler_phase :: AttrLabelProxy "phase"
videoResampler_phase = AttrLabelProxy

#endif


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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerNTapsFieldInfo
instance AttrInfo VideoResamplerNTapsFieldInfo where
    type AttrAllowedOps VideoResamplerNTapsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoResamplerNTapsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint VideoResamplerNTapsFieldInfo = (~) VideoResampler
    type AttrGetType VideoResamplerNTapsFieldInfo = Word32
    type AttrLabel VideoResamplerNTapsFieldInfo = "n_taps"
    type AttrOrigin VideoResamplerNTapsFieldInfo = VideoResampler
    attrGet _ = getVideoResamplerNTaps
    attrSet _ = setVideoResamplerNTaps
    attrConstruct = undefined
    attrClear _ = undefined

videoResampler_nTaps :: AttrLabelProxy "nTaps"
videoResampler_nTaps = AttrLabelProxy

#endif


getVideoResamplerTaps :: MonadIO m => VideoResampler -> m Double
getVideoResamplerTaps s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 40) :: IO CDouble
    let val' = realToFrac val
    return val'

setVideoResamplerTaps :: MonadIO m => VideoResampler -> Double -> m ()
setVideoResamplerTaps s val = liftIO $ withManagedPtr s $ \ptr -> do
    let val' = realToFrac val
    poke (ptr `plusPtr` 40) (val' :: CDouble)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerTapsFieldInfo
instance AttrInfo VideoResamplerTapsFieldInfo where
    type AttrAllowedOps VideoResamplerTapsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint VideoResamplerTapsFieldInfo = (~) Double
    type AttrBaseTypeConstraint VideoResamplerTapsFieldInfo = (~) VideoResampler
    type AttrGetType VideoResamplerTapsFieldInfo = Double
    type AttrLabel VideoResamplerTapsFieldInfo = "taps"
    type AttrOrigin VideoResamplerTapsFieldInfo = VideoResampler
    attrGet _ = getVideoResamplerTaps
    attrSet _ = setVideoResamplerTaps
    attrConstruct = undefined
    attrClear _ = undefined

videoResampler_taps :: AttrLabelProxy "taps"
videoResampler_taps = AttrLabelProxy

#endif



#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList VideoResampler
type instance O.AttributeList VideoResampler = VideoResamplerAttributeList
type VideoResamplerAttributeList = ('[ '("inSize", VideoResamplerInSizeFieldInfo), '("outSize", VideoResamplerOutSizeFieldInfo), '("maxTaps", VideoResamplerMaxTapsFieldInfo), '("nPhases", VideoResamplerNPhasesFieldInfo), '("offset", VideoResamplerOffsetFieldInfo), '("phase", VideoResamplerPhaseFieldInfo), '("nTaps", VideoResamplerNTapsFieldInfo), '("taps", VideoResamplerTapsFieldInfo)] :: [(Symbol, *)])
#endif

-- method VideoResampler::clear
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "resampler", argType = TInterface (Name {namespace = "GstVideo", name = "VideoResampler"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoResampler", 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_resampler_clear" gst_video_resampler_clear :: 
    Ptr VideoResampler ->                   -- resampler : TInterface (Name {namespace = "GstVideo", name = "VideoResampler"})
    IO ()

{- |
Clear a previously initialized 'GI.GstVideo.Structs.VideoResampler.VideoResampler' /@resampler@/.

@since 1.6
-}
videoResamplerClear ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoResampler
    {- ^ /@resampler@/: a 'GI.GstVideo.Structs.VideoResampler.VideoResampler' -}
    -> m ()
videoResamplerClear resampler = liftIO $ do
    resampler' <- unsafeManagedPtrGetPtr resampler
    gst_video_resampler_clear resampler'
    touchManagedPtr resampler
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerClearMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo VideoResamplerClearMethodInfo VideoResampler signature where
    overloadedMethod _ = videoResamplerClear

#endif

-- method VideoResampler::init
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "resampler", argType = TInterface (Name {namespace = "GstVideo", name = "VideoResampler"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "method", argType = TInterface (Name {namespace = "GstVideo", name = "VideoResamplerMethod"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoResamplerFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_phases", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_taps", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "shift", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "in_size", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_size", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TInterface (Name {namespace = "Gst", name = "Structure"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_resampler_init" gst_video_resampler_init :: 
    Ptr VideoResampler ->                   -- resampler : TInterface (Name {namespace = "GstVideo", name = "VideoResampler"})
    CUInt ->                                -- method : TInterface (Name {namespace = "GstVideo", name = "VideoResamplerMethod"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoResamplerFlags"})
    Word32 ->                               -- n_phases : TBasicType TUInt
    Word32 ->                               -- n_taps : TBasicType TUInt
    CDouble ->                              -- shift : TBasicType TDouble
    Word32 ->                               -- in_size : TBasicType TUInt
    Word32 ->                               -- out_size : TBasicType TUInt
    Ptr Gst.Structure.Structure ->          -- options : TInterface (Name {namespace = "Gst", name = "Structure"})
    IO CInt

{- |
/No description available in the introspection data./
-}
videoResamplerInit ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    VideoResampler
    -> GstVideo.Enums.VideoResamplerMethod
    -> [GstVideo.Flags.VideoResamplerFlags]
    -> Word32
    -> Word32
    -> Double
    -> Word32
    -> Word32
    -> Gst.Structure.Structure
    -> m Bool
videoResamplerInit resampler method flags nPhases nTaps shift inSize outSize options = liftIO $ do
    resampler' <- unsafeManagedPtrGetPtr resampler
    let method' = (fromIntegral . fromEnum) method
    let flags' = gflagsToWord flags
    let shift' = realToFrac shift
    options' <- unsafeManagedPtrGetPtr options
    result <- gst_video_resampler_init resampler' method' flags' nPhases nTaps shift' inSize outSize options'
    let result' = (/= 0) result
    touchManagedPtr resampler
    touchManagedPtr options
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoResamplerInitMethodInfo
instance (signature ~ (GstVideo.Enums.VideoResamplerMethod -> [GstVideo.Flags.VideoResamplerFlags] -> Word32 -> Word32 -> Double -> Word32 -> Word32 -> Gst.Structure.Structure -> m Bool), MonadIO m) => O.MethodInfo VideoResamplerInitMethodInfo VideoResampler signature where
    overloadedMethod _ = videoResamplerInit

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveVideoResamplerMethod (t :: Symbol) (o :: *) :: * where
    ResolveVideoResamplerMethod "clear" o = VideoResamplerClearMethodInfo
    ResolveVideoResamplerMethod "init" o = VideoResamplerInitMethodInfo
    ResolveVideoResamplerMethod l o = O.MethodResolutionFailed l o

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

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveVideoResamplerMethod t VideoResampler, O.MethodInfo info VideoResampler p) => O.IsLabel t (VideoResampler -> 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

#endif