Update to 2.0.0 tree from current Fremantle build
[opencv] / src / cv / _cv.h
diff --git a/src/cv/_cv.h b/src/cv/_cv.h
new file mode 100644 (file)
index 0000000..c73faaf
--- /dev/null
@@ -0,0 +1,139 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////\r
+//\r
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\r
+//\r
+//  By downloading, copying, installing or using the software you agree to this license.\r
+//  If you do not agree to this license, do not download, install,\r
+//  copy or use the software.\r
+//\r
+//\r
+//                          License Agreement\r
+//                For Open Source Computer Vision Library\r
+//\r
+// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\r
+// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\r
+// Third party copyrights are property of their respective owners.\r
+//\r
+// Redistribution and use in source and binary forms, with or without modification,\r
+// are permitted provided that the following conditions are met:\r
+//\r
+//   * Redistribution's of source code must retain the above copyright notice,\r
+//     this list of conditions and the following disclaimer.\r
+//\r
+//   * Redistribution's in binary form must reproduce the above copyright notice,\r
+//     this list of conditions and the following disclaimer in the documentation\r
+//     and/or other materials provided with the distribution.\r
+//\r
+//   * The name of the copyright holders may not be used to endorse or promote products\r
+//     derived from this software without specific prior written permission.\r
+//\r
+// This software is provided by the copyright holders and contributors "as is" and\r
+// any express or implied warranties, including, but not limited to, the implied\r
+// warranties of merchantability and fitness for a particular purpose are disclaimed.\r
+// In no event shall the Intel Corporation or contributors be liable for any direct,\r
+// indirect, incidental, special, exemplary, or consequential damages\r
+// (including, but not limited to, procurement of substitute goods or services;\r
+// loss of use, data, or profits; or business interruption) however caused\r
+// and on any theory of liability, whether in contract, strict liability,\r
+// or tort (including negligence or otherwise) arising in any way out of\r
+// the use of this software, even if advised of the possibility of such damage.\r
+//\r
+//M*/\r
+\r
+#ifndef _CV_INTERNAL_H_\r
+#define _CV_INTERNAL_H_\r
+\r
+#if defined _MSC_VER && _MSC_VER >= 1200\r
+    /* disable warnings related to inline functions */\r
+    #pragma warning( disable: 4251 4711 4710 4514 )\r
+#endif\r
+\r
+#include "cv.h"\r
+#include "cxmisc.h"\r
+#include <math.h>\r
+#include <assert.h>\r
+#include <string.h>\r
+#include <stdlib.h>\r
+#include <stdio.h>\r
+#include <limits.h>\r
+#include <float.h>\r
+\r
+#ifdef __BORLANDC__\r
+#ifndef WIN32\r
+    #define     WIN32\r
+#endif\r
+#ifndef _WIN32\r
+    #define     _WIN32\r
+#endif\r
+    #define     CV_DLL\r
+    #undef      _CV_ALWAYS_PROFILE_\r
+    #define     _CV_ALWAYS_NO_PROFILE_\r
+#endif\r
+\r
+#ifdef HAVE_IPP\r
+#include "ipp.h"\r
+\r
+CV_INLINE IppiSize ippiSize(int width, int height)\r
+{\r
+    IppiSize size = { width, height };\r
+    return size;\r
+}\r
+#endif\r
+\r
+/* helper tables */\r
+extern const uchar icvSaturate8u_cv[];\r
+#define CV_FAST_CAST_8U(t)  (assert(-256 <= (t) || (t) <= 512), icvSaturate8u_cv[(t)+256])\r
+#define CV_CALC_MIN_8U(a,b) (a) -= CV_FAST_CAST_8U((a) - (b))\r
+#define CV_CALC_MAX_8U(a,b) (a) += CV_FAST_CAST_8U((b) - (a))\r
+\r
+// -256.f ... 511.f\r
+extern const float icv8x32fTab_cv[];\r
+#define CV_8TO32F(x)  icv8x32fTab_cv[(x)+256]\r
+\r
+// (-128.f)^2 ... (255.f)^2\r
+extern const float icv8x32fSqrTab[];\r
+#define CV_8TO32F_SQR(x)  icv8x32fSqrTab[(x)+128]\r
+\r
+namespace cv\r
+{\r
+\r
+enum { INTER_BITS=5, INTER_BITS2=INTER_BITS*2,\r
+       INTER_TAB_SIZE=(1<<INTER_BITS),\r
+       INTER_TAB_SIZE2=INTER_TAB_SIZE*INTER_TAB_SIZE };\r
+\r
+static inline Point normalizeAnchor( Point anchor, Size ksize )\r
+{\r
+    if( anchor == Point(-1,-1) )\r
+        anchor = Point(ksize.width/2, ksize.height/2);\r
+    else\r
+        CV_Assert( anchor.inside(Rect(0, 0, ksize.width, ksize.height)) );\r
+    return anchor;\r
+}\r
+\r
+void preprocess2DKernel( const Mat& kernel, vector<Point>& coords, vector<uchar>& coeffs );\r
+void crossCorr( const Mat& src, const Mat& templ, Mat& dst,\r
+                Point anchor=Point(0,0), double delta=0,\r
+                int borderType=BORDER_REFLECT_101 );\r
+\r
+}\r
+\r
+typedef struct CvPyramid\r
+{\r
+    uchar **ptr;\r
+    CvSize *sz;\r
+    double *rate;\r
+    int *step;\r
+    uchar *state;\r
+    int level;\r
+}\r
+CvPyramid;\r
+\r
+#ifndef IPPI_CALL\r
+#define IPPI_CALL(func) CV_Assert((func) >= 0)\r
+#endif\r
+\r
+#include "_cvmatrix.h"\r
+#include "_cvgeom.h"\r
+#include "_cvimgproc.h"\r
+\r
+#endif /*_CV_INTERNAL_H_*/\r