module OpenCV.Internal.ImgProc.Types where
import "base" Data.Int ( Int32 )
import "base" Foreign.C.Types ( CDouble )
import "linear" Linear.V4 ( V4(..) )
import "linear" Linear.Vector ( zero )
import "this" OpenCV.Core.Types ( Scalar, toScalar )
import "this" OpenCV.ImgProc.Types
c'INTER_NEAREST = 0
c'INTER_NEAREST :: (Num a) => a
c'INTER_LINEAR = 1
c'INTER_LINEAR :: (Num a) => a
c'INTER_CUBIC = 2
c'INTER_CUBIC :: (Num a) => a
c'INTER_AREA = 3
c'INTER_AREA :: (Num a) => a
c'INTER_LANCZOS4 = 4
c'INTER_LANCZOS4 :: (Num a) => a
marshalInterpolationMethod :: InterpolationMethod -> Int32
marshalInterpolationMethod = \case
InterNearest -> c'INTER_NEAREST
InterLinear -> c'INTER_LINEAR
InterCubic -> c'INTER_CUBIC
InterArea -> c'INTER_AREA
InterLanczos4 -> c'INTER_LANCZOS4
c'BORDER_CONSTANT = 0
c'BORDER_CONSTANT :: (Num a) => a
c'BORDER_REPLICATE = 1
c'BORDER_REPLICATE :: (Num a) => a
c'BORDER_REFLECT = 2
c'BORDER_REFLECT :: (Num a) => a
c'BORDER_WRAP = 3
c'BORDER_WRAP :: (Num a) => a
c'BORDER_REFLECT_101 = 4
c'BORDER_REFLECT_101 :: (Num a) => a
c'BORDER_TRANSPARENT = 5
c'BORDER_TRANSPARENT :: (Num a) => a
c'BORDER_ISOLATED = 16
c'BORDER_ISOLATED :: (Num a) => a
marshalBorderMode :: BorderMode -> (Int32, Scalar)
marshalBorderMode = \case
BorderConstant s -> (c'BORDER_CONSTANT , s )
BorderReplicate -> (c'BORDER_REPLICATE , zeroScalar)
BorderReflect -> (c'BORDER_REFLECT , zeroScalar)
BorderWrap -> (c'BORDER_WRAP , zeroScalar)
BorderReflect101 -> (c'BORDER_REFLECT_101 , zeroScalar)
BorderTransparent -> (c'BORDER_TRANSPARENT , zeroScalar)
BorderIsolated -> (c'BORDER_ISOLATED , zeroScalar)
where
zeroScalar :: Scalar
zeroScalar = toScalar (zero :: V4 CDouble)