@@ -24,9 +24,6 @@ import "base" Foreign.C.Types
2424import "base" Foreign.Ptr ( Ptr )
2525import "base" Foreign.Storable ( Storable (.. ), peekElemOff , pokeElemOff )
2626import "base" System.IO.Unsafe ( unsafePerformIO )
27- #ifndef OPENCV4
28- import qualified "bytestring" Data.ByteString as B
29- #endif
3027import "linear" Linear.Vector ( zero )
3128import "linear" Linear.V4 ( V4 (.. ) )
3229import "this" OpenCV.Core.Types
@@ -54,9 +51,6 @@ data HElems
5451 | HElems_32S ! (VU. Vector Int32 )
5552 | HElems_32F ! (VU. Vector Float )
5653 | HElems_64F ! (VU. Vector Double )
57- #ifndef OPENCV4
58- | HElems_USRTYPE1 ! (V. Vector B. ByteString )
59- #endif
6054 deriving (Show , Eq )
6155
6256hElemsDepth :: HElems -> Depth
@@ -68,9 +62,6 @@ hElemsDepth = \case
6862 HElems_32S _v -> Depth_32S
6963 HElems_32F _v -> Depth_32F
7064 HElems_64F _v -> Depth_64F
71- #ifndef OPENCV4
72- HElems_USRTYPE1 _v -> Depth_USRTYPE1
73- #endif
7465
7566hElemsLength :: HElems -> Int
7667hElemsLength = \ case
@@ -81,9 +72,6 @@ hElemsLength = \case
8172 HElems_32S v -> VG. length v
8273 HElems_32F v -> VG. length v
8374 HElems_64F v -> VG. length v
84- #ifndef OPENCV4
85- HElems_USRTYPE1 v -> VG. length v
86- #endif
8775
8876class ToHElems a where
8977 toHElems :: VU. Vector a -> HElems
@@ -121,9 +109,6 @@ matToHMat mat = unsafePerformIO $ withMatData mat $ \step dataPtr -> do
121109 Depth_32S -> HElems_32S <$> copyToVec
122110 Depth_32F -> HElems_32F <$> copyToVec
123111 Depth_64F -> HElems_64F <$> copyToVec
124- #ifndef OPENCV4
125- Depth_USRTYPE1 -> HElems_USRTYPE1 <$> error " todo"
126- #endif
127112 where
128113 copyToVec :: (Storable a , VU. Unbox a ) => IO (VU. Vector a )
129114 copyToVec = do
@@ -159,9 +144,6 @@ hMatToMatIO (HMat shape channels elems) = do
159144 HElems_32S v -> copyFromVec v
160145 HElems_32F v -> copyFromVec v
161146 HElems_64F v -> copyFromVec v
162- #ifndef OPENCV4
163- HElems_USRTYPE1 _v -> error " todo"
164- #endif
165147 where
166148 copyFromVec :: (Storable a , VU. Unbox a ) => VU. Vector a -> IO ()
167149 copyFromVec v =
0 commit comments