@@ -24,9 +24,6 @@ import "base" Foreign.C.Types
24
24
import "base" Foreign.Ptr ( Ptr )
25
25
import "base" Foreign.Storable ( Storable (.. ), peekElemOff , pokeElemOff )
26
26
import "base" System.IO.Unsafe ( unsafePerformIO )
27
- #ifndef OPENCV4
28
- import qualified "bytestring" Data.ByteString as B
29
- #endif
30
27
import "linear" Linear.Vector ( zero )
31
28
import "linear" Linear.V4 ( V4 (.. ) )
32
29
import "this" OpenCV.Core.Types
@@ -54,9 +51,6 @@ data HElems
54
51
| HElems_32S ! (VU. Vector Int32 )
55
52
| HElems_32F ! (VU. Vector Float )
56
53
| HElems_64F ! (VU. Vector Double )
57
- #ifndef OPENCV4
58
- | HElems_USRTYPE1 ! (V. Vector B. ByteString )
59
- #endif
60
54
deriving (Show , Eq )
61
55
62
56
hElemsDepth :: HElems -> Depth
@@ -68,9 +62,6 @@ hElemsDepth = \case
68
62
HElems_32S _v -> Depth_32S
69
63
HElems_32F _v -> Depth_32F
70
64
HElems_64F _v -> Depth_64F
71
- #ifndef OPENCV4
72
- HElems_USRTYPE1 _v -> Depth_USRTYPE1
73
- #endif
74
65
75
66
hElemsLength :: HElems -> Int
76
67
hElemsLength = \ case
@@ -81,9 +72,6 @@ hElemsLength = \case
81
72
HElems_32S v -> VG. length v
82
73
HElems_32F v -> VG. length v
83
74
HElems_64F v -> VG. length v
84
- #ifndef OPENCV4
85
- HElems_USRTYPE1 v -> VG. length v
86
- #endif
87
75
88
76
class ToHElems a where
89
77
toHElems :: VU. Vector a -> HElems
@@ -121,9 +109,6 @@ matToHMat mat = unsafePerformIO $ withMatData mat $ \step dataPtr -> do
121
109
Depth_32S -> HElems_32S <$> copyToVec
122
110
Depth_32F -> HElems_32F <$> copyToVec
123
111
Depth_64F -> HElems_64F <$> copyToVec
124
- #ifndef OPENCV4
125
- Depth_USRTYPE1 -> HElems_USRTYPE1 <$> error " todo"
126
- #endif
127
112
where
128
113
copyToVec :: (Storable a , VU. Unbox a ) => IO (VU. Vector a )
129
114
copyToVec = do
@@ -159,9 +144,6 @@ hMatToMatIO (HMat shape channels elems) = do
159
144
HElems_32S v -> copyFromVec v
160
145
HElems_32F v -> copyFromVec v
161
146
HElems_64F v -> copyFromVec v
162
- #ifndef OPENCV4
163
- HElems_USRTYPE1 _v -> error " todo"
164
- #endif
165
147
where
166
148
copyFromVec :: (Storable a , VU. Unbox a ) => VU. Vector a -> IO ()
167
149
copyFromVec v =
0 commit comments