16acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn/*M///////////////////////////////////////////////////////////////////////////////////////
26acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
36acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
46acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
56acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//  By downloading, copying, installing or using the software you agree to this license.
66acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//  If you do not agree to this license, do not download, install,
76acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//  copy or use the software.
86acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
96acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
106acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//                        Intel License Agreement
116acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//                For Open Source Computer Vision Library
126acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
136acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// Copyright (C) 2000, Intel Corporation, all rights reserved.
146acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// Third party copyrights are property of their respective owners.
156acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
166acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// Redistribution and use in source and binary forms, with or without modification,
176acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// are permitted provided that the following conditions are met:
186acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
196acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//   * Redistribution's of source code must retain the above copyright notice,
206acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//     this list of conditions and the following disclaimer.
216acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
226acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//   * Redistribution's in binary form must reproduce the above copyright notice,
236acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//     this list of conditions and the following disclaimer in the documentation
246acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//     and/or other materials provided with the distribution.
256acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
266acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//   * The name of Intel Corporation may not be used to endorse or promote products
276acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//     derived from this software without specific prior written permission.
286acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
296acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// This software is provided by the copyright holders and contributors "as is" and
306acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// any express or implied warranties, including, but not limited to, the implied
316acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// warranties of merchantability and fitness for a particular purpose are disclaimed.
326acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// In no event shall the Intel Corporation or contributors be liable for any direct,
336acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// indirect, incidental, special, exemplary, or consequential damages
346acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// (including, but not limited to, procurement of substitute goods or services;
356acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// loss of use, data, or profits; or business interruption) however caused
366acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// and on any theory of liability, whether in contract, strict liability,
376acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// or tort (including negligence or otherwise) arising in any way out of
386acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// the use of this software, even if advised of the possibility of such damage.
396acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//
406acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//M*/
416acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
426acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#ifndef _CV_INTERNAL_H_
436acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#define _CV_INTERNAL_H_
446acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
456acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#if defined _MSC_VER && _MSC_VER >= 1200
466acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    /* disable warnings related to inline functions */
476acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    #pragma warning( disable: 4711 4710 4514 )
486acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#endif
496acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
506acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include "cv.h"
516acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include "cxmisc.h"
526acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include <math.h>
536acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include <assert.h>
546acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include <string.h>
556acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include <stdlib.h>
566acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include <stdio.h>
576acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include <limits.h>
586acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include <float.h>
596acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
606acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renntypedef unsigned char uchar;
616acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renntypedef unsigned short ushort;
626acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
636acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#ifdef __BORLANDC__
646acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    #define     WIN32
656acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    #define     CV_DLL
666acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    #undef      _CV_ALWAYS_PROFILE_
676acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    #define     _CV_ALWAYS_NO_PROFILE_
686acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#endif
696acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
706acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn/* helper tables */
716acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Rennextern const uchar icvSaturate8u_cv[];
726acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#define CV_FAST_CAST_8U(t)  (assert(-256 <= (t) || (t) <= 512), icvSaturate8u_cv[(t)+256])
736acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#define CV_CALC_MIN_8U(a,b) (a) -= CV_FAST_CAST_8U((a) - (b))
746acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#define CV_CALC_MAX_8U(a,b) (a) += CV_FAST_CAST_8U((b) - (a))
756acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
766acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// -256.f ... 511.f
776acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Rennextern const float icv8x32fTab_cv[];
786acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#define CV_8TO32F(x)  icv8x32fTab_cv[(x)+256]
796acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
806acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// (-128.f)^2 ... (255.f)^2
816acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Rennextern const float icv8x32fSqrTab[];
826acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#define CV_8TO32F_SQR(x)  icv8x32fSqrTab[(x)+128]
836acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
846acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius RennCV_INLINE  CvDataType icvDepthToDataType( int type );
856acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius RennCV_INLINE  CvDataType icvDepthToDataType( int type )
866acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn{
876acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    return (CvDataType)(
886acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn            ((((int)cv8u)|((int)cv8s << 4)|((int)cv16u << 8)|
896acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn              ((int)cv16s << 12)|((int)cv32s << 16)|((int)cv32f << 20)|
906acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn              ((int)cv64f << 24)) >> CV_MAT_DEPTH(type)*4) & 15);
916acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn}
926acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
936acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#define CV_HIST_DEFAULT_TYPE CV_32F
946acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
956acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius RennCV_EXTERN_C_FUNCPTR( void (CV_CDECL * CvWriteNodeFunction)(void* seq,void* node) )
966acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
976acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#define _CvConvState CvFilterState
986acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
996acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renntypedef struct CvPyramid
1006acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn{
1016acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    uchar **ptr;
1026acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    CvSize *sz;
1036acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    double *rate;
1046acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    int *step;
1056acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    uchar *state;
1066acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn    int level;
1076acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn}
1086acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius RennCvPyramid;
1096acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
1106acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include "_cvipp.h"
1116acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include "_cvmatrix.h"
1126acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include "_cvgeom.h"
1136acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#include "_cvimgproc.h"
1146acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
1156acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn// default face cascade
1166acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn//extern const char* icvDefaultFaceCascade[];
1176acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn
1186acb9a7ea3d7564944e12cbc73a857b88c1301eeMarius Renn#endif /*_CV_INTERNAL_H_*/
119