Wondercoll
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Typedefs | Functions | Variables
cxcmp.cpp File Reference
#include "_cxcore.h"

Macros

#define ICV_DEF_IN_RANGE_CASE_C1(worktype, _toggle_macro_)
 
#define ICV_DEF_IN_RANGE_CASE_C2(worktype, _toggle_macro_)
 
#define ICV_DEF_IN_RANGE_CASE_C3(worktype, _toggle_macro_)
 
#define ICV_DEF_IN_RANGE_CASE_C4(worktype, _toggle_macro_)
 
#define ICV_DEF_IN_RANGE_FUNC(flavor, arrtype, worktype,_toggle_macro_, cn)
 
#define ICV_DEF_IN_RANGE_CASE_CONST_C1(worktype, _toggle_macro_)
 
#define ICV_DEF_IN_RANGE_CASE_CONST_C2(worktype, _toggle_macro_)
 
#define ICV_DEF_IN_RANGE_CASE_CONST_C3(worktype, _toggle_macro_)
 
#define ICV_DEF_IN_RANGE_CASE_CONST_C4(worktype, _toggle_macro_)
 
#define ICV_DEF_IN_RANGE_CONST_FUNC(flavor, arrtype, worktype,_toggle_macro_, cn)
 
#define ICV_DEF_IN_RANGE_ALL(flavor, arrtype, worktype, _toggle_macro_)
 
#define icvInRange_8s_C1R   0
 
#define icvInRange_8s_C2R   0
 
#define icvInRange_8s_C3R   0
 
#define icvInRange_8s_C4R   0
 
#define icvInRangeC_8s_C1R   0
 
#define icvInRangeC_8s_C2R   0
 
#define icvInRangeC_8s_C3R   0
 
#define icvInRangeC_8s_C4R   0
 
#define ICV_DEF_CMP_CASE_C1(__op__, _toggle_macro_)
 
#define ICV_DEF_CMP_FUNC(__op__, name, flavor, arrtype,worktype, _toggle_macro_)
 
#define ICV_DEF_CMP_CONST_CASE_C1(__op__, _toggle_macro_)
 
#define ICV_DEF_CMP_CONST_FUNC(__op__, name, flavor, arrtype,worktype, _toggle_macro_)
 
#define ICV_DEF_CMP_ALL(flavor, arrtype, worktype, _toggle_macro_)
 
#define icvCmpGT_8s_C1R   0
 
#define icvCmpEQ_8s_C1R   0
 
#define icvCmpGTC_8s_C1R   0
 
#define icvCmpGEC_8s_C1R   0
 
#define icvCmpEQC_8s_C1R   0
 
#define ICV_DEF_MINMAX_FUNC(__op__, name, flavor, arrtype, worktype, _toggle_macro_)
 
#define ICV_DEF_MINMAX_CONST_FUNC(__op__, name,flavor, arrtype, worktype, _toggle_macro_)
 
#define ICV_DEF_MINMAX_ALL(flavor, arrtype, worktype,_toggle_macro_, _min_op_, _max_op_)
 
#define icvMin_8s_C1R   0
 
#define icvMax_8s_C1R   0
 
#define icvMinC_8s_C1R   0
 
#define icvMaxC_8s_C1R   0
 
#define ICV_DEF_BIN_ABS_DIFF_2D(name, arrtype, temptype, abs_macro, cast_macro)
 
#define ICV_DEF_UN_ABS_DIFF_2D(name, arrtype, temptype, abs_macro, cast_macro)
 
#define ICV_TO_8U(x)   ((uchar)(x))
 
#define ICV_TO_16U(x)   ((ushort)(x))
 
#define ICV_INIT_MINI_FUNC_TAB_2D(FUNCNAME, suffix)
 

Typedefs

typedef CvStatus(CV_STDCALLCvInRangeCFunc )(const void *src, int srcstep, uchar *dst, int dststep, CvSize size, const void *scalar)
 

Functions

