opencv  2.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
internal.hpp
Go to the documentation of this file.
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 // License Agreement
11 // For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15 // Third party copyrights are property of their respective owners.
16 //
17 // Redistribution and use in source and binary forms, with or without modification,
18 // are permitted provided that the following conditions are met:
19 //
20 // * Redistribution's of source code must retain the above copyright notice,
21 // this list of conditions and the following disclaimer.
22 //
23 // * Redistribution's in binary form must reproduce the above copyright notice,
24 // this list of conditions and the following disclaimer in the documentation
25 // and/or other materials provided with the distribution.
26 //
27 // * The name of the copyright holders may not be used to endorse or promote products
28 // derived from this software without specific prior written permission.
29 //
30 // This software is provided by the copyright holders and contributors "as is" and
31 // any express or implied warranties, including, but not limited to, the implied
32 // warranties of merchantability and fitness for a particular purpose are disclaimed.
33 // In no event shall the Intel Corporation or contributors be liable for any direct,
34 // indirect, incidental, special, exemplary, or consequential damages
35 // (including, but not limited to, procurement of substitute goods or services;
36 // loss of use, data, or profits; or business interruption) however caused
37 // and on any theory of liability, whether in contract, strict liability,
38 // or tort (including negligence or otherwise) arising in any way out of
39 // the use of this software, even if advised of the possibility of such damage.
40 //
41 //M*/
42 
43 /* The header is for internal use and it is likely to change.
44  It contains some macro definitions that are used in cxcore, cv, cvaux
45  and, probably, other libraries. If you need some of this functionality,
46  the safe way is to copy it into your code and rename the macros.
47 */
48 #ifndef __OPENCV_CORE_INTERNAL_HPP__
49 #define __OPENCV_CORE_INTERNAL_HPP__
50 
51 #include <vector>
52 
53 #if defined WIN32 || defined _WIN32
54 # ifndef WIN32
55 # define WIN32
56 # endif
57 # ifndef _WIN32
58 # define _WIN32
59 # endif
60 #endif
61 
62 #if defined WIN32 || defined WINCE
63 #ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
64 #define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
65 #endif
66 #include <windows.h>
67 #undef small
68 #undef min
69 #undef max
70 #else
71 #include <pthread.h>
72 #include <sys/mman.h>
73 #endif
74 
75 #ifdef __BORLANDC__
76 #ifndef WIN32
77  #define WIN32
78 #endif
79 #ifndef _WIN32
80  #define _WIN32
81 #endif
82  #define CV_DLL
83  #undef _CV_ALWAYS_PROFILE_
84  #define _CV_ALWAYS_NO_PROFILE_
85 #endif
86 
87 #ifndef FALSE
88 #define FALSE 0
89 #endif
90 #ifndef TRUE
91 #define TRUE 1
92 #endif
93 
94 #define __BEGIN__ __CV_BEGIN__
95 #define __END__ __CV_END__
96 #define EXIT __CV_EXIT__
97 
98 #ifdef HAVE_IPP
99 #include "ipp.h"
100 
101 CV_INLINE IppiSize ippiSize(int width, int height)
102 {
103  IppiSize size = { width, height };
104  return size;
105 }
106 #endif
107 
108 #if defined __SSE2__ || _MSC_VER >= 1300
109 #include "emmintrin.h"
110 #define CV_SSE 1
111 #define CV_SSE2 1
112 #if defined __SSE3__ || _MSC_VER >= 1500
113 #include "pmmintrin.h"
114 #define CV_SSE3 1
115 #endif
116 #else
117 #define CV_SSE 0
118 #define CV_SSE2 0
119 #define CV_SSE3 0
120 #endif
121 
122 #ifndef IPPI_CALL
123 #define IPPI_CALL(func) CV_Assert((func) >= 0)
124 #endif
125 
126 #ifdef HAVE_TBB
127  #include "tbb/tbb_stddef.h"
128  #if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
129  #include "tbb/tbb.h"
130  #undef min
131  #undef max
132  #else
133  #undef HAVE_TBB
134  #endif
135 #endif
136 
137 #ifdef HAVE_EIGEN2
138  #include <Eigen/Core>
139  #include "opencv2/core/eigen.hpp"
140 #endif
141 
142 #ifdef __cplusplus
143 
144 #ifdef HAVE_TBB
145  namespace cv
146  {
147  typedef tbb::blocked_range<int> BlockedRange;
148 
149  template<typename Body> static inline
150  void parallel_for( const BlockedRange& range, const Body& body )
151  {
152  tbb::parallel_for(range, body);
153  }
154 
155  template<typename Iterator, typename Body> static inline
156  void parallel_do( Iterator first, Iterator last, const Body& body )
157  {
158  tbb::parallel_do(first, last, body);
159  }
160 
161  typedef tbb::split Split;
162 
163  template<typename Body> static inline
164  void parallel_reduce( const BlockedRange& range, Body& body )
165  {
166  tbb::parallel_reduce(range, body);
167  }
168 
169  typedef tbb::concurrent_vector<Rect> ConcurrentRectVector;
170  }
171 #else
172  namespace cv
173  {
175  {
176  public:
177  BlockedRange() : _begin(0), _end(0), _grainsize(0) {}
178  BlockedRange(int b, int e, int g=1) : _begin(b), _end(e), _grainsize(g) {}
179  int begin() const { return _begin; }
180  int end() const { return _end; }
181  int grainsize() const { return _grainsize; }
182 
183  protected:
185  };
186 
187  template<typename Body> static inline
188  void parallel_for( const BlockedRange& range, const Body& body )
189  {
190  body(range);
191  }
192 
193  template<typename Iterator, typename Body> static inline
194  void parallel_do( Iterator first, Iterator last, const Body& body )
195  {
196  for( ; first != last; ++first )
197  body(*first);
198  }
199 
200  class Split {};
201 
202  template<typename Body> static inline
203  void parallel_reduce( const BlockedRange& range, Body& body )
204  {
205  body(range);
206  }
207 
208  typedef std::vector<Rect> ConcurrentRectVector;
209  }
210 #endif
211 #endif
212 
213 /* maximal size of vector to run matrix operations on it inline (i.e. w/o ipp calls) */
214 #define CV_MAX_INLINE_MAT_OP_SIZE 10
215 
216 /* maximal linear size of matrix to allocate it on stack. */
217 #define CV_MAX_LOCAL_MAT_SIZE 32
218 
219 /* maximal size of local memory storage */
220 #define CV_MAX_LOCAL_SIZE \
221  (CV_MAX_LOCAL_MAT_SIZE*CV_MAX_LOCAL_MAT_SIZE*(int)sizeof(double))
222 
223 /* default image row align (in bytes) */
224 #define CV_DEFAULT_IMAGE_ROW_ALIGN 4
225 
226 /* matrices are continuous by default */
227 #define CV_DEFAULT_MAT_ROW_ALIGN 1
228 
229 /* maximum size of dynamic memory buffer.
230  cvAlloc reports an error if a larger block is requested. */
231 #define CV_MAX_ALLOC_SIZE (((size_t)1 << (sizeof(size_t)*8-2)))
232 
233 /* the alignment of all the allocated buffers */
234 #define CV_MALLOC_ALIGN 16
235 
236 /* default alignment for dynamic data strucutures, resided in storages. */
237 #define CV_STRUCT_ALIGN ((int)sizeof(double))
238 
239 /* default storage block size */
240 #define CV_STORAGE_BLOCK_SIZE ((1<<16) - 128)
241 
242 /* default memory block for sparse array elements */
243 #define CV_SPARSE_MAT_BLOCK (1<<12)
244 
245 /* initial hash table size */
246 #define CV_SPARSE_HASH_SIZE0 (1<<10)
247 
248 /* maximal average node_count/hash_size ratio beyond which hash table is resized */
249 #define CV_SPARSE_HASH_RATIO 3
250 
251 /* max length of strings */
252 #define CV_MAX_STRLEN 1024
253 
254 #if 0 /*def CV_CHECK_FOR_NANS*/
255  #define CV_CHECK_NANS( arr ) cvCheckArray((arr))
256 #else
257  #define CV_CHECK_NANS( arr )
258 #endif
259 
260 /****************************************************************************************\
261 * Common declarations *
262 \****************************************************************************************/
263 
264 /* get alloca declaration */
265 #ifdef __GNUC__
266  #undef alloca
267  #define alloca __builtin_alloca
268 #elif defined WIN32 || defined _WIN32 || \
269  defined WINCE || defined _MSC_VER || defined __BORLANDC__
270  #include <malloc.h>
271 #elif defined HAVE_ALLOCA_H
272  #include <alloca.h>
273 #elif defined HAVE_ALLOCA
274  #include <stdlib.h>
275 #else
276  #error "No alloca!"
277 #endif
278 
279 #ifdef __GNUC__
280 #define CV_DECL_ALIGNED(x) __attribute__ ((aligned (x)))
281 #elif defined _MSC_VER
282 #define CV_DECL_ALIGNED(x) __declspec(align(x))
283 #else
284 #define CV_DECL_ALIGNED(x)
285 #endif
286 
287 /* ! DO NOT make it an inline function */
288 #define cvStackAlloc(size) cvAlignPtr( alloca((size) + CV_MALLOC_ALIGN), CV_MALLOC_ALIGN )
289 
290 #if defined _MSC_VER || defined __BORLANDC__
291  #define CV_BIG_INT(n) n##I64
292  #define CV_BIG_UINT(n) n##UI64
293 #else
294  #define CV_BIG_INT(n) n##LL
295  #define CV_BIG_UINT(n) n##ULL
296 #endif
297 
298 #ifndef CV_IMPL
299 #define CV_IMPL CV_EXTERN_C
300 #endif
301 
302 #define CV_DBG_BREAK() { volatile int* crashMe = 0; *crashMe = 0; }
303 
304 /* default step, set in case of continuous data
305  to work around checks for valid step in some ipp functions */
306 #define CV_STUB_STEP (1 << 30)
307 
308 #define CV_SIZEOF_FLOAT ((int)sizeof(float))
309 #define CV_SIZEOF_SHORT ((int)sizeof(short))
310 
311 #define CV_ORIGIN_TL 0
312 #define CV_ORIGIN_BL 1
313 
314 /* IEEE754 constants and macros */
315 #define CV_POS_INF 0x7f800000
316 #define CV_NEG_INF 0x807fffff /* CV_TOGGLE_FLT(0xff800000) */
317 #define CV_1F 0x3f800000
318 #define CV_TOGGLE_FLT(x) ((x)^((int)(x) < 0 ? 0x7fffffff : 0))
319 #define CV_TOGGLE_DBL(x) \
320  ((x)^((int64)(x) < 0 ? CV_BIG_INT(0x7fffffffffffffff) : 0))
321 
322 #define CV_NOP(a) (a)
323 #define CV_ADD(a, b) ((a) + (b))
324 #define CV_SUB(a, b) ((a) - (b))
325 #define CV_MUL(a, b) ((a) * (b))
326 #define CV_AND(a, b) ((a) & (b))
327 #define CV_OR(a, b) ((a) | (b))
328 #define CV_XOR(a, b) ((a) ^ (b))
329 #define CV_ANDN(a, b) (~(a) & (b))
330 #define CV_ORN(a, b) (~(a) | (b))
331 #define CV_SQR(a) ((a) * (a))
332 
333 #define CV_LT(a, b) ((a) < (b))
334 #define CV_LE(a, b) ((a) <= (b))
335 #define CV_EQ(a, b) ((a) == (b))
336 #define CV_NE(a, b) ((a) != (b))
337 #define CV_GT(a, b) ((a) > (b))
338 #define CV_GE(a, b) ((a) >= (b))
339 
340 #define CV_NONZERO(a) ((a) != 0)
341 #define CV_NONZERO_FLT(a) (((a)+(a)) != 0)
342 
343 /* general-purpose saturation macros */
344 #define CV_CAST_8U(t) (uchar)(!((t) & ~255) ? (t) : (t) > 0 ? 255 : 0)
345 #define CV_CAST_8S(t) (schar)(!(((t)+128) & ~255) ? (t) : (t) > 0 ? 127 : -128)
346 #define CV_CAST_16U(t) (ushort)(!((t) & ~65535) ? (t) : (t) > 0 ? 65535 : 0)
347 #define CV_CAST_16S(t) (short)(!(((t)+32768) & ~65535) ? (t) : (t) > 0 ? 32767 : -32768)
348 #define CV_CAST_32S(t) (int)(t)
349 #define CV_CAST_64S(t) (int64)(t)
350 #define CV_CAST_32F(t) (float)(t)
351 #define CV_CAST_64F(t) (double)(t)
352 
353 #define CV_PASTE2(a,b) a##b
354 #define CV_PASTE(a,b) CV_PASTE2(a,b)
355 
356 #define CV_EMPTY
357 #define CV_MAKE_STR(a) #a
358 
359 #define CV_ZERO_OBJ(x) memset((x), 0, sizeof(*(x)))
360 
361 #define CV_DIM(static_array) ((int)(sizeof(static_array)/sizeof((static_array)[0])))
362 
363 #define cvUnsupportedFormat "Unsupported format"
364 
365 CV_INLINE void* cvAlignPtr( const void* ptr, int align CV_DEFAULT(32) )
366 {
367  assert( (align & (align-1)) == 0 );
368  return (void*)( ((size_t)ptr + align - 1) & ~(size_t)(align-1) );
369 }
370 
371 CV_INLINE int cvAlign( int size, int align )
372 {
373  assert( (align & (align-1)) == 0 && size < INT_MAX );
374  return (size + align - 1) & -align;
375 }
376 
378 {
379  CvSize size;
380  size.width = mat->cols;
381  size.height = mat->rows;
382  return size;
383 }
384 
385 #define CV_DESCALE(x,n) (((x) + (1 << ((n)-1))) >> (n))
386 #define CV_FLT_TO_FIX(x,n) cvRound((x)*(1<<(n)))
387 
388 /****************************************************************************************\
389 
390  Generic implementation of QuickSort algorithm.
391  ----------------------------------------------
392  Using this macro user can declare customized sort function that can be much faster
393  than built-in qsort function because of lower overhead on elements
394  comparison and exchange. The macro takes less_than (or LT) argument - a macro or function
395  that takes 2 arguments returns non-zero if the first argument should be before the second
396  one in the sorted sequence and zero otherwise.
397 
398  Example:
399 
400  Suppose that the task is to sort points by ascending of y coordinates and if
401  y's are equal x's should ascend.
402 
403  The code is:
404  ------------------------------------------------------------------------------
405  #define cmp_pts( pt1, pt2 ) \
406  ((pt1).y < (pt2).y || ((pt1).y < (pt2).y && (pt1).x < (pt2).x))
407 
408  [static] CV_IMPLEMENT_QSORT( icvSortPoints, CvPoint, cmp_pts )
409  ------------------------------------------------------------------------------
410 
411  After that the function "void icvSortPoints( CvPoint* array, size_t total, int aux );"
412  is available to user.
413 
414  aux is an additional parameter, which can be used when comparing elements.
415  The current implementation was derived from *BSD system qsort():
416 
417  * Copyright (c) 1992, 1993
418  * The Regents of the University of California. All rights reserved.
419  *
420  * Redistribution and use in source and binary forms, with or without
421  * modification, are permitted provided that the following conditions
422  * are met:
423  * 1. Redistributions of source code must retain the above copyright
424  * notice, this list of conditions and the following disclaimer.
425  * 2. Redistributions in binary form must reproduce the above copyright
426  * notice, this list of conditions and the following disclaimer in the
427  * documentation and/or other materials provided with the distribution.
428  * 3. All advertising materials mentioning features or use of this software
429  * must display the following acknowledgement:
430  * This product includes software developed by the University of
431  * California, Berkeley and its contributors.
432  * 4. Neither the name of the University nor the names of its contributors
433  * may be used to endorse or promote products derived from this software
434  * without specific prior written permission.
435  *
436  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
437  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
438  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
439  * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
440  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
441  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
442  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
443  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
444  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
445  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
446  * SUCH DAMAGE.
447 
448 \****************************************************************************************/
449 
450 #define CV_IMPLEMENT_QSORT_EX( func_name, T, LT, user_data_type ) \
451 void func_name( T *array, size_t total, user_data_type aux ) \
452 { \
453  int isort_thresh = 7; \
454  T t; \
455  int sp = 0; \
456  \
457  struct \
458  { \
459  T *lb; \
460  T *ub; \
461  } \
462  stack[48]; \
463  \
464  aux = aux; \
465  \
466  if( total <= 1 ) \
467  return; \
468  \
469  stack[0].lb = array; \
470  stack[0].ub = array + (total - 1); \
471  \
472  while( sp >= 0 ) \
473  { \
474  T* left = stack[sp].lb; \
475  T* right = stack[sp--].ub; \
476  \
477  for(;;) \
478  { \
479  int i, n = (int)(right - left) + 1, m; \
480  T* ptr; \
481  T* ptr2; \
482  \
483  if( n <= isort_thresh ) \
484  { \
485  insert_sort: \
486  for( ptr = left + 1; ptr <= right; ptr++ ) \
487  { \
488  for( ptr2 = ptr; ptr2 > left && LT(ptr2[0],ptr2[-1]); ptr2--) \
489  CV_SWAP( ptr2[0], ptr2[-1], t ); \
490  } \
491  break; \
492  } \
493  else \
494  { \
495  T* left0; \
496  T* left1; \
497  T* right0; \
498  T* right1; \
499  T* pivot; \
500  T* a; \
501  T* b; \
502  T* c; \
503  int swap_cnt = 0; \
504  \
505  left0 = left; \
506  right0 = right; \
507  pivot = left + (n/2); \
508  \
509  if( n > 40 ) \
510  { \
511  int d = n / 8; \
512  a = left, b = left + d, c = left + 2*d; \
513  left = LT(*a, *b) ? (LT(*b, *c) ? b : (LT(*a, *c) ? c : a)) \
514  : (LT(*c, *b) ? b : (LT(*a, *c) ? a : c)); \
515  \
516  a = pivot - d, b = pivot, c = pivot + d; \
517  pivot = LT(*a, *b) ? (LT(*b, *c) ? b : (LT(*a, *c) ? c : a)) \
518  : (LT(*c, *b) ? b : (LT(*a, *c) ? a : c)); \
519  \
520  a = right - 2*d, b = right - d, c = right; \
521  right = LT(*a, *b) ? (LT(*b, *c) ? b : (LT(*a, *c) ? c : a)) \
522  : (LT(*c, *b) ? b : (LT(*a, *c) ? a : c)); \
523  } \
524  \
525  a = left, b = pivot, c = right; \
526  pivot = LT(*a, *b) ? (LT(*b, *c) ? b : (LT(*a, *c) ? c : a)) \
527  : (LT(*c, *b) ? b : (LT(*a, *c) ? a : c)); \
528  if( pivot != left0 ) \
529  { \
530  CV_SWAP( *pivot, *left0, t ); \
531  pivot = left0; \
532  } \
533  left = left1 = left0 + 1; \
534  right = right1 = right0; \
535  \
536  for(;;) \
537  { \
538  while( left <= right && !LT(*pivot, *left) ) \
539  { \
540  if( !LT(*left, *pivot) ) \
541  { \
542  if( left > left1 ) \
543  CV_SWAP( *left1, *left, t ); \
544  swap_cnt = 1; \
545  left1++; \
546  } \
547  left++; \
548  } \
549  \
550  while( left <= right && !LT(*right, *pivot) ) \
551  { \
552  if( !LT(*pivot, *right) ) \
553  { \
554  if( right < right1 ) \
555  CV_SWAP( *right1, *right, t ); \
556  swap_cnt = 1; \
557  right1--; \
558  } \
559  right--; \
560  } \
561  \
562  if( left > right ) \
563  break; \
564  CV_SWAP( *left, *right, t ); \
565  swap_cnt = 1; \
566  left++; \
567  right--; \
568  } \
569  \
570  if( swap_cnt == 0 ) \
571  { \
572  left = left0, right = right0; \
573  goto insert_sort; \
574  } \
575  \
576  n = MIN( (int)(left1 - left0), (int)(left - left1) ); \
577  for( i = 0; i < n; i++ ) \
578  CV_SWAP( left0[i], left[i-n], t ); \
579  \
580  n = MIN( (int)(right0 - right1), (int)(right1 - right) ); \
581  for( i = 0; i < n; i++ ) \
582  CV_SWAP( left[i], right0[i-n+1], t ); \
583  n = (int)(left - left1); \
584  m = (int)(right1 - right); \
585  if( n > 1 ) \
586  { \
587  if( m > 1 ) \
588  { \
589  if( n > m ) \
590  { \
591  stack[++sp].lb = left0; \
592  stack[sp].ub = left0 + n - 1; \
593  left = right0 - m + 1, right = right0; \
594  } \
595  else \
596  { \
597  stack[++sp].lb = right0 - m + 1; \
598  stack[sp].ub = right0; \
599  left = left0, right = left0 + n - 1; \
600  } \
601  } \
602  else \
603  left = left0, right = left0 + n - 1; \
604  } \
605  else if( m > 1 ) \
606  left = right0 - m + 1, right = right0; \
607  else \
608  break; \
609  } \
610  } \
611  } \
612 }
613 
614 #define CV_IMPLEMENT_QSORT( func_name, T, cmp ) \
615  CV_IMPLEMENT_QSORT_EX( func_name, T, cmp, int )
616 
617 /****************************************************************************************\
618 * Structures and macros for integration with IPP *
619 \****************************************************************************************/
620 
621 /* IPP-compatible return codes */
622 typedef enum CvStatus
623 {
629 
638 
639  CV_BADARG_ERR = -49, //ipp comp
640  CV_NOTDEFINED_ERR = -48, //ipp comp
641 
642  CV_BADCHANNELS_ERR = -47, //ipp comp
643  CV_BADRANGE_ERR = -44, //ipp comp
644  CV_BADSTEP_ERR = -29, //ipp comp
645 
647  CV_DIV_BY_ZERO_ERR = -11, //ipp comp
649 
658 }
659 CvStatus;
660 
661 #define CV_NOTHROW throw()
662 
663 typedef struct CvFuncTable
664 {
666 }
668 
669 typedef struct CvBigFuncTable
670 {
671  void* fn_2d[CV_DEPTH_MAX*4];
672 }
674 
675 #define CV_INIT_FUNC_TAB( tab, FUNCNAME, FLAG ) \
676  (tab).fn_2d[CV_8U] = (void*)FUNCNAME##_8u##FLAG; \
677  (tab).fn_2d[CV_8S] = 0; \
678  (tab).fn_2d[CV_16U] = (void*)FUNCNAME##_16u##FLAG; \
679  (tab).fn_2d[CV_16S] = (void*)FUNCNAME##_16s##FLAG; \
680  (tab).fn_2d[CV_32S] = (void*)FUNCNAME##_32s##FLAG; \
681  (tab).fn_2d[CV_32F] = (void*)FUNCNAME##_32f##FLAG; \
682  (tab).fn_2d[CV_64F] = (void*)FUNCNAME##_64f##FLAG
683 
684 #endif