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

Macros

#define ICV_SUM_COI_CASE(__op__, len, cn)
 
#define ICV_SUM_CASE_C1(__op__, len)   ICV_SUM_COI_CASE( __op__, len, 1 )
 
#define ICV_SUM_CASE_C2(__op__, len)
 
#define ICV_SUM_CASE_C3(__op__, len)
 
#define ICV_SUM_CASE_C4(__op__, len)
 
#define ICV_SUM_ENTRY_COMMON()   step /= sizeof(src[0])
 
#define ICV_SUM_ENTRY_C1(sumtype)
 
#define ICV_SUM_ENTRY_C2(sumtype)
 
#define ICV_SUM_ENTRY_C3(sumtype)
 
#define ICV_SUM_ENTRY_C4(sumtype)
 
#define ICV_SUM_ENTRY_BLOCK_COMMON(block_size)
 
#define ICV_SUM_ENTRY_BLOCK_C1(sumtype, worktype, block_size)
 
#define ICV_SUM_ENTRY_BLOCK_C2(sumtype, worktype, block_size)
 
#define ICV_SUM_ENTRY_BLOCK_C3(sumtype, worktype, block_size)
 
#define ICV_SUM_ENTRY_BLOCK_C4(sumtype, worktype, block_size)
 
#define ICV_SUM_EXIT_C1(tmp, sumtype)   sum[0] = (sumtype)tmp##0
 
#define ICV_SUM_EXIT_C2(tmp, sumtype)
 
#define ICV_SUM_EXIT_C3(tmp, sumtype)
 
#define ICV_SUM_EXIT_C4(tmp, sumtype)
 
#define ICV_SUM_EXIT_BLOCK_C1(sumtype)
 
#define ICV_SUM_EXIT_BLOCK_C2(sumtype)
 
#define ICV_SUM_EXIT_BLOCK_C3(sumtype)
 
#define ICV_SUM_EXIT_BLOCK_C4(sumtype)
 
#define ICV_SUM_UPDATE_COMMON(block_size)   remaining = block_size
 
#define ICV_SUM_UPDATE_C1(block_size)
 
#define ICV_SUM_UPDATE_C2(block_size)
 
#define ICV_SUM_UPDATE_C3(block_size)
 
#define ICV_SUM_UPDATE_C4(block_size)
 
#define ICV_DEF_SUM_NOHINT_BLOCK_FUNC_2D(name, flavor, cn,__op__, arrtype, sumtype_final, sumtype, worktype, block_size)
 
#define ICV_DEF_SUM_NOHINT_FUNC_2D(name, flavor, cn,__op__, arrtype, sumtype_final, sumtype, worktype, block_size)
 
#define ICV_DEF_SUM_HINT_FUNC_2D(name, flavor, cn,__op__, arrtype, sumtype_final, sumtype, worktype, block_size)
 
#define ICV_DEF_SUM_NOHINT_BLOCK_FUNC_2D_COI(name, flavor,__op__, arrtype, sumtype_final, sumtype, worktype, block_size)
 
#define ICV_DEF_SUM_NOHINT_FUNC_2D_COI(name, flavor,__op__, arrtype, sumtype_final, sumtype, worktype, block_size)
 
#define ICV_DEF_SUM_ALL(name, flavor, __op__, arrtype, sumtype_final, sumtype, worktype, hintp_type, nohint_type, block_size)
 
#define icvSum_8s_C1R   0
 
#define icvSum_8s_C2R   0
 
#define icvSum_8s_C3R   0
 
#define icvSum_8s_C4R   0
 
#define icvSum_8s_CnCR   0
 
#define ICV_DEF_NONZERO_ALL(flavor, __op__, arrtype)
 
#define CV_NONZERO_DBL(x)   (((x) & CV_BIG_INT(0x7fffffffffffffff)) != 0)
 
#define icvCountNonZero_8s_C1R   icvCountNonZero_8u_C1R
 
#define icvCountNonZero_8s_CnCR   icvCountNonZero_8u_CnCR
 
#define icvCountNonZero_16u_C1R   icvCountNonZero_16s_C1R
 
#define icvCountNonZero_16u_CnCR   icvCountNonZero_16s_CnCR
 
#define ICV_ACC_ROWS_FUNC(name, flavor, arrtype, acctype,__op__, load_macro)
 
