|
#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__) |
|
|
| 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) |
|
|
| 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 |
|