|
1 | 1 | // coverage:ignore-file |
2 | | -// ignore_for_file: non_constant_identifier_names |
| 2 | +// ignore_for_file: non_constant_identifier_names, constant_identifier_names |
3 | 3 |
|
4 | 4 | /* Error status codes |
5 | 5 | Original codes were from OpenCVSharp |
|
10 | 10 | Ported to Dart By: @Rainyl |
11 | 11 | LICENSE: Apache-2.0 |
12 | 12 | */ |
13 | | - |
14 | | -import 'base.dart'; |
15 | | - |
16 | | -class ErrorCode with ComparableMixin { |
| 13 | +extension type const ErrorCode(int code) { |
17 | 14 | /// @brief everithing is ok CV_StsOk |
18 | | - static final ErrorCode StsOk = ErrorCode(0); |
| 15 | + static const StsOk = ErrorCode(0); |
19 | 16 |
|
20 | 17 | /// @brief pseudo error for back trace CV_StsBackTrace |
21 | | - static final ErrorCode StsBackTrace = ErrorCode(-1); |
| 18 | + static const StsBackTrace = ErrorCode(-1); |
22 | 19 |
|
23 | 20 | /// @brief unknown /unspecified error CV_StsError |
24 | | - static final ErrorCode StsError = ErrorCode(-2); |
| 21 | + static const StsError = ErrorCode(-2); |
25 | 22 |
|
26 | 23 | /// @brief internal error (bad state) CV_StsInternal |
27 | | - static final ErrorCode StsInternal = ErrorCode(-3); |
| 24 | + static const StsInternal = ErrorCode(-3); |
28 | 25 |
|
29 | 26 | /// @brief insufficient memory CV_StsNoMem |
30 | | - static final ErrorCode StsNoMem = ErrorCode(-4); |
| 27 | + static const StsNoMem = ErrorCode(-4); |
31 | 28 |
|
32 | 29 | /// @brief function arg/param is bad CV_StsBadArg |
33 | | - static final ErrorCode StsBadArg = ErrorCode(-5); |
| 30 | + static const StsBadArg = ErrorCode(-5); |
34 | 31 |
|
35 | 32 | /// @brief unsupported function CV_StsBadFunc |
36 | | - static final ErrorCode StsBadFunc = ErrorCode(-6); |
| 33 | + static const StsBadFunc = ErrorCode(-6); |
37 | 34 |
|
38 | 35 | /// @brief iter. didn't converge CV_StsNoConv |
39 | | - static final ErrorCode StsNoConv = ErrorCode(-7); |
| 36 | + static const StsNoConv = ErrorCode(-7); |
40 | 37 |
|
41 | 38 | /// @brief tracing CV_StsAutoTrace |
42 | | - static final ErrorCode StsAutoTrace = ErrorCode(-8); |
| 39 | + static const StsAutoTrace = ErrorCode(-8); |
43 | 40 |
|
44 | 41 | /// @brief image header is NULL CV_HeaderIsNull |
45 | | - static final ErrorCode HeaderIsNull = ErrorCode(-9); |
| 42 | + static const HeaderIsNull = ErrorCode(-9); |
46 | 43 |
|
47 | 44 | /// @brief image size is invalid CV_BadImageSize |
48 | | - static final ErrorCode BadImageSize = ErrorCode(-10); |
| 45 | + static const BadImageSize = ErrorCode(-10); |
49 | 46 |
|
50 | 47 | /// @brief offset is invalid CV_BadOffset |
51 | | - static final ErrorCode BadOffset = ErrorCode(-11); |
| 48 | + static const BadOffset = ErrorCode(-11); |
52 | 49 |
|
53 | 50 | /// @brief CV_BadOffset |
54 | | - static final ErrorCode BadDataPtr = ErrorCode(-12); |
| 51 | + static const BadDataPtr = ErrorCode(-12); |
55 | 52 |
|
56 | 53 | /// @brief CV_BadStep |
57 | | - static final ErrorCode BadStep = ErrorCode(-13); |
| 54 | + static const BadStep = ErrorCode(-13); |
58 | 55 |
|
59 | 56 | /// @brief CV_BadModelOrChSeq |
60 | | - static final ErrorCode BadModelOrChSeq = ErrorCode(-14); |
| 57 | + static const BadModelOrChSeq = ErrorCode(-14); |
61 | 58 |
|
62 | 59 | /// @brief CV_BadNumChannels |
63 | | - static final ErrorCode BadNumChannels = ErrorCode(-15); |
| 60 | + static const BadNumChannels = ErrorCode(-15); |
64 | 61 |
|
65 | 62 | /// @brief CV_BadNumChannel1U |
66 | | - static final ErrorCode BadNumChannel1U = ErrorCode(-16); |
| 63 | + static const BadNumChannel1U = ErrorCode(-16); |
67 | 64 |
|
68 | 65 | /// @brief CV_BadDepth |
69 | | - static final ErrorCode BadDepth = ErrorCode(-17); |
| 66 | + static const BadDepth = ErrorCode(-17); |
70 | 67 |
|
71 | 68 | /// @brief CV_BadAlphaChannel |
72 | | - static final ErrorCode BadAlphaChannel = ErrorCode(-18); |
| 69 | + static const BadAlphaChannel = ErrorCode(-18); |
73 | 70 |
|
74 | 71 | /// @brief CV_BadOrder |
75 | | - static final ErrorCode BadOrder = ErrorCode(-19); |
| 72 | + static const BadOrder = ErrorCode(-19); |
76 | 73 |
|
77 | 74 | /// @brief CV_BadOrigin |
78 | | - static final ErrorCode BadOrigin = ErrorCode(-20); |
| 75 | + static const BadOrigin = ErrorCode(-20); |
79 | 76 |
|
80 | 77 | /// @brief CV_BadAlign |
81 | | - static final ErrorCode BadAlign = ErrorCode(-21); |
| 78 | + static const BadAlign = ErrorCode(-21); |
82 | 79 |
|
83 | 80 | /// @brief CV_BadCallBack |
84 | | - static final ErrorCode BadCallBack = ErrorCode(-22); |
| 81 | + static const BadCallBack = ErrorCode(-22); |
85 | 82 |
|
86 | 83 | /// @brief CV_BadTileSize |
87 | | - static final ErrorCode BadTileSize = ErrorCode(-23); |
| 84 | + static const BadTileSize = ErrorCode(-23); |
88 | 85 |
|
89 | 86 | /// @brief CV_BadCOI |
90 | | - static final ErrorCode BadCOI = ErrorCode(-24); |
| 87 | + static const BadCOI = ErrorCode(-24); |
91 | 88 |
|
92 | 89 | /// @brief CV_BadROISize |
93 | | - static final ErrorCode BadROISize = ErrorCode(-25); |
| 90 | + static const BadROISize = ErrorCode(-25); |
94 | 91 |
|
95 | 92 | /// @brief CV_MaskIsTiled |
96 | | - static final ErrorCode MaskIsTiled = ErrorCode(-26); |
| 93 | + static const MaskIsTiled = ErrorCode(-26); |
97 | 94 |
|
98 | 95 | /// @brief null pointer CV_StsNullPtr |
99 | | - static final ErrorCode StsNullPtr = ErrorCode(-27); |
| 96 | + static const StsNullPtr = ErrorCode(-27); |
100 | 97 |
|
101 | 98 | /// @brief incorrect vector length CV_StsVecLengthErr |
102 | | - static final ErrorCode StsVecLengthErr = ErrorCode(-28); |
| 99 | + static const StsVecLengthErr = ErrorCode(-28); |
103 | 100 |
|
104 | 101 | /// @brief incorr. filter structure content CV_StsFilterStructContentErr |
105 | | - static final ErrorCode StsFilterStructContentErr = ErrorCode(-29); |
| 102 | + static const StsFilterStructContentErr = ErrorCode(-29); |
106 | 103 |
|
107 | 104 | /// @brief incorr. transform kernel content CV_StsKernelStructContentErr |
108 | | - static final ErrorCode StsKernelStructContentErr = ErrorCode(-30); |
| 105 | + static const StsKernelStructContentErr = ErrorCode(-30); |
109 | 106 |
|
110 | 107 | /// @brief incorrect filter ofset value CV_StsFilterOffsetErr |
111 | | - static final ErrorCode StsFilterOffsetErr = ErrorCode(-31); |
| 108 | + static const StsFilterOffsetErr = ErrorCode(-31); |
112 | 109 |
|
113 | 110 | /*extra for CV */ |
114 | 111 |
|
115 | 112 | /// @brief the input/output structure size is incorrect CV_StsBadSize |
116 | | - static final ErrorCode StsBadSize = ErrorCode(-201); |
| 113 | + static const StsBadSize = ErrorCode(-201); |
117 | 114 |
|
118 | 115 | /// @brief division by zero CV_StsDivByZero |
119 | | - static final ErrorCode StsDivByZero = ErrorCode(-202); |
| 116 | + static const StsDivByZero = ErrorCode(-202); |
120 | 117 |
|
121 | 118 | /// @brief in-place operation is not supported CV_StsInplaceNotSupported |
122 | | - static final ErrorCode StsInplaceNotSupported = ErrorCode(-203); |
| 119 | + static const StsInplaceNotSupported = ErrorCode(-203); |
123 | 120 |
|
124 | 121 | /// @brief request can't be completed CV_StsObjectNotFound |
125 | | - static final ErrorCode StsObjectNotFound = ErrorCode(-204); |
| 122 | + static const StsObjectNotFound = ErrorCode(-204); |
126 | 123 |
|
127 | 124 | /// @brief formats of input/output arrays differ CV_StsUnmatchedFormats |
128 | | - static final ErrorCode StsUnmatchedFormats = ErrorCode(-205); |
| 125 | + static const StsUnmatchedFormats = ErrorCode(-205); |
129 | 126 |
|
130 | 127 | /// @brief flag is wrong or not supported CV_StsBadFlag |
131 | | - static final ErrorCode StsBadFlag = ErrorCode(-206); |
| 128 | + static const StsBadFlag = ErrorCode(-206); |
132 | 129 |
|
133 | 130 | /// @brief bad MyCvPoint CV_StsBadPoint |
134 | | - static final ErrorCode StsBadPoint = ErrorCode(-207); |
| 131 | + static const StsBadPoint = ErrorCode(-207); |
135 | 132 |
|
136 | 133 | /// @brief bad format of mask (neither 8uC1 nor 8sC1) CV_StsBadMask |
137 | | - static final ErrorCode StsBadMask = ErrorCode(-208); |
| 134 | + static const StsBadMask = ErrorCode(-208); |
138 | 135 |
|
139 | 136 | /// @brief sizes of input/output structures do not match CV_StsUnmatchedSizes |
140 | | - static final ErrorCode StsUnmatchedSizes = ErrorCode(-209); |
| 137 | + static const StsUnmatchedSizes = ErrorCode(-209); |
141 | 138 |
|
142 | 139 | /// @brief the data format/type is not supported by the function CV_StsUnsupportedFormat |
143 | | - static final ErrorCode StsUnsupportedFormat = ErrorCode(-210); |
| 140 | + static const StsUnsupportedFormat = ErrorCode(-210); |
144 | 141 |
|
145 | 142 | /// @brief some of parameters are out of range CV_StsOutOfRange |
146 | | - static final ErrorCode StsOutOfRange = ErrorCode(-211); |
| 143 | + static const StsOutOfRange = ErrorCode(-211); |
147 | 144 |
|
148 | 145 | /// @brief invalid syntax/structure of the parsed file CV_StsParseError |
149 | | - static final ErrorCode StsParseError = ErrorCode(-212); |
| 146 | + static const StsParseError = ErrorCode(-212); |
150 | 147 |
|
151 | 148 | /// @brief the requested function/feature is not implemented CV_StsNotImplemented |
152 | | - static final ErrorCode StsNotImplemented = ErrorCode(-213); |
| 149 | + static const StsNotImplemented = ErrorCode(-213); |
153 | 150 |
|
154 | 151 | /// @brief an allocated block has been corrupted CV_StsBadMemBlock |
155 | | - static final ErrorCode StsBadMemBlock = ErrorCode(-214); |
| 152 | + static const StsBadMemBlock = ErrorCode(-214); |
156 | 153 |
|
157 | 154 | /// @brief assertion failed |
158 | | - static final ErrorCode StsAssert = ErrorCode(-215); |
159 | | - |
160 | | - static final ErrorCode GpuNotSupported = ErrorCode(-216); |
161 | | - static final ErrorCode GpuApiCallError = ErrorCode(-217); |
162 | | - static final ErrorCode OpenGlNotSupported = ErrorCode(-218); |
163 | | - static final ErrorCode OpenGlApiCallError = ErrorCode(-219); |
164 | | - static final ErrorCode OpenCLApiCallError = ErrorCode(-220); |
165 | | - static final ErrorCode OpenCLDoubleNotSupported = ErrorCode(-221); |
166 | | - static final ErrorCode OpenCLInitError = ErrorCode(-222); |
167 | | - static final ErrorCode OpenCLNoAMDBlasFft = ErrorCode(-223); |
168 | | - |
169 | | - ErrorCode(this.code); |
170 | | - final int code; |
171 | | - |
172 | | - @override |
173 | | - List<int> get props => [code]; |
174 | | - |
175 | | - @override |
176 | | - String toString() => "$code"; |
| 155 | + static const StsAssert = ErrorCode(-215); |
| 156 | + |
| 157 | + static const GpuNotSupported = ErrorCode(-216); |
| 158 | + static const GpuApiCallError = ErrorCode(-217); |
| 159 | + static const OpenGlNotSupported = ErrorCode(-218); |
| 160 | + static const OpenGlApiCallError = ErrorCode(-219); |
| 161 | + static const OpenCLApiCallError = ErrorCode(-220); |
| 162 | + static const OpenCLDoubleNotSupported = ErrorCode(-221); |
| 163 | + static const OpenCLInitError = ErrorCode(-222); |
| 164 | + static const OpenCLNoAMDBlasFft = ErrorCode(-223); |
177 | 165 | } |
0 commit comments