CV_IMPL void cvInRange (const void *srcarr1, const void *srcarr2, const void *srcarr3, void *dstarr)
 
CV_IMPL void cvInRangeS (const void *srcarr, CvScalar lower, CvScalar upper, void *dstarr)
 
CV_IMPL void cvCmp (const void *srcarr1, const void *srcarr2, void *dstarr, int cmp_op)
 
CV_IMPL void cvCmpS (const void *srcarr, double value, void *dstarr, int cmp_op)
 
CV_IMPL void cvMin (const void *srcarr1, const void *srcarr2, void *dstarr)
 
CV_IMPL void cvMax (const void *srcarr1, const void *srcarr2, void *dstarr)
 
CV_IMPL void cvMinS (const void *srcarr, double value, void *dstarr)
 
CV_IMPL void cvMaxS (const void *srcarr, double value, void *dstarr)
 
CV_IMPL void cvAbsDiff (const void *srcarr1, const void *srcarr2, void *dstarr)
 
CV_IMPL void cvAbsDiffS (const void *srcarr, void *dstarr, CvScalar scalar)
 

Variables

icvCompare_8u_C1R_t icvCompare_8u_C1R_p = 0
 
icvCompare_16s_C1R_t icvCompare_16s_C1R_p = 0
 
icvCompare_32f_C1R_t icvCompare_32f_C1R_p = 0
 
icvCompareC_8u_C1R_t icvCompareC_8u_C1R_p = 0
 
icvCompareC_16s_C1R_t icvCompareC_16s_C1R_p = 0
 
icvCompareC_32f_C1R_t icvCompareC_32f_C1R_p = 0
 
icvThreshold_GT_8u_C1R_t icvThreshold_GT_8u_C1R_p = 0
 
icvThreshold_GT_16s_C1R_t icvThreshold_GT_16s_C1R_p = 0
 
icvThreshold_GT_32f_C1R_t icvThreshold_GT_32f_C1R_p = 0
 
icvThreshold_LT_8u_C1R_t icvThreshold_LT_8u_C1R_p = 0
 
icvThreshold_LT_16s_C1R_t icvThreshold_LT_16s_C1R_p = 0
 
icvThreshold_LT_32f_C1R_t icvThreshold_LT_32f_C1R_p = 0
 

Macro Definition Documentation