#define ICV_ACC_COLS_FUNC_C1(name, flavor, arrtype, worktype, acctype, __op__)
 
#define ICV_ACC_COLS_FUNC_C3(name, flavor, arrtype, worktype, acctype, __op__)
 
#define ICV_ACC_COLS_FUNC_C4(name, flavor, arrtype, worktype, acctype, __op__)
 

Typedefs

typedef int srcstep
 
typedef int void * dst
 
typedef int void CvSize size = cvGetMatSize( mat )
 
typedef int void int dststep
 

Functions

 ICV_DEF_SUM_ALL (Sum, 8u, CV_NOP, uchar, double, int64, unsigned, NOHINT_BLOCK, NOHINT_BLOCK, 1<< 24) ICV_DEF_SUM_ALL(Sum
 
 if (CV_IS_MAT_CONT(mat->type))
 
 if (CV_MAT_CN(type)==1||coi==0)
 
 if (!func) CV_ERROR(CV_StsBadArg
 
 IPPI_CALL (func(mat->data.ptr, mat_step, size, CV_MAT_CN(type), coi, sum.val))
 
CV_IMPL int cvCountNonZero (const CvArr *arr)
 
typedef CvStatus (CV_STDCALL *CvReduceToRowFunc)(const void *src
 
CV_IMPL void cvReduce (const CvArr *srcarr, CvArr *dstarr, int dim, int op)
 

Variables

 CV_NOP
 
 ushort
 
 double
 
 int64
 
 unsigned
 
 NOHINT_BLOCK
 
<< 16) ICV_DEF_SUM_ALL(Sum, 16s, CV_NOP, short, double, int64, int, NOHINT_BLOCK, NOHINT_BLOCK, 1<< 16)#defineicvSum_8s_C1R#defineicvSum_8s_C2R#defineicvSum_8s_C3R#defineicvSum_8s_C4R#defineicvSum_8s_CnCRCV_IMPLCvScalarcvSum(constCvArr *arr){staticCvBigFuncTablesum_tab;staticCvFuncTablesumcoi_tab;staticintinittab=0;CvScalarsum={{0, 0, 0, 0}};CV_FUNCNAME("cvSum");__BEGIN__;inttype, coi=0;intmat_step;CvSizesize;CvMatstub,*mat=(CvMat *) arr;if(!inittab){icvInitSumRTable(&sum_tab);icvInitSumCnCRTable(&sumcoi_tab);inittab=1;}if(!CV_IS_MAT(mat)){if(CV_IS_MATND(mat)){void *matnd=(void *) mat;CvMatNDnstub;CvNArrayIteratoriterator;intpass_hint;CV_CALL(cvInitNArrayIterator(1,&matnd, 0,&nstub,&iterator));type=CV_MAT_TYPE(iterator.hdr[0]->type);if(CV_MAT_CN(type)>4) CV_ERROR(CV_StsOutOfRange,"Theinputarraymusthaveatmost4channels");pass_hint=CV_MAT_DEPTH(type)==CV_32F;if(!pass_hint){CvFunc2D_1A1Pfunc=(CvFunc2D_1A1P)(sum_tab.fn_2d[type]);if(!func) CV_ERROR(CV_StsUnsupportedFormat,"");do{CvScalartemp={{0, 0, 0, 0}};IPPI_CALL(func(iterator.ptr[0], CV_STUB_STEP, iterator.size, temp.val));sum.val[0]+=temp.val[0];sum.val[1]+=temp.val[1];sum.val[2]+=temp.val[2];sum.val[3]+=temp.val[3];}while(cvNextNArraySlice(&iterator));}else{CvFunc2D_1A1P1Ifunc=(CvFunc2D_1A1P1I)(sum_tab.fn_2d[type]);if(!func) CV_ERROR(CV_StsUnsupportedFormat,"");do{CvScalartemp={{0, 0, 0, 0}};IPPI_CALL(func(iterator.ptr[0], CV_STUB_STEP, iterator.size, temp.val, cvAlgHintAccurate));sum.val[0]+=temp.val[0];sum.val[1]+=temp.val[1];sum.val[2]+=temp.val[2];sum.val[3]+=temp.val[3];}while(cvNextNArraySlice(&iterator));}EXIT;}elseCV_CALL(mat=cvGetMat(mat,&stub,&coi));}type=CV_MAT_TYPE(mat-> type
 
 mat_step = mat->step
 
 else
 
 cvUnsupportedFormat
 
 __END__
 
return sum
 

Macro Definition Documentation

#define CV_NONZERO_DBL (   x)    (((x) & CV_BIG_INT(0x7fffffffffffffff)) != 0)
#define ICV_ACC_COLS_FUNC_C1 (   name,
  flavor,
  arrtype,
  worktype,
  acctype,
  __op__ 
)
#define ICV_ACC_COLS_FUNC_C3 (   name,
  flavor,
  arrtype,
  worktype,
  acctype,
  __op__ 
)
Value:
static CvStatus CV_STDCALL \
icv##name##Cols_##flavor##_C3R( const arrtype* src, int srcstep, \
acctype* dst, int dststep, CvSize size )\
{ \
int i, width = size.width*3; \
srcstep /= sizeof(src[0]); \
dststep /= sizeof(dst[0]); \
for( ; size.height--; src += srcstep, dst += dststep ) \
{ \
worktype a0 = src[0], a1 = src[1], a2 = src[2]; \
for( i = 3; i < width; i += 3 ) \
{ \
worktype s0 = src[i], s1 = src[i+1], s2 = src[i+2]; \
a0 = __op__(a0, s0); \
a1 = __op__(a1, s1); \
a2 = __op__(a2, s2); \
} \
\
dst[0] = (acctype)a0; \
dst[1] = (acctype)a1; \
dst[2] = (acctype)a2; \
} \
\
return CV_OK; \
}
#define ICV_ACC_COLS_FUNC_C4 (   name,
  flavor,
  arrtype,
  worktype,
  acctype,
  __op__ 
)
Value:
static CvStatus CV_STDCALL \
icv##name##Cols_##flavor##_C4R( const arrtype* src, int srcstep, \
acctype* dst, int dststep, CvSize size )\
{ \
int i, width = size.width*4; \
srcstep /= sizeof(src[0]); \
dststep /= sizeof(dst[0]); \
for( ; size.height--; src += srcstep, dst += dststep ) \
{ \
worktype a0 = src[0], a1 = src[1], a2 = src[2], a3 = src[3]; \
for( i = 4; i < width; i += 4 ) \
{ \
worktype s0 = src[i], s1 = src[i+1]; \
a0 = __op__(a0, s0); \
a1 = __op__(a1, s1); \
s0 = src[i+2]; s1 = src[i+3]; \
a2 = __op__(a2, s0); \
a3 = __op__(a3, s1); \
} \
\
dst[0] = (acctype)a0; \
dst[1] = (acctype)a1; \
dst[2] = (acctype)a2; \
dst[3] = (acctype)a3; \
} \
\
return CV_OK; \
}
#define ICV_ACC_ROWS_FUNC (   name,
  flavor,
  arrtype,
  acctype,
  __op__,
  load_macro 
)
#define ICV_DEF_NONZERO_ALL (   flavor,
  __op__,
  arrtype 
)
Value:
ICV_DEF_SUM_NOHINT_FUNC_2D( CountNonZero, flavor, 1, __op__, \
arrtype, int, int, int, 0 ) \
ICV_DEF_SUM_NOHINT_FUNC_2D_COI( CountNonZero, flavor, __op__, \
arrtype, int, int, int, 0 )
#define ICV_DEF_SUM_ALL (   name,
  flavor,
  __op__,
  arrtype,
  sumtype_final,
  sumtype,
  worktype,
  hintp_type,
  nohint_type,
  block_size 
)
Value:
ICV_DEF_SUM_##hintp_type##_FUNC_2D( name, flavor, 1, __op__, arrtype, \
sumtype_final, sumtype, worktype, block_size ) \
ICV_DEF_SUM_##hintp_type##_FUNC_2D( name, flavor, 2, __op__, arrtype, \
sumtype_final, sumtype, worktype, block_size ) \
ICV_DEF_SUM_##hintp_type##_FUNC_2D( name, flavor, 3, __op__, arrtype, \
sumtype_final, sumtype, worktype, block_size ) \
ICV_DEF_SUM_##hintp_type##_FUNC_2D( name, flavor, 4, __op__, arrtype, \
sumtype_final, sumtype, worktype, block_size ) \
ICV_DEF_SUM_##nohint_type##_FUNC_2D_COI( name, flavor, __op__, arrtype, \
sumtype_final, sumtype, worktype, block_size )
#define ICV_DEF_SUM_HINT_FUNC_2D (   name,
  flavor,
  cn,
  __op__,
  arrtype,
  sumtype_final,
  sumtype,
  worktype,
  block_size 
)
Value:
IPCVAPI_IMPL(CvStatus, icv##name##_##flavor##_C##cn##R,( \
const arrtype* src, int step, CvSize size, \
sumtype_final* sum, CvHintAlgorithm /*hint*/ ), \
(src, step, size, sum, cvAlgHintAccurate) ) \
{ \
ICV_SUM_ENTRY_C##cn( sumtype ); \
size.width *= cn; \
for( ; size.height--; src += step ) \
{ \
int x = 0; \
ICV_SUM_CASE_C##cn( __op__, size.width ); \
} \
\
ICV_SUM_EXIT_C##cn( s, sumtype_final ); \
return CV_OK; \
}
#define ICV_DEF_SUM_NOHINT_BLOCK_FUNC_2D (   name,
  flavor,
  cn,
  __op__,
  arrtype,
  sumtype_final,
  sumtype,
  worktype,
  block_size 
)
Value:
IPCVAPI_IMPL(CvStatus, icv##name##_##flavor##_C##cn##R,( \
const arrtype* src, int step, CvSize size, \
sumtype_final* sum ), (src, step, size, sum) ) \
{ \
ICV_SUM_ENTRY_BLOCK_C##cn(sumtype,worktype,(block_size)*(cn)); \
size.width *= cn; \
for( ; size.height--; src += step ) \
{ \
int x = 0; \
while( x < size.width ) \
{ \
int limit = MIN( remaining, size.width - x ); \
remaining -= limit; \
limit += x; \
ICV_SUM_CASE_C##cn( __op__, limit ); \
if( remaining == 0 ) \
{ \
ICV_SUM_UPDATE_C##cn( (block_size)*(cn) ); \
} \
} \
} \
\
ICV_SUM_EXIT_BLOCK_C##cn( sumtype_final ); \
return CV_OK; \
}
#define ICV_DEF_SUM_NOHINT_BLOCK_FUNC_2D_COI (   name,
  flavor,
  __op__,
  arrtype,
  sumtype_final,
  sumtype,
  worktype,
  block_size 
)
Value:
static CvStatus CV_STDCALL icv##name##_##flavor##_CnCR( \
const arrtype* src, int step, CvSize size, int cn, \
int coi, sumtype_final* sum ) \
{ \
ICV_SUM_ENTRY_BLOCK_C1(sumtype,worktype,(block_size)*(cn)); \
size.width *= cn; \
src += coi - 1; \
for( ; size.height--; src += step ) \
{ \
int x = 0; \
while( x < size.width ) \
{ \
int limit = MIN( remaining, size.width - x ); \
remaining -= limit; \
limit += x; \
ICV_SUM_COI_CASE( __op__, limit, cn ); \
if( remaining == 0 ) \
{ \
ICV_SUM_UPDATE_C1( (block_size)*(cn) ); \
} \
} \
} \
ICV_SUM_EXIT_BLOCK_C1( sumtype_final ); \
return CV_OK; \
}
#define ICV_DEF_SUM_NOHINT_FUNC_2D (   name,
  flavor,
  cn,
  __op__,
  arrtype,
  sumtype_final,
  sumtype,
  worktype,
  block_size 
)
Value:
IPCVAPI_IMPL(CvStatus, icv##name##_##flavor##_C##cn##R,( \
const arrtype* src, int step, CvSize size, \
sumtype_final* sum ), (src, step, size, sum) ) \
{ \
ICV_SUM_ENTRY_C##cn( sumtype ); \
size.width *= cn; \
for( ; size.height--; src += step ) \
{ \
int x = 0; \
ICV_SUM_CASE_C##cn( __op__, size.width ); \
} \
\
ICV_SUM_EXIT_C##cn( s, sumtype_final ); \
return CV_OK; \
}
#define ICV_DEF_SUM_NOHINT_FUNC_2D_COI (   name,
  flavor,
  __op__,
  arrtype,
  sumtype_final,
  sumtype,
  worktype,
  block_size 
)
Value:
static CvStatus CV_STDCALL icv##name##_##flavor##_CnCR( \
const arrtype* src, int step, CvSize size, int cn, \
int coi, sumtype_final* sum ) \
{ \
ICV_SUM_ENTRY_C1( sumtype ); \
size.width *= cn; \
src += coi - 1; \
for( ; size.height--; src += step ) \
{ \
int x = 0; \
ICV_SUM_COI_CASE( __op__, size.width, cn ); \
} \
ICV_SUM_EXIT_C1( s, sumtype_final ); \
return CV_OK; \
}
#define ICV_SUM_CASE_C1 (   __op__,
  len 
)    ICV_SUM_COI_CASE( __op__, len, 1 )
#define ICV_SUM_CASE_C2 (   __op__,
  len 
)
Value:
for( ; x <= (len) - 8; x += 8 ) \
{ \
s0 += __op__(src[x]) + __op__(src[x+2]) + \
__op__(src[x+4]) + __op__(src[x+6]); \
s1 += __op__(src[x+1]) + __op__(src[x+3]) + \
__op__(src[x+5]) + __op__(src[x+7]); \
} \
for( ; x < (len); x += 2 ) \
{ \
s0 += __op__(src[x]); \
s1 += __op__(src[x+1]); \
}
#define ICV_SUM_CASE_C3 (   __op__,
  len 
)
Value:
for( ; x <= (len) - 12; x += 12 ) \
{ \
s0 += __op__(src[x]) + __op__(src[x+3]) + \
__op__(src[x+6]) + __op__(src[x+9]); \
s1 += __op__(src[x+1]) + __op__(src[x+4]) + \
__op__(src[x+7]) + __op__(src[x+10]); \
s2 += __op__(src[x+2]) + __op__(src[x+5]) + \
__op__(src[x+8]) + __op__(src[x+11]); \
} \
for( ; x < (len); x += 3 ) \
{ \
s0 += __op__(src[x]); \
s1 += __op__(src[x+1]); \
s2 += __op__(src[x+2]); \
}
#define ICV_SUM_CASE_C4 (   __op__,
  len 
)
Value:
for( ; x <= (len) - 16; x += 16 ) \
{ \
s0 += __op__(src[x]) + __op__(src[x+4]) + \
__op__(src[x+8]) + __op__(src[x+12]); \
s1 += __op__(src[x+1]) + __op__(src[x+5]) + \
__op__(src[x+9]) + __op__(src[x+13]); \
s2 += __op__(src[x+2]) + __op__(src[x+6]) + \
__op__(src[x+10]) + __op__(src[x+14]); \
s3 += __op__(src[x+3]) + __op__(src[x+7]) + \
__op__(src[x+11]) + __op__(src[x+15]); \
} \
for( ; x < (len); x += 4 ) \
{ \
s0 += __op__(src[x]); \
s1 += __op__(src[x+1]); \
s2 += __op__(src[x+2]); \
s3 += __op__(src[x+3]); \
}
#define ICV_SUM_COI_CASE (   __op__,
  len,
  cn 
)
Value:
for( ; x <= (len) - 4*(cn); x += 4*(cn) ) \
s0 += __op__(src[x]) + __op__(src[x+(cn)]) + \
__op__(src[x+(cn)*2]) + __op__(src[x+(cn)*3]);\
for( ; x < (len); x += (cn) ) \
s0 += __op__(src[x]);
#define ICV_SUM_ENTRY_BLOCK_C1 (   sumtype,
  worktype,
  block_size 
)
Value:
sumtype sum0 = 0; \
worktype s0 = 0; \
ICV_SUM_ENTRY_BLOCK_COMMON( block_size )
#define ICV_SUM_ENTRY_BLOCK_C2 (   sumtype,
  worktype,
  block_size 
)
Value:
sumtype sum0 = 0, sum1 = 0; \
worktype s0 = 0, s1 = 0; \
ICV_SUM_ENTRY_BLOCK_COMMON( block_size )
#define ICV_SUM_ENTRY_BLOCK_C3 (   sumtype,
  worktype,
  block_size 
)
Value:
sumtype sum0 = 0, sum1 = 0, sum2 = 0; \
worktype s0 = 0, s1 = 0, s2 = 0; \
ICV_SUM_ENTRY_BLOCK_COMMON( block_size )
#define ICV_SUM_ENTRY_BLOCK_C4 (   sumtype,
  worktype,
  block_size 
)
Value:
sumtype sum0 = 0, sum1 = 0, sum2 = 0, sum3 = 0; \
worktype s0 = 0, s1 = 0, s2 = 0, s3 = 0; \
ICV_SUM_ENTRY_BLOCK_COMMON( block_size )
#define ICV_SUM_ENTRY_BLOCK_COMMON (   block_size)
Value:
int remaining = block_size; \
ICV_SUM_ENTRY_COMMON()
#define ICV_SUM_ENTRY_C1 (   sumtype)
Value:
sumtype s0 = 0; \
ICV_SUM_ENTRY_COMMON()
#define ICV_SUM_ENTRY_C2 (   sumtype)
Value:
sumtype s0 = 0, s1 = 0; \
ICV_SUM_ENTRY_COMMON()
#define ICV_SUM_ENTRY_C3 (   sumtype)
Value:
sumtype s0 = 0, s1 = 0, s2 = 0; \
ICV_SUM_ENTRY_COMMON()
#define ICV_SUM_ENTRY_C4 (   sumtype)
Value:
sumtype s0 = 0, s1 = 0, s2 = 0, s3 = 0; \
ICV_SUM_ENTRY_COMMON()
#define ICV_SUM_ENTRY_COMMON ( )    step /= sizeof(src[0])
#define ICV_SUM_EXIT_BLOCK_C1 (   sumtype)
Value:
sum0 += s0; \
ICV_SUM_EXIT_C1( sum, sumtype )
#define ICV_SUM_EXIT_BLOCK_C2 (   sumtype)
Value:
sum0 += s0; sum1 += s1; \
ICV_SUM_EXIT_C2( sum, sumtype )
#define ICV_SUM_EXIT_BLOCK_C3 (   sumtype)
Value:
sum0 += s0; sum1 += s1; \
sum2 += s2; \
ICV_SUM_EXIT_C3( sum, sumtype )
#define ICV_SUM_EXIT_BLOCK_C4 (   sumtype)
Value:
sum0 += s0; sum1 += s1; \
sum2 += s2; sum3 += s3; \
ICV_SUM_EXIT_C4( sum, sumtype )
#define ICV_SUM_EXIT_C1 (   tmp,
  sumtype 
)    sum[0] = (sumtype)tmp##0
#define ICV_SUM_EXIT_C2 (   tmp,
  sumtype 
)
Value:
sum[0] = (sumtype)tmp##0; \
sum[1] = (sumtype)tmp##1;
#define ICV_SUM_EXIT_C3 (   tmp,
  sumtype 
)
Value:
sum[0] = (sumtype)tmp##0; \
sum[1] = (sumtype)tmp##1; \
sum[2] = (sumtype)tmp##2;
#define ICV_SUM_EXIT_C4 (   tmp,
  sumtype 
)
Value:
sum[0] = (sumtype)tmp##0; \
sum[1] = (sumtype)tmp##1; \
sum[2] = (sumtype)tmp##2; \
sum[3] = (sumtype)tmp##3;
#define ICV_SUM_UPDATE_C1 (   block_size)
Value:
sum0 += s0; \
s0 = 0
#define ICV_SUM_UPDATE_C2 (   block_size)
Value:
sum0 += s0; sum1 += s1; \
s0 = s1 = 0
#define ICV_SUM_UPDATE_C3 (   block_size)
Value:
sum0 += s0; sum1 += s1; sum2 += s2; \
s0 = s1 = s2 = 0
#define ICV_SUM_UPDATE_C4 (   block_size)
Value:
sum0 += s0; sum1 += s1; \
sum2 += s2; sum3 += s3; \
s0 = s1 = s2 = s3 = 0
#define ICV_SUM_UPDATE_COMMON (   block_size)    remaining = block_size
#define icvCountNonZero_16u_C1R   icvCountNonZero_16s_C1R
#define icvCountNonZero_16u_CnCR   icvCountNonZero_16s_CnCR
#define icvCountNonZero_8s_C1R   icvCountNonZero_8u_C1R
#define icvCountNonZero_8s_CnCR   icvCountNonZero_8u_CnCR
#define icvSum_8s_C1R   0
#define icvSum_8s_C2R   0
#define icvSum_8s_C3R   0
#define icvSum_8s_C4R   0
#define icvSum_8s_CnCR   0

Typedef Documentation

typedef int void* dst
typedef int void int dststep
typedef int void int CvSize size = cvGetMatSize( mat )
typedef int srcstep

Function Documentation

CV_IMPL int cvCountNonZero ( const CvArr arr)
CV_IMPL void cvReduce ( const CvArr srcarr,
CvArr dstarr,
int  dim,
int  op 
)
typedef CvStatus ( CV_STDCALL CvReduceToRowFunc) const
ICV_DEF_SUM_ALL ( Sum  ,
8u  ,
CV_NOP  ,
uchar  ,
double  ,
int64  ,
unsigned  ,
NOHINT_BLOCK  ,
NOHINT_BLOCK  ,
1<<  24 
)
if ( CV_IS_MAT_CONT(mat->type )
if ( CV_MAT_CN(type = = 1 || coi == 0)
if ( func)
IPPI_CALL ( func(mat->data.ptr, mat_step, size, CV_MAT_CN(type), coi, sum.val)  )

Variable Documentation

__END__
CV_NOP
cvUnsupportedFormat
double
else
Initial value:
mat_step = mat->step
NOHINT_BLOCK
return sum
<<16)ICV_DEF_SUM_ALL(Sum,16s,CV_NOP,short,double,int64,int,NOHINT_BLOCK,NOHINT_BLOCK,1<<16)#defineicvSum_8s_C1R#defineicvSum_8s_C2R#defineicvSum_8s_C3R#defineicvSum_8s_C4R#defineicvSum_8s_CnCRCV_IMPLCvScalarcvSum(constCvArr*arr){staticCvBigFuncTablesum_tab;staticCvFuncTablesumcoi_tab;staticintinittab=0;CvScalarsum={{0,0,0,0}};CV_FUNCNAME("cvSum");__BEGIN__;inttype,coi=0;intmat_step;CvSizesize;CvMatstub,*mat=(CvMat*)arr;if(!inittab){icvInitSumRTable(&sum_tab);icvInitSumCnCRTable(&sumcoi_tab);inittab=1;}if(!CV_IS_MAT(mat)){if(CV_IS_MATND(mat)){void*matnd=(void*)mat;CvMatNDnstub;CvNArrayIteratoriterator;intpass_hint;CV_CALL(cvInitNArrayIterator(1,&matnd,0,&nstub,&iterator));type=CV_MAT_TYPE(iterator.hdr[0]->type);if(CV_MAT_CN(type)>4)CV_ERROR(CV_StsOutOfRange,"Theinputarraymusthaveatmost4channels");pass_hint=CV_MAT_DEPTH(type)==CV_32F;if(!pass_hint){CvFunc2D_1A1Pfunc=(CvFunc2D_1A1P)(sum_tab.fn_2d[type]);if(!func)CV_ERROR(CV_StsUnsupportedFormat,"");do{CvScalartemp={{0,0,0,0}};IPPI_CALL(func(iterator.ptr[0],CV_STUB_STEP,iterator.size,temp.val));sum.val[0]+=temp.val[0];sum.val[1]+=temp.val[1];sum.val[2]+=temp.val[2];sum.val[3]+=temp.val[3];}while(cvNextNArraySlice(&iterator));}else{CvFunc2D_1A1P1Ifunc=(CvFunc2D_1A1P1I)(sum_tab.fn_2d[type]);if(!func)CV_ERROR(CV_StsUnsupportedFormat,"");do{CvScalartemp={{0,0,0,0}};IPPI_CALL(func(iterator.ptr[0],CV_STUB_STEP,iterator.size,temp.val,cvAlgHintAccurate));sum.val[0]+=temp.val[0];sum.val[1]+=temp.val[1];sum.val[2]+=temp.val[2];sum.val[3]+=temp.val[3];}while(cvNextNArraySlice(&iterator));}EXIT;}elseCV_CALL(mat=cvGetMat(mat,&stub,&coi));}type=CV_MAT_TYPE(mat-> type
unsigned