_ipcv.h.svn-base
来自「非结构化路识别」· SVN-BASE 代码 · 共 1,074 行 · 第 1/5 页
SVN-BASE
1,074 行
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, 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:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's 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.
//
// * The name of Intel Corporation may not 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 Intel Corporation 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.
//
//M*/
#ifndef __IPCV_H_
#define __IPCV_H_
/****************************************************************************************\
* Allocation/Deallocation *
\****************************************************************************************/
IPCVAPI( void*, icvAllocEx, ( size_t size, const char* file, int line ))
IPCVAPI( CVStatus, icvFreeEx, ( void** ptr, const char* file, int line ))
/****************************************************************************************\
* Copy/Set *
\****************************************************************************************/
IPCVAPI( CvStatus, icvCopy_8u_C1R, ( const uchar* src, int src_step,
uchar* dst, int dst_step, CvSize size ))
IPCVAPI( CvStatus, icvSet_8u_C1R, ( uchar* dst, int dst_step, CvSize size,
const void* scalar, int pix_size ))
IPCVAPI( CvStatus, icvSetZero_8u_C1R, ( uchar* dst, int dst_step, CvSize size ))
#define IPCV_CVT_TO( flavor ) \
IPCVAPI( CvStatus, icvCvtTo_##flavor##_C1R, ( const void* src, int step1, \
void* dst, int step, CvSize size, int param ))
IPCV_CVT_TO( 8u )
IPCV_CVT_TO( 8s )
IPCV_CVT_TO( 16s )
IPCV_CVT_TO( 32s )
IPCV_CVT_TO( 32f )
IPCV_CVT_TO( 64f )
#undef IPCV_CVT_TO
IPCVAPI( CvStatus, icvCvt_32f64f, ( const float* src, double* dst, int len ))
IPCVAPI( CvStatus, icvCvt_64f32f, ( const double* src, float* dst, int len ))
/* dst(idx) = src(idx)*a + b */
IPCVAPI( CvStatus, icvScale_32f, ( const float* src, float* dst,
int len, float a, float b ))
IPCVAPI( CvStatus, icvScale_64f, ( const double* src, double* dst,
int len, double a, double b ))
/****************************************************************************************\
* Arithmetics *
\****************************************************************************************/
#define IPCV_BIN_ARITHM_NON_MASK( name ) \
IPCVAPI( CvStatus, icv##name##_8u_C1R, \
( const uchar* src1, int srcstep1, const uchar* src2, int srcstep2, \
uchar* dst, int dststep, CvSize size )) \
IPCVAPI( CvStatus, icv##name##_8s_C1R, \
( const char* src1, int srcstep1, const char* src2, int srcstep2, \
char* dst, int dststep, CvSize size )) \
IPCVAPI( CvStatus, icv##name##_16s_C1R, \
( const short* src1, int srcstep1, const short* src2, int srcstep2, \
short* dst, int dststep, CvSize size )) \
IPCVAPI( CvStatus, icv##name##_32s_C1R, \
( const int* src1, int srcstep1, const int* src2, int srcstep2, \
int* dst, int dststep, CvSize size )) \
IPCVAPI( CvStatus, icv##name##_32f_C1R, \
( const float* src1, int srcstep1, const float* src2, int srcstep2, \
float* dst, int dststep, CvSize size )) \
IPCVAPI( CvStatus, icv##name##_64f_C1R, \
( const double* src1, int srcstep1, const double* src2, int srcstep2,\
double* dst, int dststep, CvSize size ))
#define IPCV_UN_ARITHM_NON_MASK( name ) \
IPCVAPI( CvStatus, icv##name##_8u_C1R, \
( const uchar* src, int srcstep, uchar* dst, int dststep, \
CvSize size, const int* scalar )) \
IPCVAPI( CvStatus, icv##name##_8s_C1R, \
( const char* src, int srcstep, char* dst, int dststep, \
CvSize size, const int* scalar )) \
IPCVAPI( CvStatus, icv##name##_16s_C1R, \
( const short* src, int srcstep, short* dst, int dststep, \
CvSize size, const int* scalar )) \
IPCVAPI( CvStatus, icv##name##_32s_C1R, \
( const int* src, int srcstep, int* dst, int dststep, \
CvSize size, const int* scalar )) \
IPCVAPI( CvStatus, icv##name##_32f_C1R, \
( const float* src, int srcstep, float* dst, int dststep, \
CvSize size, const float* scalar )) \
IPCVAPI( CvStatus, icv##name##_64f_C1R, \
( const double* src, int srcstep, double* dst, int dststep, \
CvSize size, const double* scalar ))
IPCV_BIN_ARITHM_NON_MASK( Add )
IPCV_BIN_ARITHM_NON_MASK( Sub )
IPCV_UN_ARITHM_NON_MASK( AddC )
IPCV_UN_ARITHM_NON_MASK( SubRC )
#undef IPCV_BIN_ARITHM_NON_MASK
#undef IPCV_UN_ARITHM_NON_MASK
#define IPCV_MUL( flavor, arrtype ) \
IPCVAPI( CvStatus, icvMul_##flavor##_C1R, \
( const arrtype* src1, int step1, const arrtype* src2, int step2, \
arrtype* dst, int step, CvSize size, double scale ))
IPCV_MUL( 8u, uchar )
IPCV_MUL( 8s, char )
IPCV_MUL( 16s, short )
IPCV_MUL( 32s, int )
IPCV_MUL( 32f, float )
IPCV_MUL( 64f, double )
#undef IPCV_MUL
/****************************************************************************************\
* Logical operations *
\****************************************************************************************/
#define IPCV_LOGIC( name ) \
IPCVAPI( CvStatus, icv##name##_8u_C1R, \
( const uchar* src1, int srcstep1, const uchar* src2, int srcstep2, \
uchar* dst, int dststep, CvSize size )) \
IPCVAPI( CvStatus, icv##name##C_8u_C1R, \
( const uchar* src1, int srcstep1, uchar* dst, int dststep, \
CvSize, const uchar* scalar, int pix_size ))
IPCV_LOGIC( And )
IPCV_LOGIC( Or )
IPCV_LOGIC( Xor )
#undef IPCV_LOGIC
IPCVAPI( CvStatus, icvNot_8u_C1R,
( const uchar* src, int step1, uchar* dst, int step, CvSize size ))
/****************************************************************************************\
* Image Statistics *
\****************************************************************************************/
///////////////////////////////////////// Mean //////////////////////////////////////////
#define IPCV_DEF_MEAN_MASK( flavor, srctype ) \
IPCVAPI( CvStatus, icvMean_##flavor##_C1MR, ( const srctype* img, int imgstep, \
const uchar* mask, int maskStep, \
CvSize size, double* mean )) \
IPCVAPI( CvStatus, icvMean_##flavor##_C2MR, ( const srctype* img, int imgstep, \
const uchar* mask, int maskStep, \
CvSize size, double* mean )) \
IPCVAPI( CvStatus, icvMean_##flavor##_C3MR, ( const srctype* img, int imgstep, \
const uchar* mask, int maskStep, \
CvSize size, double* mean )) \
IPCVAPI( CvStatus, icvMean_##flavor##_C4MR, ( const srctype* img, int imgstep, \
const uchar* mask, int maskStep, \
CvSize size, double* mean )) \
IPCVAPI( CvStatus, icvMean_##flavor##_CnCMR, ( const srctype* img, int imgstep, \
const uchar* mask, int maskStep, \
CvSize size, int cn, \
int coi, double* mean))
IPCV_DEF_MEAN_MASK( 8u, uchar )
IPCV_DEF_MEAN_MASK( 8s, char )
IPCV_DEF_MEAN_MASK( 16s, short )
IPCV_DEF_MEAN_MASK( 32s, int )
IPCV_DEF_MEAN_MASK( 32f, float )
IPCV_DEF_MEAN_MASK( 64f, double )
#undef IPCV_DEF_MEAN_MASK
//////////////////////////////////// Mean_StdDev ////////////////////////////////////////
#define IPCV_DEF_MEAN_SDV( flavor, srctype ) \
IPCVAPI( CvStatus, icvMean_StdDev_##flavor##_C1R,( const srctype* img, int imgstep, \
CvSize size, double* mean, double* sdv )) \
IPCVAPI( CvStatus, icvMean_StdDev_##flavor##_C2R, ( const srctype* img, int imgstep, \
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?