#define ICV_DEF_BIN_ABS_DIFF_2D (   name,
  arrtype,
  temptype,
  abs_macro,
  cast_macro 
)
#define ICV_DEF_CMP_ALL (   flavor,
  arrtype,
  worktype,
  _toggle_macro_ 
)
Value:
ICV_DEF_CMP_FUNC( CV_GT, CmpGT, flavor, arrtype, worktype, _toggle_macro_ ) \
ICV_DEF_CMP_FUNC( CV_EQ, CmpEQ, flavor, arrtype, worktype, _toggle_macro_ ) \
ICV_DEF_CMP_CONST_FUNC( CV_GT, CmpGT, flavor, arrtype, worktype, _toggle_macro_)\
ICV_DEF_CMP_CONST_FUNC( CV_GE, CmpGE, flavor, arrtype, worktype, _toggle_macro_)\
ICV_DEF_CMP_CONST_FUNC( CV_EQ, CmpEQ, flavor, arrtype, worktype, _toggle_macro_)
#define ICV_DEF_CMP_CASE_C1 (   __op__,
  _toggle_macro_ 
)
Value:
for( x = 0; x <= size.width - 4; x += 4 ) \
{ \
int f0 = __op__( _toggle_macro_(src1[x]), _toggle_macro_(src2[x])); \
int f1 = __op__( _toggle_macro_(src1[x+1]), _toggle_macro_(src2[x+1])); \
dst[x] = (uchar)-f0; \
dst[x+1] = (uchar)-f1; \
f0 = __op__( _toggle_macro_(src1[x+2]), _toggle_macro_(src2[x+2])); \
f1 = __op__( _toggle_macro_(src1[x+3]), _toggle_macro_(src2[x+3])); \
dst[x+2] = (uchar)-f0; \
dst[x+3] = (uchar)-f1; \
} \
for( ; x < size.width; x++ ) \
{ \
int f0 = __op__( _toggle_macro_(src1[x]), _toggle_macro_(src2[x])); \
dst[x] = (uchar)-f0; \
}
#define ICV_DEF_CMP_CONST_CASE_C1 (   __op__,
  _toggle_macro_ 
)
Value:
for( x = 0; x <= size.width - 4; x += 4 ) \
{ \
int f0 = __op__( _toggle_macro_(src1[x]), scalar ); \
int f1 = __op__( _toggle_macro_(src1[x+1]), scalar ); \
dst[x] = (uchar)-f0; \
dst[x+1] = (uchar)-f1; \
f0 = __op__( _toggle_macro_(src1[x+2]), scalar ); \
f1 = __op__( _toggle_macro_(src1[x+3]), scalar ); \
dst[x+2] = (uchar)-f0; \
dst[x+3] = (uchar)-f1; \
} \
for( ; x < size.width; x++ ) \
{ \
int f0 = __op__( _toggle_macro_(src1[x]), scalar ); \
dst[x] = (uchar)-f0; \
}
#define ICV_DEF_CMP_CONST_FUNC (   __op__,
  name,
  flavor,
  arrtype,
  worktype,
  _toggle_macro_ 
)
Value:
static CvStatus CV_STDCALL \
icv##name##C_##flavor##_C1R( const arrtype* src1, int step1, \
uchar* dst, int step, \
CvSize size, worktype* pScalar ) \
{ \
worktype scalar = *pScalar; \
step1 /= sizeof(src1[0]); step /= sizeof(dst[0]); \
for( ; size.height--; src1 += step1, dst += step ) \
{ \
int x; \
ICV_DEF_CMP_CONST_CASE_C1( __op__, _toggle_macro_ ) \
} \
\
return CV_OK; \
}
#define ICV_DEF_CMP_FUNC (   __op__,
  name,
  flavor,
  arrtype,
  worktype,
  _toggle_macro_ 
)
Value:
static CvStatus CV_STDCALL \
icv##name##_##flavor##_C1R( const arrtype* src1, int step1, \
const arrtype* src2, int step2, \
uchar* dst, int step, CvSize size ) \
{ \
step1 /= sizeof(src1[0]); step2 /= sizeof(src2[0]); \
step /= sizeof(dst[0]); \
for( ; size.height--; src1 += step1, src2 += step2, \
dst += step ) \
{ \
int x; \
ICV_DEF_CMP_CASE_C1( __op__, _toggle_macro_ ) \
} \
\
return CV_OK; \
}
#define ICV_DEF_IN_RANGE_ALL (   flavor,
  arrtype,
  worktype,
  _toggle_macro_ 
)
Value:
ICV_DEF_IN_RANGE_FUNC( flavor, arrtype, worktype, _toggle_macro_, 1 ) \
ICV_DEF_IN_RANGE_FUNC( flavor, arrtype, worktype, _toggle_macro_, 2 ) \
ICV_DEF_IN_RANGE_FUNC( flavor, arrtype, worktype, _toggle_macro_, 3 ) \
ICV_DEF_IN_RANGE_FUNC( flavor, arrtype, worktype, _toggle_macro_, 4 ) \
ICV_DEF_IN_RANGE_CONST_FUNC( flavor, arrtype, worktype, _toggle_macro_, 1 ) \
ICV_DEF_IN_RANGE_CONST_FUNC( flavor, arrtype, worktype, _toggle_macro_, 2 ) \
ICV_DEF_IN_RANGE_CONST_FUNC( flavor, arrtype, worktype, _toggle_macro_, 3 ) \
ICV_DEF_IN_RANGE_CONST_FUNC( flavor, arrtype, worktype, _toggle_macro_, 4 )
#define ICV_DEF_IN_RANGE_CASE_C1 (   worktype,
  _toggle_macro_ 
)
Value:
for( x = 0; x < size.width; x++ ) \
{ \
worktype a1 = _toggle_macro_(src1[x]), \
a2 = src2[x], a3 = src3[x]; \
dst[x] = (uchar)-(_toggle_macro_(a2) <= a1 && \
a1 < _toggle_macro_(a3)); \
}
#define ICV_DEF_IN_RANGE_CASE_C2 (   worktype,
  _toggle_macro_ 
)
Value:
for( x = 0; x < size.width; x++ ) \
{ \
worktype a1 = _toggle_macro_(src1[x*2]), \
a2 = src2[x*2], a3 = src3[x*2]; \
int f = _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
a1 = _toggle_macro_(src1[x*2+1]); \
a2 = src2[x*2+1]; \
a3 = src3[x*2+1]; \
f &= _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
dst[x] = (uchar)-f; \
}
#define ICV_DEF_IN_RANGE_CASE_C3 (   worktype,
  _toggle_macro_ 
)
Value:
for( x = 0; x < size.width; x++ ) \
{ \
worktype a1 = _toggle_macro_(src1[x*3]), \
a2 = src2[x*3], a3 = src3[x*3]; \
int f = _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
a1 = _toggle_macro_(src1[x*3+1]); \
a2 = src2[x*3+1]; \
a3 = src3[x*3+1]; \
f &= _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
a1 = _toggle_macro_(src1[x*3+2]); \
a2 = src2[x*3+2]; \
a3 = src3[x*3+2]; \
f &= _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
dst[x] = (uchar)-f; \
}
#define ICV_DEF_IN_RANGE_CASE_C4 (   worktype,
  _toggle_macro_ 
)
Value:
for( x = 0; x < size.width; x++ ) \
{ \
worktype a1 = _toggle_macro_(src1[x*4]), \
a2 = src2[x*4], a3 = src3[x*4]; \
int f = _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
a1 = _toggle_macro_(src1[x*4+1]); \
a2 = src2[x*4+1]; \
a3 = src3[x*4+1]; \
f &= _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
a1 = _toggle_macro_(src1[x*4+2]); \
a2 = src2[x*4+2]; \
a3 = src3[x*4+2]; \
f &= _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
a1 = _toggle_macro_(src1[x*4+3]); \
a2 = src2[x*4+3]; \
a3 = src3[x*4+3]; \
f &= _toggle_macro_(a2) <= a1 && a1 < _toggle_macro_(a3); \
dst[x] = (uchar)-f; \
}
#define ICV_DEF_IN_RANGE_CASE_CONST_C1 (   worktype,
  _toggle_macro_ 
)
Value:
for( x = 0; x < size.width; x++ ) \
{ \
worktype a1 = _toggle_macro_(src1[x]); \
dst[x] = (uchar)-(scalar[0] <= a1 && a1 < scalar[1]); \
}
#define ICV_DEF_IN_RANGE_CASE_CONST_C2 (   worktype,
  _toggle_macro_ 
)
Value:
for( x = 0; x < size.width; x++ ) \
{ \
worktype a1 = _toggle_macro_(src1[x*2]); \
int f = scalar[0] <= a1 && a1 < scalar[2]; \
a1 = _toggle_macro_(src1[x*2+1]); \
f &= scalar[1] <= a1 && a1 < scalar[3]; \
dst[x] = (uchar)-f; \
}
#define ICV_DEF_IN_RANGE_CASE_CONST_C3 (   worktype,
  _toggle_macro_ 
)
Value:
for( x = 0; x < size.width; x++ ) \
{ \
worktype a1 = _toggle_macro_(src1[x*3]); \
int f = scalar[0] <= a1 && a1 < scalar[3]; \
a1 = _toggle_macro_(src1[x*3+1]); \
f &= scalar[1] <= a1 && a1 < scalar[4]; \
a1 = _toggle_macro_(src1[x*3+2]); \
f &= scalar[2] <= a1 && a1 < scalar[5]; \
dst[x] = (uchar)-f; \
}
#define ICV_DEF_IN_RANGE_CASE_CONST_C4 (   worktype,
  _toggle_macro_ 
)
Value:
for( x = 0; x < size.width; x++ ) \
{ \
worktype a1 = _toggle_macro_(src1[x*4]); \
int f = scalar[0] <= a1 && a1 < scalar[4]; \
a1 = _toggle_macro_(src1[x*4+1]); \
f &= scalar[1] <= a1 && a1 < scalar[5]; \
a1 = _toggle_macro_(src1[x*4+2]); \
f &= scalar[2] <= a1 && a1 < scalar[6]; \
a1 = _toggle_macro_(src1[x*4+3]); \
f &= scalar[3] <= a1 && a1 < scalar[7]; \
dst[x] = (uchar)-f; \
}
#define ICV_DEF_IN_RANGE_CONST_FUNC (   flavor,
  arrtype,
  worktype,
  _toggle_macro_,
  cn 
)
Value:
static CvStatus CV_STDCALL \
icvInRangeC_##flavor##_C##cn##R( const arrtype* src1, int step1, \
uchar* dst, int step, CvSize size, \
const worktype* scalar ) \
{ \
step1 /= sizeof(src1[0]); step /= sizeof(dst[0]); \
for( ; size.height--; src1 += step1, dst += step ) \
{ \
int x; \
ICV_DEF_IN_RANGE_CASE_CONST_C##cn( worktype, _toggle_macro_)\
} \
\
return CV_OK; \
}
#define ICV_DEF_IN_RANGE_FUNC (   flavor,
  arrtype,
  worktype,
  _toggle_macro_,
  cn 
)
Value:
static CvStatus CV_STDCALL \
icvInRange_##flavor##_C##cn##R( const arrtype* src1, int step1, \
const arrtype* src2, int step2, \
const arrtype* src3, int step3, \
uchar* dst, int step, CvSize size ) \
{ \
step1 /= sizeof(src1[0]); step2 /= sizeof(src2[0]); \
step3 /= sizeof(src3[0]); step /= sizeof(dst[0]); \
for( ; size.height--; src1 += step1, src2 += step2, \
src3 += step3, dst += step ) \
{ \
int x; \
ICV_DEF_IN_RANGE_CASE_C##cn( worktype, _toggle_macro_ ) \
} \
\
return CV_OK; \
}
#define ICV_DEF_MINMAX_ALL (   flavor,
  arrtype,
  worktype,
  _toggle_macro_,
  _min_op_,
  _max_op_ 
)
Value:
ICV_DEF_MINMAX_FUNC( _min_op_, Min, flavor, arrtype, worktype, _toggle_macro_ ) \
ICV_DEF_MINMAX_FUNC( _max_op_, Max, flavor, arrtype, worktype, _toggle_macro_ ) \
ICV_DEF_MINMAX_CONST_FUNC(_min_op_, Min, flavor, arrtype, worktype, _toggle_macro_)\
ICV_DEF_MINMAX_CONST_FUNC(_max_op_, Max, flavor, arrtype, worktype, _toggle_macro_)
#define ICV_DEF_MINMAX_CONST_FUNC (   __op__,
  name,
  flavor,
  arrtype,
  worktype,
  _toggle_macro_ 
)
#define ICV_DEF_MINMAX_FUNC (   __op__,
  name,
  flavor,
  arrtype,
  worktype,
  _toggle_macro_ 
)
#define ICV_DEF_UN_ABS_DIFF_2D (   name,
  arrtype,
  temptype,
  abs_macro,
  cast_macro 
)
#define ICV_INIT_MINI_FUNC_TAB_2D (   FUNCNAME,
  suffix 
)
Value:
static void icvInit##FUNCNAME##Table( CvFuncTable* tab ) \
{ \
tab->fn_2d[CV_8U] = (void*)icv##FUNCNAME##_8u_##suffix; \
tab->fn_2d[CV_16U] = (void*)icv##FUNCNAME##_16u_##suffix; \
tab->fn_2d[CV_16S] = (void*)icv##FUNCNAME##_16s_##suffix; \
tab->fn_2d[CV_32S] = (void*)icv##FUNCNAME##_32s_##suffix; \
tab->fn_2d[CV_32F] = (void*)icv##FUNCNAME##_32f_##suffix; \
tab->fn_2d[CV_64F] = (void*)icv##FUNCNAME##_64f_##suffix; \
}
#define ICV_TO_16U (   x)    ((ushort)(x))
#define ICV_TO_8U (   x)    ((uchar)(x))
#define icvCmpEQ_8s_C1R   0
#define icvCmpEQC_8s_C1R   0
#define icvCmpGEC_8s_C1R   0
#define icvCmpGT_8s_C1R   0
#define icvCmpGTC_8s_C1R   0
#define icvInRange_8s_C1R   0
#define icvInRange_8s_C2R   0
#define icvInRange_8s_C3R   0
#define icvInRange_8s_C4R   0
#define icvInRangeC_8s_C1R   0
#define icvInRangeC_8s_C2R   0
#define icvInRangeC_8s_C3R   0
#define icvInRangeC_8s_C4R   0
#define icvMax_8s_C1R   0
#define icvMaxC_8s_C1R   0
#define icvMin_8s_C1R   0
#define icvMinC_8s_C1R   0

