?? cxtypes.h
字號:
//////////////////////////////////////////////////////////////////////////////////////////// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.//// By downloading, copying, installing or using the software you agree to this license.// If you do not agree to this license, do not download, install,// copy or use the software.////// License For Embedded Computer Vision Library//// Copyright (c) 2008, EMCV Project,// Copyright (c) 2000-2007, Intel Corporation,// All rights reserved.// Third party copyrights are property of their respective owners.//// Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met://// * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer.// * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution.// * Neither the name of the copyright holders nor the names of their contributors // may be used to endorse or promote products derived from this software // without specific prior written permission.//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY // OF SUCH DAMAGE.//// Contributors:// * Shiqi Yu (Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences)#ifndef _CXCORE_TYPES_H_#define _CXCORE_TYPES_H_#if !defined _CRT_SECURE_NO_DEPRECATE && _MSC_VER > 1300#define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio 2005 warnings */#endif#ifndef SKIP_INCLUDES #include <assert.h> #include <stdlib.h> #include <string.h> #include <float.h> #if defined __ICL #define CV_ICC __ICL #elif defined __ICC #define CV_ICC __ICC #elif defined __ECL #define CV_ICC __ECL #elif defined __ECC #define CV_ICC __ECC #endif #if defined WIN64 && defined EM64T && (defined _MSC_VER || defined CV_ICC) \ || defined __SSE2__ || defined _MM_SHUFFLE2 #include <emmintrin.h> #define CV_SSE2 1 #else #define CV_SSE2 0 #endif #if defined __BORLANDC__ #include <fastmath.h> #elif defined WIN64 && !defined EM64T && defined CV_ICC #include <mathimf.h> #else #include <math.h> #endif #ifdef HAVE_IPL #ifndef __IPL_H__ #if defined WIN32 || defined WIN64 #include <ipl.h> #else #include <ipl/ipl.h> #endif #endif #elif defined __IPL_H__ #define HAVE_IPL #endif#endif // SKIP_INCLUDES#if defined WIN32 || defined WIN64 #define CV_CDECL __cdecl #define CV_STDCALL __stdcall#else #define CV_CDECL #define CV_STDCALL#endif#ifndef CV_EXTERN_C #ifdef __cplusplus #define CV_EXTERN_C extern "C" #define CV_DEFAULT(val) = val #else #define CV_EXTERN_C #define CV_DEFAULT(val) #endif#endif#ifndef CV_EXTERN_C_FUNCPTR #ifdef __cplusplus #define CV_EXTERN_C_FUNCPTR(x) extern "C" { typedef x; } #else #define CV_EXTERN_C_FUNCPTR(x) typedef x #endif#endif#ifndef CV_INLINE#if defined __cplusplus #define CV_INLINE inline#elif (defined WIN32 || defined WIN64) && !defined __GNUC__ #define CV_INLINE __inline#else #define CV_INLINE static#endif#endif /* CV_INLINE */#if (defined WIN32 || defined WIN64) && defined CVAPI_EXPORTS #define CV_EXPORTS __declspec(dllexport)#else #define CV_EXPORTS#endif#ifndef CVAPI #define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL#endif
#if defined _MSC_VER || defined __BORLANDC__
typedef __int64 int64;
typedef unsigned __int64 uint64;
#else
typedef long long int64;
typedef unsigned long long uint64;
#endif
#ifndef HAVE_IPLtypedef unsigned char uchar;typedef unsigned short ushort;#endif/* CvArr* is used to pass arbitrary array-like data structures into the functions where the particular array type is recognized at runtime */typedef void CvArr;typedef union Cv32suf{ int i; unsigned u; float f;}Cv32suf;
typedef union Cv64suf
{
int64 i;
uint64 u;
double f;
}
Cv64suf;/****************************************************************************************\* Common macros and inline functions *\****************************************************************************************/#define CV_PI 3.1415926535897932384626433832795#define CV_LOG2 0.69314718055994530941723212145818#define CV_SWAP(a,b,t) ((t) = (a), (a) = (b), (b) = (t))#ifndef MIN#define MIN(a,b) ((a) > (b) ? (b) : (a))#endif#ifndef MAX#define MAX(a,b) ((a) < (b) ? (b) : (a))#endif/* min & max without jumps */#define CV_IMIN(a, b) ((a) ^ (((a)^(b)) & (((a) < (b)) - 1)))#define CV_IMAX(a, b) ((a) ^ (((a)^(b)) & (((a) > (b)) - 1)))/* absolute value without jumps */#ifndef __cplusplus#define CV_IABS(a) (((a) ^ ((a) < 0 ? -1 : 0)) - ((a) < 0 ? -1 : 0))#else#define CV_IABS(a) abs(a)#endif#define CV_CMP(a,b) (((a) > (b)) - ((a) < (b)))#define CV_SIGN(a) CV_CMP((a),0)CV_INLINE int cvRound( double value ){ return int(floor(value+0.5));}CV_INLINE int cvFloor( double value ){ return int(floor(value));}CV_INLINE int cvCeil( double value ){ return int(ceil(value));}#define cvInvSqrt(value) ((float)(1./sqrt(value)))#define cvSqrt(value) ((float)sqrt(value))/****************************************************************************************\* Image type (IplImage) *\****************************************************************************************/#ifndef HAVE_IPL/* * The following definitions (until #endif) * is an extract from IPL headers. * Copyright (c) 1995 Intel Corporation. */#define IPL_DEPTH_SIGN 0x80000000#define IPL_DEPTH_1U 1#define IPL_DEPTH_8U 8#define IPL_DEPTH_16U 16#define IPL_DEPTH_32F 32#define IPL_DEPTH_8S (IPL_DEPTH_SIGN| 8)#define IPL_DEPTH_16S (IPL_DEPTH_SIGN|16)#define IPL_DEPTH_32S (IPL_DEPTH_SIGN|32)#define IPL_DATA_ORDER_PIXEL 0#define IPL_DATA_ORDER_PLANE 1#define IPL_ORIGIN_TL 0#define IPL_ORIGIN_BL 1#define IPL_ALIGN_4BYTES 4#define IPL_ALIGN_8BYTES 8#define IPL_ALIGN_16BYTES 16#define IPL_ALIGN_32BYTES 32#define IPL_ALIGN_DWORD IPL_ALIGN_4BYTES#define IPL_ALIGN_QWORD IPL_ALIGN_8BYTES#define IPL_BORDER_CONSTANT 0#define IPL_BORDER_REPLICATE 1#define IPL_BORDER_REFLECT 2#define IPL_BORDER_WRAP 3typedef struct _IplImage{ int nSize; /* sizeof(IplImage) */ int ID; /* version (=0)*/ int nChannels; /* Most of OpenCV functions support 1,2,3 or 4 channels */ int alphaChannel; /* ignored by OpenCV */ int depth; /* pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S, IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported */ char colorModel[4]; /* ignored by OpenCV */ char channelSeq[4]; /* ditto */ int dataOrder; /* 0 - interleaved color channels, 1 - separate color channels. cvCreateImage can only create interleaved images */ int origin; /* 0 - top-left origin, 1 - bottom-left origin (Windows bitmaps style) */ int align; /* Alignment of image rows (4 or 8). OpenCV ignores it and uses widthStep instead */ int width; /* image width in pixels */ int height; /* image height in pixels */ struct _IplROI *roi;/* image ROI. if NULL, the whole image is selected */ struct _IplImage *maskROI; /* must be NULL */ void *imageId; /* ditto */ struct _IplTileInfo *tileInfo; /* ditto */ int imageSize; /* image data size in bytes (==image->height*image->widthStep in case of interleaved data)*/ char *imageData; /* pointer to aligned image data */ int widthStep; /* size of aligned image row in bytes */ int BorderMode[4]; /* ignored by OpenCV */ int BorderConst[4]; /* ditto */ char *imageDataOrigin; /* pointer to very origin of image data (not necessarily aligned) - needed for correct deallocation */}IplImage;typedef struct _IplTileInfo IplTileInfo;typedef struct _IplROI{ int coi; /* 0 - no COI (all channels are selected), 1 - 0th channel is selected ...*/ int xOffset; int yOffset; int width; int height;}IplROI;typedef struct _IplConvKernel{ int nCols; int nRows; int anchorX; int anchorY; int *values; int nShiftR;}IplConvKernel;typedef struct _IplConvKernelFP{ int nCols; int nRows; int anchorX; int anchorY; float *values;}IplConvKernelFP;#define IPL_IMAGE_HEADER 1#define IPL_IMAGE_DATA 2#define IPL_IMAGE_ROI 4#endif/*HAVE_IPL*//* extra border mode */#define IPL_BORDER_REFLECT_101 4#define IPL_IMAGE_MAGIC_VAL ((int)sizeof(IplImage))#define CV_TYPE_NAME_IMAGE "opencv-image"#define CV_IS_IMAGE_HDR(img) \ ((img) != NULL && ((const IplImage*)(img))->nSize == sizeof(IplImage))#define CV_IS_IMAGE(img) \ (CV_IS_IMAGE_HDR(img) && ((IplImage*)img)->imageData != NULL)/* for storing double-precision floating point data in IplImage's */#define IPL_DEPTH_64F 64/* get reference to pixel at (col,row), for multi-channel images (col) should be multiplied by number of channels */#define CV_IMAGE_ELEM( image, elemtype, row, col ) \ (((elemtype*)((image)->imageData + (image)->widthStep*(row)))[(col)])/****************************************************************************************\* Matrix type (CvMat) *\****************************************************************************************/#define CV_CN_MAX 64#define CV_CN_SHIFT 3#define CV_DEPTH_MAX (1 << CV_CN_SHIFT)#define CV_8U 0#define CV_8S 1#define CV_16U 2#define CV_16S 3#define CV_32S 4#define CV_32F 5#define CV_64F 6#define CV_USRTYPE1 7#define CV_MAKETYPE(depth,cn) ((depth) + (((cn)-1) << CV_CN_SHIFT))#define CV_MAKE_TYPE CV_MAKETYPE#define CV_8UC1 CV_MAKETYPE(CV_8U,1)#define CV_8UC2 CV_MAKETYPE(CV_8U,2)#define CV_8UC3 CV_MAKETYPE(CV_8U,3)#define CV_8UC4 CV_MAKETYPE(CV_8U,4)#define CV_8UC(n) CV_MAKETYPE(CV_8U,(n))#define CV_8SC1 CV_MAKETYPE(CV_8S,1)#define CV_8SC2 CV_MAKETYPE(CV_8S,2)#define CV_8SC3 CV_MAKETYPE(CV_8S,3)#define CV_8SC4 CV_MAKETYPE(CV_8S,4)#define CV_8SC(n) CV_MAKETYPE(CV_8S,(n))#define CV_16UC1 CV_MAKETYPE(CV_16U,1)#define CV_16UC2 CV_MAKETYPE(CV_16U,2)#define CV_16UC3 CV_MAKETYPE(CV_16U,3)#define CV_16UC4 CV_MAKETYPE(CV_16U,4)#define CV_16UC(n) CV_MAKETYPE(CV_16U,(n))#define CV_16SC1 CV_MAKETYPE(CV_16S,1)#define CV_16SC2 CV_MAKETYPE(CV_16S,2)#define CV_16SC3 CV_MAKETYPE(CV_16S,3)#define CV_16SC4 CV_MAKETYPE(CV_16S,4)#define CV_16SC(n) CV_MAKETYPE(CV_16S,(n))#define CV_32SC1 CV_MAKETYPE(CV_32S,1)#define CV_32SC2 CV_MAKETYPE(CV_32S,2)#define CV_32SC3 CV_MAKETYPE(CV_32S,3)#define CV_32SC4 CV_MAKETYPE(CV_32S,4)#define CV_32SC(n) CV_MAKETYPE(CV_32S,(n))#define CV_32FC1 CV_MAKETYPE(CV_32F,1)#define CV_32FC2 CV_MAKETYPE(CV_32F,2)#define CV_32FC3 CV_MAKETYPE(CV_32F,3)#define CV_32FC4 CV_MAKETYPE(CV_32F,4)#define CV_32FC(n) CV_MAKETYPE(CV_32F,(n))
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -