Move the sources to trunk
[opencv] / interfaces / ipp / opencvipp_funclist.h
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 //  By downloading, copying, installing or using the software you agree to this license.
6 //  If you do not agree to this license, do not download, install,
7 //  copy or use the software.
8 //
9 //
10 //                        Intel License Agreement
11 //                For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
15 //
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
18 //
19 //   * Redistribution's of source code must retain the above copyright notice,
20 //     this list of conditions and the following disclaimer.
21 //
22 //   * Redistribution's in binary form must reproduce the above copyright notice,
23 //     this list of conditions and the following disclaimer in the documentation
24 //     and/or other materials provided with the distribution.
25 //
26 //   * The name of Intel Corporation may not be used to endorse or promote products
27 //     derived from this software without specific prior written permission.
28 //
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
39 //
40 //M*/
41
42 /****************************************************************************************\
43 *                                      Copy/Set                                          *
44 \****************************************************************************************/
45
46 #if IPP < 500 || IPP >= 510
47 IPPAPI( IppStatus, ippiCopy_8u_C1R, ( const uchar* src, int src_step,
48                              uchar* dst, int dst_step, IppiSize size ))
49
50 IPPAPI( IppStatus, ippiSet_8u_C1R, ( uchar value, uchar* dst,
51                                      int dst_step, IppiSize size ))
52
53 #define IPCV_COPYSET( flavor, arrtype, scalartype )                                 \
54 IPPAPI( IppStatus, ippiCopy##flavor, ( const arrtype* src, int srcstep,             \
55                                        arrtype* dst, int dststep, IppiSize size,    \
56                                        const uchar* mask, int maskstep ))           \
57 IPPAPI( IppStatus, ippiSet##flavor, ( arrtype* dst, int dststep,                    \
58                                       const uchar* mask, int maskstep,              \
59                                       IppiSize size, const arrtype* scalar ))
60
61 IPCV_COPYSET( _8u_C1MR, uchar, int )
62 IPCV_COPYSET( _16s_C1MR, ushort, int )
63 IPCV_COPYSET( _8u_C3MR, uchar, int )
64 IPCV_COPYSET( _8u_C4MR, int, int )
65 IPCV_COPYSET( _16s_C3MR, ushort, int )
66 IPCV_COPYSET( _16s_C4MR, int64, int64 )
67 IPCV_COPYSET( _32f_C3MR, int, int )
68 IPCV_COPYSET( _32f_C4MR, int, int )
69
70 #undef IPCV_COPYSET
71
72 /****************************************************************************************\
73 *                                       Arithmetics                                      *
74 \****************************************************************************************/
75
76 #define IPCV_BIN_ARITHM_INT( name, flavor, arrtype )                    \
77 IPPAPI( IppStatus, ippi##name##_##flavor##_C1RSfs,                      \
78 ( const arrtype* src1, int srcstep1, const arrtype* src2, int srcstep2, \
79   arrtype* dst, int dststep, IppiSize size, int scalefactor ))
80
81 IPCV_BIN_ARITHM_INT( Add, 8u, uchar )
82 IPCV_BIN_ARITHM_INT( Add, 16s, short )
83 IPCV_BIN_ARITHM_INT( Sub, 8u, uchar )
84 IPCV_BIN_ARITHM_INT( Sub, 16s, short )
85
86 #if IPP >= 510
87 IPCV_BIN_ARITHM_INT( Add, 16u, ushort )
88 IPCV_BIN_ARITHM_INT( Sub, 16u, ushort )
89 #endif
90
91 #define IPCV_BIN_ARITHM_FLT( name, flavor, arrtype )                    \
92 IPPAPI( IppStatus, ippi##name##_##flavor##_C1R,                         \
93 ( const arrtype* src1, int srcstep1, const arrtype* src2, int srcstep2, \
94   arrtype* dst, int dststep, IppiSize size ))
95
96 IPCV_BIN_ARITHM_FLT( Add, 32f, float )
97 IPCV_BIN_ARITHM_FLT( Sub, 32f, float )
98
99 #undef IPCV_BIN_ARITHM_INT
100 #undef IPCV_BIN_ARITHM_FLT
101
102 #endif
103
104 /****************************************************************************************\
105 *                                     Logical operations                                 *
106 \****************************************************************************************/
107
108 #define IPCV_LOGIC( name )                                          \
109 IPPAPI( IppStatus, ippi##name##_8u_C1R,                             \
110 ( const uchar* src1, int srcstep1, const uchar* src2, int srcstep2, \
111   uchar* dst, int dststep, IppiSize size ))
112
113 IPCV_LOGIC( And )
114 IPCV_LOGIC( Or )
115 IPCV_LOGIC( Xor )
116
117 #undef IPCV_LOGIC
118
119 IPPAPI( IppStatus, ippiNot_8u_C1R,
120 ( const uchar* src, int step1, uchar* dst, int step, IppiSize size ))
121
122 /****************************************************************************************\
123 *                                Image Statistics                                        *
124 \****************************************************************************************/
125
126 ///////////////////////////////////////// Mean //////////////////////////////////////////
127
128 #define IPCV_DEF_MEAN_MASK( flavor, srctype )           \
129 IPPAPI( IppStatus, ippiMean_##flavor##_C1MR,            \
130 ( const srctype* img, int imgstep, const uchar* mask,   \
131   int maskStep, IppiSize size, double* mean ))
132
133 IPCV_DEF_MEAN_MASK( 8u, uchar )
134 IPCV_DEF_MEAN_MASK( 16u, ushort )
135 IPCV_DEF_MEAN_MASK( 32f, float )
136
137 #undef IPCV_DEF_MEAN_MASK
138
139 //////////////////////////////////// Mean_StdDev ////////////////////////////////////////
140
141 #define IPCV_DEF_MEAN_SDV( flavor, srctype )                                \
142 IPPAPI( IppStatus, ippiMean_StdDev_##flavor##_C1R,                          \
143 ( const srctype* img, int imgstep, IppiSize size,                           \
144   double* mean, double* sdv ))                                              \
145 IPPAPI( IppStatus, ippiMean_StdDev_##flavor##_C1MR,                         \
146 ( const srctype* img, int imgstep,                                          \
147   const uchar* mask, int maskStep,                                          \
148   IppiSize size, double* mean, double* sdv ))
149
150 IPCV_DEF_MEAN_SDV( 8u, uchar )
151 IPCV_DEF_MEAN_SDV( 16u, ushort )
152 IPCV_DEF_MEAN_SDV( 32f, float )
153
154 #undef IPCV_DEF_MEAN_SDV
155
156 //////////////////////////////////// MinMaxIndx /////////////////////////////////////////
157
158 #define IPCV_DEF_MIN_MAX_LOC( flavor, srctype, extrtype )       \
159 IPPAPI( IppStatus, ippiMinMaxIndx_##flavor##_C1R,                \
160 ( const srctype* img, int imgstep,                              \
161   IppiSize size, extrtype* minVal, extrtype* maxVal,            \
162   IppiPoint* minLoc, IppiPoint* maxLoc ))                       \
163                                                                 \
164 IPPAPI( IppStatus, ippiMinMaxIndx_##flavor##_C1MR,               \
165 ( const srctype* img, int imgstep,                              \
166   const uchar* mask, int maskStep,                              \
167   IppiSize size, extrtype* minVal, extrtype* maxVal,            \
168   IppiPoint* minLoc, IppiPoint* maxLoc ))
169
170 IPCV_DEF_MIN_MAX_LOC( 8u, uchar, float )
171 IPCV_DEF_MIN_MAX_LOC( 16u, ushort, float )
172 IPCV_DEF_MIN_MAX_LOC( 32f, float, float )
173
174 #undef IPCV_MIN_MAX_LOC
175
176 ////////////////////////////////////////// Sum //////////////////////////////////////////
177
178 #define IPCV_DEF_SUM_NOHINT( flavor, srctype )                              \
179 IPPAPI( IppStatus, ippiSum_##flavor##_C1R,( const srctype* img, int imgstep,\
180                                            IppiSize size, double* sum ))    \
181 IPPAPI( IppStatus, ippiSum_##flavor##_C3R,( const srctype* img, int imgstep,\
182                                            IppiSize size, double* sum ))    \
183 IPPAPI( IppStatus, ippiSum_##flavor##_C4R,( const srctype* img, int imgstep,\
184                                            IppiSize size, double* sum ))    \
185
186 #define IPCV_DEF_SUM_HINT( flavor, srctype )                                \
187 IPPAPI( IppStatus, ippiSum_##flavor##_C1R,                                  \
188                         ( const srctype* img, int imgstep,                  \
189                           IppiSize size, double* sum, IppHintAlgorithm hint ))   \
190 IPPAPI( IppStatus, ippiSum_##flavor##_C3R,                                  \
191                         ( const srctype* img, int imgstep,                  \
192                           IppiSize size, double* sum, IppHintAlgorithm hint ))   \
193 IPPAPI( IppStatus, ippiSum_##flavor##_C4R,                                  \
194                         ( const srctype* img, int imgstep,                  \
195                           IppiSize size, double* sum, IppHintAlgorithm hint ))
196
197 IPCV_DEF_SUM_NOHINT( 8u, uchar )
198 IPCV_DEF_SUM_NOHINT( 16s, short )
199 IPCV_DEF_SUM_HINT( 32f, float )
200
201 #undef IPCV_DEF_SUM_NOHINT
202 #undef IPCV_DEF_SUM_HINT
203
204 ////////////////////////////////////////// Norms /////////////////////////////////
205
206 #define IPCV_DEF_NORM_NOHINT_C1( flavor, srctype )                                      \
207 IPPAPI( IppStatus, ippiNorm_Inf_##flavor##_C1R, ( const srctype* img, int imgstep,      \
208                                                   IppiSize size, double* norm ))        \
209 IPPAPI( IppStatus, ippiNorm_L1_##flavor##_C1R,                                          \
210                                              ( const srctype* img, int imgstep,         \
211                                                IppiSize size, double* norm ))           \
212 IPPAPI( IppStatus, ippiNormDiff_Inf_##flavor##_C1R,                                     \
213                                              ( const srctype* img1, int imgstep1,       \
214                                                const srctype* img2, int imgstep2,       \
215                                                IppiSize size, double* norm ))           \
216 IPPAPI( IppStatus, ippiNormDiff_L1_##flavor##_C1R,                                      \
217                                              ( const srctype* img1, int imgstep1,       \
218                                                const srctype* img2, int imgstep2,       \
219                                                IppiSize size, double* norm ))           \
220 IPPAPI( IppStatus, ippiNormDiff_L2_##flavor##_C1R,                                      \
221                                              ( const srctype* img1, int imgstep1,       \
222                                                const srctype* img2, int imgstep2,       \
223                                                IppiSize size, double* norm ))
224
225 #define IPCV_DEF_NORM_HINT_C1( flavor, srctype )                                        \
226 IPPAPI( IppStatus, ippiNorm_Inf_##flavor##_C1R, ( const srctype* img, int imgstep,      \
227                                                   IppiSize size, double* norm ))        \
228 IPPAPI( IppStatus, ippiNorm_L1_##flavor##_C1R, ( const srctype* img, int imgstep,       \
229                                 IppiSize size, double* norm, IppHintAlgorithm hint ))        \
230 IPPAPI( IppStatus, ippiNorm_L2_##flavor##_C1R, ( const srctype* img, int imgstep,       \
231                                 IppiSize size, double* norm, IppHintAlgorithm hint ))        \
232 IPPAPI( IppStatus, ippiNormDiff_Inf_##flavor##_C1R, ( const srctype* img1, int imgstep1,\
233                                                       const srctype* img2, int imgstep2,\
234                                                       IppiSize size, double* norm ))    \
235 IPPAPI( IppStatus, ippiNormDiff_L1_##flavor##_C1R, ( const srctype* img1, int imgstep1, \
236                                                      const srctype* img2, int imgstep2, \
237                                 IppiSize size, double* norm, IppHintAlgorithm hint ))         \
238 IPPAPI( IppStatus, ippiNormDiff_L2_##flavor##_C1R, ( const srctype* img1, int imgstep1, \
239                                                      const srctype* img2, int imgstep2, \
240                                 IppiSize size, double* norm, IppHintAlgorithm hint ))
241
242 #define IPCV_DEF_NORM_MASK_C1( flavor, srctype )                                        \
243 IPPAPI( IppStatus, ippiNorm_Inf_##flavor##_C1MR, ( const srctype* img, int imgstep,     \
244                                                    const uchar* mask, int maskstep,     \
245                                                    IppiSize size, double* norm ))       \
246 IPPAPI( IppStatus, ippiNorm_L1_##flavor##_C1MR, ( const srctype* img, int imgstep,      \
247                                                   const uchar* mask, int maskstep,      \
248                                                   IppiSize size, double* norm ))        \
249 IPPAPI( IppStatus, ippiNorm_L2_##flavor##_C1MR, ( const srctype* img, int imgstep,      \
250                                                   const uchar* mask, int maskstep,      \
251                                                   IppiSize size, double* norm ))        \
252 IPPAPI( IppStatus, ippiNormDiff_Inf_##flavor##_C1MR,( const srctype* img1, int imgstep1,\
253                                                       const srctype* img2, int imgstep2,\
254                                                       const uchar* mask, int maskstep,  \
255                                                       IppiSize size, double* norm ))    \
256 IPPAPI( IppStatus, ippiNormDiff_L1_##flavor##_C1MR,( const srctype* img1, int imgstep1, \
257                                                      const srctype* img2, int imgstep2, \
258                                                      const uchar* mask, int maskstep,   \
259                                                      IppiSize size, double* norm ))     \
260 IPPAPI( IppStatus, ippiNormDiff_L2_##flavor##_C1MR,( const srctype* img1, int imgstep1, \
261                                                      const srctype* img2, int imgstep2, \
262                                                      const uchar* mask, int maskstep,   \
263                                                      IppiSize size, double* norm ))
264
265 IPCV_DEF_NORM_NOHINT_C1( 8u, uchar )
266 IPCV_DEF_NORM_MASK_C1( 8u, uchar )
267
268 IPCV_DEF_NORM_MASK_C1( 16u, ushort )
269
270 /*IPCV_DEF_NORM_NOHINT_C1( 16s, short ) // these functions contain are buggy in IPP 4.1 */
271
272 IPCV_DEF_NORM_HINT_C1( 32f, float )
273 IPCV_DEF_NORM_MASK_C1( 32f, float )
274
275 #undef IPCV_DEF_NORM_HONINT_C1
276 #undef IPCV_DEF_NORM_HINT_C1
277 #undef IPCV_DEF_NORM_MASK_C1
278
279 ////////////////////////////////////// AbsDiff ///////////////////////////////////////////
280
281 #define IPCV_ABS_DIFF( flavor, arrtype )                    \
282 IPPAPI( IppStatus, ippiAbsDiff_##flavor##_C1R,              \
283 ( const arrtype* src1, int srcstep1,                        \
284   const arrtype* src2, int srcstep2,                        \
285   arrtype* dst, int dststep, IppiSize size ))
286
287 IPCV_ABS_DIFF( 8u, uchar )
288 IPCV_ABS_DIFF( 16u, ushort )
289 IPCV_ABS_DIFF( 32f, float )
290
291 #undef IPCV_ABS_DIFF
292
293 ////////////////////////////// Comparisons //////////////////////////////////////////
294
295 #define IPCV_CMP( arrtype, flavor )                                                 \
296 IPPAPI( IppStatus, ippiCompare_##flavor##_C1R,                                      \
297             ( const arrtype* src1, int srcstep1, const arrtype* src2, int srcstep2, \
298               arrtype* dst, int dststep, IppiSize size, int cmp_op ))               \
299 IPPAPI( IppStatus, ippiCompareC_##flavor##_C1R,                                     \
300             ( const arrtype* src1, int srcstep1, arrtype scalar,                    \
301               arrtype* dst, int dststep, IppiSize size, int cmp_op ))               \
302 IPPAPI( IppStatus, ippiThreshold_GT_##flavor##_C1R,                                 \
303             ( const arrtype* pSrc, int srcstep, arrtype* pDst, int dststep,         \
304               IppiSize size, arrtype threshold ))                                   \
305 IPPAPI( IppStatus, ippiThreshold_LT_##flavor##_C1R,                                 \
306             ( const arrtype* pSrc, int srcstep, arrtype* pDst, int dststep,         \
307               IppiSize size, arrtype threshold ))
308 IPCV_CMP( uchar, 8u )
309 IPCV_CMP( short, 16s )
310 IPCV_CMP( float, 32f )
311 #undef IPCV_CMP
312
313 /****************************************************************************************\
314 *                                       Utilities                                        *
315 \****************************************************************************************/
316
317 ////////////////////////////// Copy Pixel <-> Plane /////////////////////////////////
318
319 #define IPCV_PIX_PLANE( flavor, arrtype )                                           \
320 IPPAPI( IppStatus, ippiCopy_##flavor##_C3P3R,                                        \
321     ( const arrtype* src, int srcstep, arrtype** dst, int dststep, IppiSize size )) \
322 IPPAPI( IppStatus, ippiCopy_##flavor##_C4P4R,                                        \
323     ( const arrtype* src, int srcstep, arrtype** dst, int dststep, IppiSize size )) \
324 IPPAPI( IppStatus, ippiCopy_##flavor##_P3C3R,                                        \
325     ( const arrtype** src, int srcstep, arrtype* dst, int dststep, IppiSize size )) \
326 IPPAPI( IppStatus, ippiCopy_##flavor##_P4C4R,                                        \
327     ( const arrtype** src, int srcstep, arrtype* dst, int dststep, IppiSize size ))
328
329 IPCV_PIX_PLANE( 8u, uchar )
330 IPCV_PIX_PLANE( 16s, ushort )
331 IPCV_PIX_PLANE( 32f, int )
332
333 #undef IPCV_PIX_PLANE
334
335 /****************************************************************************************/
336 /*                            Math routines and RNGs                                    */
337 /****************************************************************************************/
338
339 #if IPP > 400 && IPP < 510
340
341 IPPAPI( IppStatus, ippsSqrt_32f, ( const float* src, float* dst, int len ))
342 IPPAPI( IppStatus, ippsSqrt_64f, ( const double* src, double* dst, int len ))
343
344 IPPAPI( IppStatus, ippsLn_32f, ( const float *x, float *y, int n ) )
345 IPPAPI( IppStatus, ippsLn_64f, ( const double *x, double *y, int n ) )
346 IPPAPI( IppStatus, ippsExp_32f, ( const float *x, float *y, int n ) )
347 IPPAPI( IppStatus, ippsExp_64f, ( const double *x, double *y, int n ) )
348
349 #else
350
351 IPPAPI( IppStatus, ippsInvSqrt_32f_A21, ( const float* src, float* dst, int len ))
352 IPPAPI( IppStatus, ippsSqrt_32f_A21, ( const float* src, float* dst, int len ))
353 IPPAPI( IppStatus, ippsInvSqrt_64f_A50, ( const double* src, double* dst, int len ))
354 IPPAPI( IppStatus, ippsSqrt_64f_A50, ( const double* src, double* dst, int len ))
355
356 IPPAPI( IppStatus, ippsLn_32f_A21, ( const float *x, float *y, int n ) )
357 IPPAPI( IppStatus, ippsLn_64f_A50, ( const double *x, double *y, int n ) )
358 IPPAPI( IppStatus, ippsExp_32f_A21, ( const float *x, float *y, int n ) )
359 IPPAPI( IppStatus, ippsExp_64f_A50, ( const double *x, double *y, int n ) )
360
361 #endif
362
363 IPPAPI( IppStatus, ippibFastArctan_32f, ( const float* y, const float* x, float* angle, int len ))
364
365 /****************************************************************************************/
366 /*                    Affine transformations of matrix/image elements                   */
367 /****************************************************************************************/
368
369 #define IPCV_TRANSFORM( suffix, cn )                            \
370 IPPAPI( IppStatus, ippiColorTwist##suffix##_C##cn##R,           \
371         ( const void* src, int srcstep, void* dst, int dststep, \
372           IppiSize roisize, const float* twist_matrix ))
373
374 IPCV_TRANSFORM( 32f_8u, 3 )
375 IPCV_TRANSFORM( 32f_16u, 3 )
376 IPCV_TRANSFORM( 32f_16s, 3 )
377 IPCV_TRANSFORM( _32f, 3 )
378 IPCV_TRANSFORM( _32f, 4 )
379
380 #undef IPCV_TRANSFORM
381
382 #define IPCV_TRANSFORM_N1( suffix )                             \
383 IPPAPI( IppStatus, ippiColorToGray##suffix,                     \
384         ( const void* src, int srcstep, void* dst, int dststep, \
385           IppiSize roisize, const float* coeffs ))
386
387 IPCV_TRANSFORM_N1( _8u_C3C1R )
388 IPCV_TRANSFORM_N1( _16u_C3C1R )
389 IPCV_TRANSFORM_N1( _16s_C3C1R )
390 IPCV_TRANSFORM_N1( _32f_C3C1R )
391 IPCV_TRANSFORM_N1( _8u_AC4C1R )
392 IPCV_TRANSFORM_N1( _16u_AC4C1R )
393 IPCV_TRANSFORM_N1( _16s_AC4C1R )
394 IPCV_TRANSFORM_N1( _32f_AC4C1R )
395
396 #undef IPCV_TRANSFORM_N1
397
398 /****************************************************************************************/
399 /*                  Matrix routines from BLAS/LAPACK compatible libraries               */
400 /****************************************************************************************/
401
402 #define IPCV_DFT( init_flavor, fwd_flavor, inv_flavor )                                 \
403 IPPAPI( IppStatus, ippsDFTInitAlloc_##init_flavor, ( void** state, int len, int flag,   \
404                                                      IppHintAlgorithm hint ))           \
405 IPPAPI( IppStatus, ippsDFTFree_##init_flavor, ( void* state ))                          \
406 IPPAPI( IppStatus, ippsDFTGetBufSize_##init_flavor, ( const void* spec, int* buf_size ))\
407 IPPAPI( IppStatus, ippsDFTFwd_##fwd_flavor, ( const void* src, void* dst,               \
408                                               const void* spec, void* buffer ))         \
409 IPPAPI( IppStatus, ippsDFTInv_##inv_flavor, ( const void* src, void* dst,               \
410                                               const void* spec, void* buffer ))
411
412 IPCV_DFT( C_32fc, CToC_32fc, CToC_32fc )
413 IPCV_DFT( R_32f, RToPack_32f, PackToR_32f )
414 IPCV_DFT( C_64fc, CToC_64fc, CToC_64fc )
415 IPCV_DFT( R_64f, RToPack_64f, PackToR_64f )
416 #undef IPCV_DFT
417
418 /****************************************************************************************\
419 *                                  Creating Borders                                      *
420 \****************************************************************************************/
421
422 #define IPCV_COPY_BORDER( bordertype, flavor, arrtype )                         \
423 IPPAPI( IppStatus, ippiCopy##bordertype##Border_##flavor,                       \
424             ( const arrtype* pSrc,  int srcStep, IppiSize srcRoiSize,           \
425                     arrtype* pDst,  int dstStep, IppiSize dstRoiSize,           \
426                     int topBorderWidth, int leftBorderWidth ))
427
428 IPCV_COPY_BORDER( Replicate, 8u_C1R, uchar )
429 IPCV_COPY_BORDER( Replicate, 16s_C1R, ushort )
430 IPCV_COPY_BORDER( Replicate, 8u_C3R, uchar )
431 IPCV_COPY_BORDER( Replicate, 32s_C1R, int )
432 IPCV_COPY_BORDER( Replicate, 16s_C3R, ushort )
433 IPCV_COPY_BORDER( Replicate, 16s_C4R, int )
434 IPCV_COPY_BORDER( Replicate, 32s_C3R, int )
435 IPCV_COPY_BORDER( Replicate, 32s_C4R, int )
436
437 #undef IPCV_COPY_BORDER
438
439 #define IPCV_COPY_CONST_BORDER_C1( flavor, arrtype )                            \
440 IPPAPI( IppStatus, ippiCopyConstBorder_##flavor,                                \
441             ( const arrtype* pSrc,  int srcStep, IppiSize srcRoiSize,           \
442                     arrtype* pDst,  int dstStep, IppiSize dstRoiSize,           \
443                     int topBorderWidth, int leftBorderWidth, arrtype value ))
444
445 IPCV_COPY_CONST_BORDER_C1( 8u_C1R, uchar )
446 IPCV_COPY_CONST_BORDER_C1( 16s_C1R, ushort )
447 IPCV_COPY_CONST_BORDER_C1( 32s_C1R, int )
448
449 #undef IPCV_COPY_CONST_BORDER_C1
450
451 #define IPCV_COPY_CONST_BORDER_CN( flavor, arrtype )                            \
452 IPPAPI( IppStatus, ippiCopyConstBorder_##flavor,                                \
453             ( const arrtype* pSrc,  int srcStep, IppiSize srcRoiSize,           \
454                     arrtype* pDst,  int dstStep, IppiSize dstRoiSize,           \
455                     int topBorderWidth, int leftBorderWidth, const arrtype* value ))
456
457 IPCV_COPY_CONST_BORDER_CN( 8u_C3R, uchar )
458 IPCV_COPY_CONST_BORDER_CN( 16s_C3R, ushort )
459 IPCV_COPY_CONST_BORDER_CN( 16s_C4R, int )
460 IPCV_COPY_CONST_BORDER_CN( 32s_C3R, int )
461 IPCV_COPY_CONST_BORDER_CN( 32s_C4R, int )
462
463 #undef IPCV_COPY_CONST_BORDER_CN
464
465 /****************************************************************************************\
466 *                                        Moments                                         *
467 \****************************************************************************************/
468
469 #define IPCV_MOMENTS( suffix, cn )                      \
470 IPPAPI( IppStatus, ippiMoments##suffix##_C##cn##R,      \
471 ( const void* img, int step, IppiSize size, void* momentstate ))
472
473 IPCV_MOMENTS( 64f_8u, 1 )
474 IPCV_MOMENTS( 64f_32f, 1 )
475
476 #undef IPCV_MOMENTS
477
478 IPPAPI( IppStatus, ippiMomentInitAlloc_64f, (void** momentstate, IppHintAlgorithm hint ))
479 IPPAPI( IppStatus, ippiMomentFree_64f, (void* momentstate ))
480 IPPAPI( IppStatus, ippiGetSpatialMoment_64f, (const void* momentstate, int mOrd, int nOrd,
481                                               int nChannel, IppiPoint roiOffset, double* value ))
482
483 /****************************************************************************************\
484 *                                  Background differencing                               *
485 \****************************************************************************************/
486
487 /////////////////////////////////// Accumulation /////////////////////////////////////////
488
489 #define IPCV_ACCUM( flavor, arrtype, acctype )                                      \
490 IPPAPI( IppStatus, ippiAddSquare_##flavor##_C1IR,                                   \
491     ( const arrtype* src, int srcstep, acctype* dst, int dststep, IppiSize size ))  \
492 IPPAPI( IppStatus, ippiAddProduct_##flavor##_C1IR,                                  \
493     ( const arrtype* src1, int srcstep1, const arrtype* src2, int srcstep2,         \
494       acctype* dst, int dststep, IppiSize size ))                                   \
495 IPPAPI( IppStatus, ippiAddWeighted_##flavor##_C1IR,                                 \
496     ( const arrtype* src, int srcstep, acctype* dst, int dststep,                   \
497       IppiSize size, acctype alpha ))                                               \
498                                                                                     \
499 IPPAPI( IppStatus, ippiAdd_##flavor##_C1IMR,                                        \
500     ( const arrtype* src, int srcstep, const uchar* mask, int maskstep,             \
501       acctype* dst, int dststep, IppiSize size ))                                   \
502 IPPAPI( IppStatus, ippiAddSquare_##flavor##_C1IMR,                                  \
503     ( const arrtype* src, int srcstep, const uchar* mask, int maskstep,             \
504       acctype* dst, int dststep, IppiSize size ))                                   \
505 IPPAPI( IppStatus, ippiAddProduct_##flavor##_C1IMR,                                 \
506     ( const arrtype* src1, int srcstep1, const arrtype* src2, int srcstep2,         \
507       const uchar* mask, int maskstep, acctype* dst, int dststep, IppiSize size ))  \
508 IPPAPI( IppStatus, ippiAddWeighted_##flavor##_C1IMR,                                \
509     ( const arrtype* src, int srcstep, const uchar* mask, int maskstep,             \
510       acctype* dst, int dststep, IppiSize size, acctype alpha ))
511
512 IPPAPI( IppStatus, ippiAdd_8u32f_C1IR,
513     ( const uchar* src, int srcstep, float* dst, int dststep, IppiSize size ))
514
515 IPCV_ACCUM( 8u32f, uchar, float )
516 IPCV_ACCUM( 32f, float, float )
517
518 #undef IPCV_ACCUM
519
520 /****************************************************************************************\
521 *                                       Pyramids                                         *
522 \****************************************************************************************/
523
524 IPPAPI( IppStatus, ippiPyrDownGetBufSize_Gauss5x5,
525             ( int roiWidth, IppDataType dataType, int channels, int* bufSize ))
526
527 IPPAPI( IppStatus, ippiPyrUpGetBufSize_Gauss5x5,
528             ( int roiWidth, IppDataType dataType, int channels, int* bufSize ))
529
530 #define ICV_PYRDOWN( flavor, cn )                                           \
531 IPPAPI( IppStatus, ippiPyrDown_Gauss5x5_##flavor##_C##cn##R,                \
532 ( const void* pSrc, int srcStep, void* pDst, int dstStep,                   \
533   IppiSize roiSize, void* pBuffer ))
534
535 #define ICV_PYRUP( flavor, cn )                                             \
536 IPPAPI( IppStatus, ippiPyrUp_Gauss5x5_##flavor##_C##cn##R,                  \
537 ( const void* pSrc, int srcStep, void* pDst, int dstStep,                   \
538   IppiSize roiSize, void* pBuffer ))
539
540 ICV_PYRDOWN( 8u, 1 )
541 ICV_PYRDOWN( 8u, 3 )
542 ICV_PYRDOWN( 32f, 1 )
543 ICV_PYRDOWN( 32f, 3 )
544
545 ICV_PYRUP( 8u, 1 )
546 ICV_PYRUP( 8u, 3 )
547 ICV_PYRUP( 32f, 1 )
548 ICV_PYRUP( 32f, 3 )
549
550 #undef ICV_PYRDOWN
551 #undef ICV_PYRUP
552
553 /****************************************************************************************\
554 *                                Geometric Transformations                               *
555 \****************************************************************************************/
556
557 #define IPCV_RESIZE( flavor, cn )                                           \
558 IPPAPI( IppStatus, ippiResize_##flavor##_C##cn##R,                          \
559            (const void* src, IppiSize srcsize, int srcstep, IppiRect srcroi,  \
560             void* dst, int dststep, IppiSize dstroi,                        \
561             double xfactor, double yfactor, int interpolation ))
562
563 IPCV_RESIZE( 8u, 1 )
564 IPCV_RESIZE( 8u, 3 )
565 IPCV_RESIZE( 8u, 4 )
566
567 IPCV_RESIZE( 16u, 1 )
568 IPCV_RESIZE( 16u, 3 )
569 IPCV_RESIZE( 16u, 4 )
570
571 IPCV_RESIZE( 32f, 1 )
572 IPCV_RESIZE( 32f, 3 )
573 IPCV_RESIZE( 32f, 4 )
574
575 #undef IPCV_RESIZE
576
577 #define IPCV_WARPAFFINE_BACK( flavor, cn )                                  \
578 IPPAPI( IppStatus, ippiWarpAffineBack_##flavor##_C##cn##R,                  \
579     (const void* src, IppiSize srcsize, int srcstep, IppiRect srcroi,       \
580     void* dst, int dststep, IppiRect dstroi,                                \
581     const double* coeffs, int interpolate ))
582
583 IPCV_WARPAFFINE_BACK( 8u, 1 )
584 IPCV_WARPAFFINE_BACK( 8u, 3 )
585 IPCV_WARPAFFINE_BACK( 8u, 4 )
586
587 IPCV_WARPAFFINE_BACK( 32f, 1 )
588 IPCV_WARPAFFINE_BACK( 32f, 3 )
589 IPCV_WARPAFFINE_BACK( 32f, 4 )
590
591 #undef IPCV_WARPAFFINE_BACK
592
593 #define IPCV_WARPPERSPECTIVE_BACK( flavor, cn )                             \
594 IPPAPI( IppStatus, ippiWarpPerspectiveBack_##flavor##_C##cn##R,             \
595     (const void* src, IppiSize srcsize, int srcstep, IppiRect srcroi,       \
596     void* dst, int dststep, IppiRect dstroi,                                \
597     const double* coeffs, int interpolate ))
598
599 IPCV_WARPPERSPECTIVE_BACK( 8u, 1 )
600 IPCV_WARPPERSPECTIVE_BACK( 8u, 3 )
601 IPCV_WARPPERSPECTIVE_BACK( 8u, 4 )
602
603 IPCV_WARPPERSPECTIVE_BACK( 32f, 1 )
604 IPCV_WARPPERSPECTIVE_BACK( 32f, 3 )
605 IPCV_WARPPERSPECTIVE_BACK( 32f, 4 )
606
607 #undef IPCV_WARPPERSPECTIVE_BACK
608
609 #define IPCV_WARPPERSPECTIVE( flavor, cn )                              \
610 IPPAPI( IppStatus, ippiWarpPerspective_##flavor##_C##cn##R,             \
611     (const void* src, IppiSize srcsize, int srcstep, IppiRect srcroi,   \
612     void* dst, int dststep, IppiRect dstroi,                            \
613     const double* coeffs, int interpolate ))
614
615 IPCV_WARPPERSPECTIVE( 8u, 1 )
616 IPCV_WARPPERSPECTIVE( 8u, 3 )
617 IPCV_WARPPERSPECTIVE( 8u, 4 )
618
619 IPCV_WARPPERSPECTIVE( 32f, 1 )
620 IPCV_WARPPERSPECTIVE( 32f, 3 )
621 IPCV_WARPPERSPECTIVE( 32f, 4 )
622
623 #undef IPCV_WARPPERSPECTIVE
624
625 #define IPCV_REMAP( flavor, cn )                                        \
626 IPPAPI( IppStatus, ippiRemap_##flavor##_C##cn##R,                       \
627     ( const void* src, IppiSize srcsize, int srcstep, IppiRect srcroi,  \
628       const float* xmap, int xmapstep, const float* ymap, int ymapstep, \
629       void* dst, int dststep, IppiSize dstsize, int interpolation )) 
630
631 IPCV_REMAP( 8u, 1 )
632 IPCV_REMAP( 8u, 3 )
633 IPCV_REMAP( 8u, 4 )
634
635 IPCV_REMAP( 32f, 1 )
636 IPCV_REMAP( 32f, 3 )
637 IPCV_REMAP( 32f, 4 )
638
639 #undef IPCV_REMAP
640
641 /****************************************************************************************\
642 *                                      Morphology                                        *
643 \****************************************************************************************/
644
645 #if IPP >= 510
646
647 #define IPCV_MORPHOLOGY( minmaxtype, morphtype, flavor, cn )                    \
648 IPPAPI( IppStatus, ippiFilter##minmaxtype##BorderReplicate_##flavor##_C##cn##R, \
649     ( const void* src, int srcstep, void* dst, int dststep, IppiSize roi,       \
650     IppiSize esize, IppiPoint anchor, void* buffer ))                           \
651 IPPAPI( IppStatus, ippiFilter##minmaxtype##GetBufferSize_##flavor##_C##cn##R,   \
652     ( int width, IppiSize esize, int* bufsize ))                                \
653 IPPAPI( IppStatus, ippi##morphtype##BorderReplicate_##flavor##_C##cn##R,        \
654     ( const void* src, int srcstep, void* dst, int dststep,                     \
655     IppiSize roi, int bordertype, void* morphstate ))
656
657 IPCV_MORPHOLOGY( Min, Erode, 8u, 1 )
658 IPCV_MORPHOLOGY( Min, Erode, 8u, 3 )
659 IPCV_MORPHOLOGY( Min, Erode, 8u, 4 )
660 IPCV_MORPHOLOGY( Min, Erode, 32f, 1 )
661 IPCV_MORPHOLOGY( Min, Erode, 32f, 3 )
662 IPCV_MORPHOLOGY( Min, Erode, 32f, 4 )
663 IPCV_MORPHOLOGY( Max, Dilate, 8u, 1 )
664 IPCV_MORPHOLOGY( Max, Dilate, 8u, 3 )
665 IPCV_MORPHOLOGY( Max, Dilate, 8u, 4 )
666 IPCV_MORPHOLOGY( Max, Dilate, 32f, 1 )
667 IPCV_MORPHOLOGY( Max, Dilate, 32f, 3 )
668 IPCV_MORPHOLOGY( Max, Dilate, 32f, 4 )
669
670 #undef IPCV_MORPHOLOGY
671
672 #define IPCV_MORPHOLOGY_INIT_ALLOC( flavor, cn )                        \
673 IPPAPI( IppStatus, ippiMorphologyInitAlloc_##flavor##_C##cn##R,         \
674     ( int width, const uchar* element, IppiSize esize,                  \
675     IppiPoint anchor, void** morphstate ))
676
677 IPCV_MORPHOLOGY_INIT_ALLOC( 8u, 1 )
678 IPCV_MORPHOLOGY_INIT_ALLOC( 8u, 3 )
679 IPCV_MORPHOLOGY_INIT_ALLOC( 8u, 4 )
680 IPCV_MORPHOLOGY_INIT_ALLOC( 32f, 1 )
681 IPCV_MORPHOLOGY_INIT_ALLOC( 32f, 3 )
682 IPCV_MORPHOLOGY_INIT_ALLOC( 32f, 4 )
683
684 #undef IPCV_MORPHOLOGY_INIT_ALLOC
685
686 IPPAPI( IppStatus, ippiMorphologyFree, ( void* morphstate ))
687
688 #else
689
690 #define IPCV_MINMAX( minmaxtype, flavor, cn )                           \
691 IPPAPI( IppStatus, ippiFilter##minmaxtype##_##flavor##_C##cn##R,        \
692             ( const void* src, int srcstep, void* dst, int dststep,     \
693               IppiSize roi, IppiSize esize, IppiPoint anchor ))
694
695 IPCV_MINMAX( Min, 8u, 1 )
696 IPCV_MINMAX( Min, 8u, 3 )
697 IPCV_MINMAX( Min, 8u, 4 )
698 IPCV_MINMAX( Min, 32f, 1 )
699 IPCV_MINMAX( Min, 32f, 3 )
700 IPCV_MINMAX( Min, 32f, 4 )
701 IPCV_MINMAX( Max, 8u, 1 )
702 IPCV_MINMAX( Max, 8u, 3 )
703 IPCV_MINMAX( Max, 8u, 4 )
704 IPCV_MINMAX( Max, 32f, 1 )
705 IPCV_MINMAX( Max, 32f, 3 )
706 IPCV_MINMAX( Max, 32f, 4 )
707
708 #undef IPCV_MINMAX
709
710 #if IPP < 500
711
712 #define IPCV_MORPHOLOGY( morphtype, flavor, cn )                        \
713 IPPAPI( IppStatus, ippi##morphtype##_##flavor##_C##cn##R,               \
714             ( const void* src, int srcstep, void* dst, int dststep,     \
715               IppiSize roi, const uchar* element,                       \
716               IppiSize esize, IppiPoint anchor ))
717
718 IPCV_MORPHOLOGY( Erode, 8u, 1 )
719 IPCV_MORPHOLOGY( Erode, 8u, 3 )
720 IPCV_MORPHOLOGY( Erode, 8u, 4 )
721 IPCV_MORPHOLOGY( Erode, 32f, 1 )
722 IPCV_MORPHOLOGY( Erode, 32f, 3 )
723 IPCV_MORPHOLOGY( Erode, 32f, 4 )
724 IPCV_MORPHOLOGY( Dilate, 8u, 1 )
725 IPCV_MORPHOLOGY( Dilate, 8u, 3 )
726 IPCV_MORPHOLOGY( Dilate, 8u, 4 )
727 IPCV_MORPHOLOGY( Dilate, 32f, 1 )
728 IPCV_MORPHOLOGY( Dilate, 32f, 3 )
729 IPCV_MORPHOLOGY( Dilate, 32f, 4 )
730
731 #undef IPCV_MORPHOLOGY
732
733 #endif
734 #endif
735
736 /****************************************************************************************\
737 *                                 Smoothing Filters                                      *
738 \****************************************************************************************/
739
740 #define IPCV_FILTER_MEDIAN( flavor, cn )                            \
741 IPPAPI( IppStatus, ippiFilterMedian_##flavor##_C##cn##R,            \
742             ( const void* src, int srcstep, void* dst, int dststep, \
743               IppiSize roi, IppiSize ksize, IppiPoint anchor ))
744
745 IPCV_FILTER_MEDIAN( 8u, 1 )
746 IPCV_FILTER_MEDIAN( 8u, 3 )
747 IPCV_FILTER_MEDIAN( 8u, 4 )
748
749 #if IPP >= 500
750
751 #define IPCV_FILTER_BOX( flavor, cn )                               \
752 IPPAPI( IppStatus, ippiFilterBox_##flavor##_C##cn##R,               \
753             ( const void* src, int srcstep, void* dst, int dststep, \
754               IppiSize roi, IppiSize ksize, IppiPoint anchor ))
755
756 IPCV_FILTER_BOX( 8u, 1 )
757 IPCV_FILTER_BOX( 8u, 3 )
758 IPCV_FILTER_BOX( 8u, 4 )
759 IPCV_FILTER_BOX( 32f, 1 )
760 IPCV_FILTER_BOX( 32f, 3 )
761 IPCV_FILTER_BOX( 32f, 4 )
762
763 #undef IPCV_FILTER_BOX
764
765 #endif
766
767 /****************************************************************************************\
768 *                                 Derivative Filters                                     *
769 \****************************************************************************************/
770
771 #if IPP >= 510
772
773 #define IPCV_FILTER_SOBEL_BORDER( suffix, flavor, srctype )             \
774 IPPAPI( IppStatus, ippiFilterSobel##suffix##GetBufferSize_##flavor##_C1R,\
775     ( IppiSize roi, int masksize, int* buffersize ))                    \
776 IPPAPI( IppStatus, ippiFilterSobel##suffix##Border_##flavor##_C1R,      \
777     ( const void* src, int srcstep, void* dst, int dststep,             \
778       IppiSize roi, int masksize, int bordertype,                       \
779       srctype bordervalue, void* buffer ))
780
781 IPCV_FILTER_SOBEL_BORDER( NegVert, 8u16s, uchar )
782 IPCV_FILTER_SOBEL_BORDER( Horiz, 8u16s, uchar )
783 IPCV_FILTER_SOBEL_BORDER( VertSecond, 8u16s, uchar )
784 IPCV_FILTER_SOBEL_BORDER( HorizSecond, 8u16s, uchar )
785 IPCV_FILTER_SOBEL_BORDER( Cross, 8u16s, uchar )
786
787 IPCV_FILTER_SOBEL_BORDER( NegVert, 32f, float )
788 IPCV_FILTER_SOBEL_BORDER( Horiz, 32f, float )
789 IPCV_FILTER_SOBEL_BORDER( VertSecond, 32f, float )
790 IPCV_FILTER_SOBEL_BORDER( HorizSecond, 32f, float )
791 IPCV_FILTER_SOBEL_BORDER( Cross, 32f, float )
792
793 #undef IPCV_FILTER_SOBEL_BORDER
794
795 #define IPCV_FILTER_SCHARR_BORDER( suffix, flavor, srctype )             \
796 IPPAPI( IppStatus, ippiFilterScharr##suffix##GetBufferSize_##flavor##_C1R,\
797     ( IppiSize roi, int* buffersize ))                                   \
798 IPPAPI( IppStatus, ippiFilterScharr##suffix##Border_##flavor##_C1R,      \
799     ( const void* src, int srcstep, void* dst, int dststep, IppiSize roi,\
800       int bordertype, srctype bordervalue, void* buffer ))
801
802 IPCV_FILTER_SCHARR_BORDER( Vert, 8u16s, uchar )
803 IPCV_FILTER_SCHARR_BORDER( Horiz, 8u16s, uchar )
804
805 IPCV_FILTER_SCHARR_BORDER( Vert, 32f, float )
806 IPCV_FILTER_SCHARR_BORDER( Horiz, 32f, float )
807
808 #undef IPCV_FILTER_SCHARR_BORDER
809
810
811 #define IPCV_FILTER_LAPLACIAN_BORDER( flavor, srctype )         \
812 IPPAPI( IppStatus, ippiFilterLaplacianGetBufferSize_##flavor##_C1R,\
813     ( IppiSize roi, int masksize, int* buffersize ))            \
814 IPPAPI( IppStatus, ippiFilterLaplacianBorder_##flavor##_C1R,    \
815     ( const void* src, int srcstep, void* dst, int dststep,     \
816       IppiSize roi, int masksize, int bordertype,               \
817       srctype bordervalue, void* buffer ))
818
819 IPCV_FILTER_LAPLACIAN_BORDER( 8u16s, uchar )
820 IPCV_FILTER_LAPLACIAN_BORDER( 32f, float )
821
822 #undef IPCV_FILTER_LAPLACIAN_BORDER
823
824 #endif
825
826
827 #define IPCV_FILTER_SOBEL( suffix, flavor )                 \
828 IPPAPI( IppStatus, ippiFilterSobel##suffix##_##flavor##_C1R,\
829     ( const void* src, int srcstep, void* dst, int dststep, \
830       IppiSize roi, int aperture ))
831
832 IPCV_FILTER_SOBEL( Vert, 8u16s )
833 IPCV_FILTER_SOBEL( Horiz, 8u16s )
834 IPCV_FILTER_SOBEL( VertSecond, 8u16s )
835 IPCV_FILTER_SOBEL( HorizSecond, 8u16s )
836 IPCV_FILTER_SOBEL( Cross, 8u16s )
837
838 IPCV_FILTER_SOBEL( VertMask, 32f )
839 IPCV_FILTER_SOBEL( HorizMask, 32f )
840 IPCV_FILTER_SOBEL( VertSecond, 32f )
841 IPCV_FILTER_SOBEL( HorizSecond, 32f )
842 IPCV_FILTER_SOBEL( Cross, 32f )
843
844 #undef IPCV_FILTER_SOBEL
845
846 #define IPCV_FILTER_SCHARR( suffix, flavor )                    \
847 IPPAPI( IppStatus, ippiFilterScharr##suffix##_##flavor##_C1R,   \
848     ( const void* src, int srcstep, void* dst, int dststep, IppiSize roi ))
849
850 IPCV_FILTER_SCHARR( Vert, 8u16s )
851 IPCV_FILTER_SCHARR( Horiz, 8u16s )
852 IPCV_FILTER_SCHARR( Vert, 32f )
853 IPCV_FILTER_SCHARR( Horiz, 32f )
854
855 #undef IPCV_FILTER_SCHARR
856
857 /****************************************************************************************\
858 *                                   Generic Filters                                      *
859 \****************************************************************************************/
860
861 #define IPCV_FILTER( suffix, cn, ksizetype, anchortype )                                \
862 IPPAPI( IppStatus, ippiFilter##suffix##_C##cn##R,                                       \
863             ( const void* src, int srcstep, void* dst, int dststep, IppiSize size,      \
864               const float* kernel, ksizetype ksize, anchortype anchor ))
865
866 IPCV_FILTER( 32f_8u, 1, IppiSize, IppiPoint )
867 IPCV_FILTER( 32f_8u, 3, IppiSize, IppiPoint )
868 IPCV_FILTER( 32f_8u, 4, IppiSize, IppiPoint )
869
870 IPCV_FILTER( 32f_16s, 1, IppiSize, IppiPoint )
871 IPCV_FILTER( 32f_16s, 3, IppiSize, IppiPoint )
872 IPCV_FILTER( 32f_16s, 4, IppiSize, IppiPoint )
873
874 IPCV_FILTER( _32f, 1, IppiSize, IppiPoint )
875 IPCV_FILTER( _32f, 3, IppiSize, IppiPoint )
876 IPCV_FILTER( _32f, 4, IppiSize, IppiPoint )
877
878 IPCV_FILTER( Column32f_8u, 1, int, int )
879 IPCV_FILTER( Column32f_8u, 3, int, int )
880 IPCV_FILTER( Column32f_8u, 4, int, int )
881
882 IPCV_FILTER( Column32f_16s, 1, int, int )
883 IPCV_FILTER( Column32f_16s, 3, int, int )
884 IPCV_FILTER( Column32f_16s, 4, int, int )
885
886 IPCV_FILTER( Column_32f, 1, int, int )
887 IPCV_FILTER( Column_32f, 3, int, int )
888 IPCV_FILTER( Column_32f, 4, int, int )
889
890 IPCV_FILTER( Row32f_8u, 1, int, int )
891 IPCV_FILTER( Row32f_8u, 3, int, int )
892 IPCV_FILTER( Row32f_8u, 4, int, int )
893
894 IPCV_FILTER( Row32f_16s, 1, int, int )
895 IPCV_FILTER( Row32f_16s, 3, int, int )
896 IPCV_FILTER( Row32f_16s, 4, int, int )
897
898 IPCV_FILTER( Row_32f, 1, int, int )
899 IPCV_FILTER( Row_32f, 3, int, int )
900 IPCV_FILTER( Row_32f, 4, int, int )
901
902 #undef IPCV_FILTER
903
904
905 /****************************************************************************************\
906 *                                  Color Transformations                                 *
907 \****************************************************************************************/
908
909 #define IPCV_COLOR( funcname, flavor )                          \
910 IPPAPI( IppStatus, ippi##funcname##_##flavor##_C3R,             \
911         ( const void* src, int srcstep, void* dst, int dststep, IppiSize size ))
912
913 IPCV_COLOR( RGBToXYZ, 8u )
914 IPCV_COLOR( RGBToXYZ, 16u )
915 IPCV_COLOR( RGBToXYZ, 32f )
916 IPCV_COLOR( XYZToRGB, 8u )
917 IPCV_COLOR( XYZToRGB, 16u )
918 IPCV_COLOR( XYZToRGB, 32f )
919
920 IPCV_COLOR( RGBToHSV, 8u )
921 IPCV_COLOR( HSVToRGB, 8u )
922
923 IPCV_COLOR( RGBToHLS, 8u )
924 IPCV_COLOR( RGBToHLS, 32f )
925 IPCV_COLOR( HLSToRGB, 8u )
926 IPCV_COLOR( HLSToRGB, 32f )
927
928 IPCV_COLOR( BGRToLab, 8u )
929 IPCV_COLOR( LabToBGR, 8u )
930
931 IPCV_COLOR( RGBToLUV, 8u )
932 IPCV_COLOR( RGBToLUV, 32f )
933 IPCV_COLOR( LUVToRGB, 8u )
934 IPCV_COLOR( LUVToRGB, 32f )
935
936 /****************************************************************************************\
937 *                                  Motion Templates                                      *
938 \****************************************************************************************/
939
940 IPPAPI( IppStatus, ippiUpdateMotionHistory_8u32f_C1IR,
941     ( const uchar* silIm, int silStep, float* mhiIm, int mhiStep,
942       IppiSize size,float  timestamp, float  mhi_duration ))
943
944 /****************************************************************************************\
945 *                                 Template Matching                                      *
946 \****************************************************************************************/
947
948 #define ICV_MATCHTEMPLATE( flavor, arrtype )                        \
949 IPPAPI( IppStatus, ippiCrossCorrValid_Norm_##flavor##_C1R,          \
950         ( const arrtype* pSrc, int srcStep, IppiSize srcRoiSize,    \
951         const arrtype* pTpl, int tplStep, IppiSize tplRoiSize,      \
952         float* pDst, int dstStep ))                                 \
953 IPPAPI( IppStatus, ippiCrossCorrValid_NormLevel_##flavor##_C1R,     \
954         ( const arrtype* pSrc, int srcStep, IppiSize srcRoiSize,    \
955         const arrtype* pTpl, int tplStep, IppiSize tplRoiSize,      \
956         float* pDst, int dstStep ))                                 \
957 IPPAPI( IppStatus, ippiSqrDistanceValid_Norm_##flavor##_C1R,        \
958         ( const arrtype* pSrc, int srcStep, IppiSize srcRoiSize,    \
959         const arrtype* pTpl, int tplStep, IppiSize tplRoiSize,      \
960         float* pDst, int dstStep ))
961
962 ICV_MATCHTEMPLATE( 8u32f, Ipp8u )
963 ICV_MATCHTEMPLATE( 32f, float )
964
965 #undef ICV_MATCHTEMPLATE
966
967 /****************************************************************************************/
968 /*                                Distance Transform                                    */
969 /****************************************************************************************/
970
971 IPPAPI(IppStatus, ippiDistanceTransform_3x3_8u32f_C1R,
972     ( const uchar* pSrc, int srcStep, float* pDst,
973       int dstStep, IppiSize roiSize, float* pMetrics ))
974
975 IPPAPI(IppStatus, ippiDistanceTransform_5x5_8u32f_C1R,
976     ( const uchar* pSrc, int srcStep, float* pDst,
977       int dstStep, IppiSize roiSize, float* pMetrics ))
978
979 IPPAPI( IppStatus, ippiGetDistanceTransformMask, ( int maskType, float* pMetrics ))
980
981
982 #if IPP >= 510
983
984 IPPAPI(IppStatus, ippiDistanceTransform_3x3_8u_C1IR,
985     ( uchar* pSrc, int srcStep, IppiSize roiSize, int* pMetrics ))
986
987 IPPAPI(IppStatus, ippiDistanceTransform_3x3_8u_C1R,
988     ( const uchar* pSrc, int srcStep, uchar* pDst,
989       int dstStep, IppiSize roiSize, int* pMetrics ))
990
991 #endif
992
993
994 #if IPP >= 500
995
996 /****************************************************************************************\
997 *                                 Radial Distortion Removal                              *
998 \****************************************************************************************/
999
1000 IPPAPI(IppStatus, ippiUndistortGetSize, (IppiSize roiSize, int *pBufsize))
1001
1002 IPPAPI(IppStatus, ippiCreateMapCameraUndistort_32f_C1R, (Ipp32f *pxMap, int xStep,
1003                   Ipp32f *pyMap, int yStep, IppiSize roiSize,
1004                   Ipp32f fx, Ipp32f fy, Ipp32f cx, Ipp32f cy,
1005                   Ipp32f k1, Ipp32f k2, Ipp32f p1, Ipp32f p2, Ipp8u *pBuffer))
1006
1007 IPPAPI(IppStatus, ippiUndistortRadial_8u_C1R, (const Ipp8u* pSrc, int srcStep,
1008                          Ipp8u* pDst, int dstStep, IppiSize roiSize, Ipp32f fx, Ipp32f fy,
1009                          Ipp32f cx, Ipp32f cy, Ipp32f k1, Ipp32f k2, Ipp8u *pBuffer))
1010
1011 IPPAPI(IppStatus, ippiUndistortRadial_8u_C3R, (const Ipp8u* pSrc, int srcStep,
1012                          Ipp8u* pDst, int dstStep, IppiSize roiSize, Ipp32f fx, Ipp32f fy,
1013                          Ipp32f cx, Ipp32f cy, Ipp32f k1, Ipp32f k2, Ipp8u *pBuffer))
1014
1015 /****************************************************************************************\
1016 *                            Subpixel-accurate rectangle extraction                      *
1017 \****************************************************************************************/
1018
1019 IPPAPI(IppStatus, ippiCopySubpix_8u_C1R,  (const Ipp8u* pSrc, int srcStep,
1020                   Ipp8u* pDst, int dstStep, IppiSize roiSize, Ipp32f dx, Ipp32f dy))
1021
1022 IPPAPI(IppStatus, ippiCopySubpix_8u32f_C1R,  (const Ipp8u* pSrc, int srcStep,
1023                   Ipp32f* pDst, int dstStep, IppiSize roiSize, Ipp32f dx, Ipp32f dy))
1024
1025 IPPAPI(IppStatus, ippiCopySubpix_32f_C1R,  (const Ipp32f* pSrc, int srcStep,
1026                   Ipp32f* pDst, int dstStep, IppiSize roiSize, Ipp32f dx, Ipp32f dy))
1027
1028 /****************************************************************************************\
1029 *                                Lucas-Kanade Optical Flow                               *
1030 \****************************************************************************************/
1031
1032 IPPAPI(IppStatus, ippiOpticalFlowPyrLKInitAlloc_8u_C1R, (void** ppState,
1033        IppiSize roiSize, int winSize, IppHintAlgorithm hint))
1034
1035 IPPAPI(IppStatus, ippiOpticalFlowPyrLKFree_8u_C1R, (void* pState))
1036
1037 IPPAPI(IppStatus, ippiOpticalFlowPyrLK_8u_C1R, (void *pPyr1, void *pPyr2,
1038                          const Ipp32f *pPrev, Ipp32f *pNext, Ipp8s *pStatus, Ipp32f *pError,
1039                          int numFeat, int winSize, int maxLev, int maxIter, Ipp32f threshold,
1040                          void *pState))
1041
1042 /****************************************************************************************\
1043 *                                 Haar Object Detector                                   *
1044 \****************************************************************************************/
1045
1046 IPPAPI(IppStatus, ippiIntegral_8u32s_C1R,  (const Ipp8u* pSrc, int srcStep,
1047                   Ipp32s* pDst, int dstStep, IppiSize roiSize, Ipp32s val))
1048
1049 IPPAPI(IppStatus, ippiSqrIntegral_8u32s64f_C1R,  (const Ipp8u* pSrc, int srcStep,
1050                   Ipp32s* pDst, int dstStep, Ipp64f* pSqr, int sqrStep, IppiSize roiSize,
1051                   Ipp32s val, Ipp64f valSqr))
1052
1053 IPPAPI(IppStatus, ippiRectStdDev_32s32f_C1R,  (const Ipp32s* pSrc, int srcStep,
1054                          const Ipp64f* pSqr, int sqrStep, Ipp32f* pDst, int dstStep,
1055                          IppiSize roiSize, IppiRect rect))
1056
1057 IPPAPI(IppStatus, ippiHaarClassifierInitAlloc_32f, (void **pState,
1058                  const IppiRect* pFeature, const Ipp32f* pWeight, const Ipp32f* pThreshold,
1059                  const Ipp32f* pVal1, const Ipp32f* pVal2, const int* pNum, int length))
1060
1061 IPPAPI(IppStatus, ippiHaarClassifierFree_32f,(void *pState))
1062
1063 IPPAPI(IppStatus, ippiApplyHaarClassifier_32s32f_C1R, (const Ipp32s* pSrc, int srcStep,
1064                          const Ipp32f* pNorm, int normStep, Ipp8u* pMask, int maskStep,
1065                          IppiSize roi, int *pPositive, Ipp32f threshold,
1066                          void *pState))
1067
1068 #endif