Typedef Documentation

typedef CvStatus(CV_STDCALL * CvInRangeCFunc)(const void *src, int srcstep, uchar *dst, int dststep, CvSize size, const void *scalar)

Function Documentation

CV_IMPL void cvAbsDiff ( const void *  srcarr1,
const void *  srcarr2,
void *  dstarr 
)
CV_IMPL void cvAbsDiffS ( const void *  srcarr,
void *  dstarr,
CvScalar  scalar 
)
CV_IMPL void cvCmp ( const void *  srcarr1,
const void *  srcarr2,
void *  dstarr,
int  cmp_op 
)
CV_IMPL void cvCmpS ( const void *  srcarr,
double  value,
void *  dstarr,
int  cmp_op 
)
CV_IMPL void cvInRange ( const void *  srcarr1,
const void *  srcarr2,
const void *  srcarr3,
void *  dstarr 
)
CV_IMPL void cvInRangeS ( const void *  srcarr,
CvScalar  lower,
CvScalar  upper,
void *  dstarr 
)
CV_IMPL void cvMax ( const void *  srcarr1,
const void *  srcarr2,
void *  dstarr 
)
CV_IMPL void cvMaxS ( const void *  srcarr,
double  value,
void *  dstarr 
)
CV_IMPL void cvMin ( const void *  srcarr1,
const void *  srcarr2,
void *  dstarr 
)
CV_IMPL void cvMinS ( const void *  srcarr,
double  value,
void *  dstarr 
)

Variable Documentation

icvCompare_16s_C1R_t icvCompare_16s_C1R_p = 0
icvCompare_32f_C1R_t icvCompare_32f_C1R_p = 0
icvCompare_8u_C1R_t icvCompare_8u_C1R_p = 0
icvCompareC_16s_C1R_t icvCompareC_16s_C1R_p = 0
icvCompareC_32f_C1R_t icvCompareC_32f_C1R_p = 0
icvCompareC_8u_C1R_t icvCompareC_8u_C1R_p = 0
icvThreshold_GT_16s_C1R_t icvThreshold_GT_16s_C1R_p = 0
icvThreshold_GT_32f_C1R_t icvThreshold_GT_32f_C1R_p = 0
icvThreshold_GT_8u_C1R_t icvThreshold_GT_8u_C1R_p = 0
icvThreshold_LT_16s_C1R_t icvThreshold_LT_16s_C1R_p = 0
icvThreshold_LT_32f_C1R_t icvThreshold_LT_32f_C1R_p = 0
icvThreshold_LT_8u_C1R_t icvThreshold_LT_8u_C1R_p = 0