Lines Matching defs:cn
1403 int swidth, int dwidth, int cn, int xmin, int xmax ) const
1409 xofs, (const uchar*)alpha, swidth, dwidth, cn, xmin, xmax );
1419 WT t0 = S0[sx]*a0 + S0[sx + cn]*a1;
1420 WT t1 = S1[sx]*a0 + S1[sx + cn]*a1;
1438 D[dx] = S[sx]*alpha[dx*2] + S[sx+cn]*alpha[dx*2+1];
1518 int swidth, int dwidth, int cn, int xmin, int xmax ) const
1529 int j, sx = xofs[dx] - cn;
1533 int sxj = sx + j*cn;
1537 sxj += cn;
1539 sxj -= cn;
1550 D[dx] = S[sx-cn]*alpha[0] + S[sx]*alpha[1] +
1551 S[sx+cn]*alpha[2] + S[sx+cn*2]*alpha[3];
1591 int swidth, int dwidth, int cn, int xmin, int xmax ) const
1602 int j, sx = xofs[dx] - cn*3;
1606 int sxj = sx + j*cn;
1610 sxj += cn;
1612 sxj -= cn;
1623 D[dx] = S[sx-cn*3]*alpha[0] + S[sx-cn*2]*alpha[1] +
1624 S[sx-cn]*alpha[2] + S[sx]*alpha[3] +
1625 S[sx+cn]*alpha[4] + S[sx+cn*2]*alpha[5] +
1626 S[sx+cn*3]*alpha[6] + S[sx+cn*4]*alpha[7];
1708 int dy, cn = src.channels();
1750 ssize.width, dsize.width, cn, xmin, xmax );
1779 int cn = src.channels();
1780 ssize.width *= cn;
1781 dsize.width *= cn;
1782 xmin *= cn;
1783 xmax *= cn;
1807 cn(_cn), step(_step)
1818 if (cn == 1)
1835 else if (cn == 4)
1860 int cn, step;
1867 cn(_cn), step(_step)
1878 if (cn == 1)
1895 else if (cn == 4)
1910 int cn, step;
1917 cn(_cn), step(_step)
1928 if (cn == 1)
1945 else if (cn == 4)
1960 int cn, step;
1966 cn(_cn), step(_step)
1968 fast_mode = _scale_x == 2 && _scale_y == 2 && (cn == 1 || cn == 4);
1981 if (cn == 1)
1993 else if (cn == 4)
2008 int cn;
2019 cn(_cn), step(_step)
2035 if (cn == 1)
2051 else if (cn == 3)
2076 CV_Assert(cn == 4);
2109 int cn;
2118 cn(_cn), step(_step)
2137 if (cn == 1)
2153 else if (cn == 3)
2172 CV_Assert(cn == 4);
2197 int cn;
2206 cn(_cn), step(_step)
2223 if (cn == 1)
2241 else if (cn == 3)
2260 CV_Assert(cn == 4);
2283 int cn;
2291 cn(_cn), step(_step)
2293 fast_mode = _scale_x == 2 && _scale_y == 2 && (cn == 1 || cn == 4);
2307 if (cn == 1)
2323 else if (cn == 4)
2338 int cn;
2356 scale_x(_scale_x), scale_y(_scale_y), cn(_cn), step(_step), vecOp(_cn, _step)
2358 fast_mode = scale_x == 2 && scale_y == 2 && (cn == 1 || cn == 3 || cn == 4);
2369 if (cn == 1)
2375 else if (cn == 3)
2385 CV_Assert(cn == 4);
2401 int cn;
2422 int cn = src.channels();
2425 int dwidth1 = (ssize.width/scale_x)*cn;
2426 dsize.width *= cn;
2427 ssize.width *= cn;
2473 for( int sx = 0; sx < scale_x*cn; sx += cn )
2532 int cn = dst->channels();
2533 dsize.width *= cn;
2554 if( cn == 1 )
2561 else if( cn == 2 )
2571 else if( cn == 3 )
2582 else if( cn == 4 )
2604 cn; c++ )
2672 static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, DecimateAlpha* tab )
2689 tab[k].di = dx * cn;
2690 tab[k].si = (sx1 - 1) * cn;
2697 tab[k].di = dx * cn;
2698 tab[k].si = sx * cn;
2705 tab[k].di = dx * cn;
2706 tab[k].si = sx2 * cn;
2715 #define SET_IPP_RESIZE_LINEAR_FUNC_PTR(TYPE, CN) \
2716 func = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \
2722 #define SET_IPP_RESIZE_LINEAR_FUNC_64_PTR(TYPE, CN) \
2724 func = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \
2732 #define SET_IPP_RESIZE_CUBIC_FUNC_PTR(TYPE, CN) \
2733 func = (ippiResizeFunc)ippiResizeCubic_##TYPE##_##CN##R; \
2741 #define SET_IPP_RESIZE_PTR(TYPE, CN) \
2742 if (mode == (int)ippLinear) { SET_IPP_RESIZE_LINEAR_FUNC_PTR(TYPE, CN);} \
2743 else if (mode == (int)ippCubic) { SET_IPP_RESIZE_CUBIC_FUNC_PTR(TYPE, CN);} \
2798 int cn = src.channels();
2807 CHECK_IPP_STATUS(getBufferSizeFunc(pSpec, dstSize, cn, &bufsize));
2810 const Ipp8u* pSrc = src.ptr<Ipp8u>(srcOffset.y) + srcOffset.x * cn * itemSize;
2811 Ipp8u* pDst = dst.ptr<Ipp8u>(dstOffset.y) + dstOffset.x * cn * itemSize;
2883 int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
2896 if( !(cn <= 4 &&
2915 ocl::Image2D::isFormatSupported(depth, cn, true) &&
2922 "-D convertToDT=%s -D cn=%d",
2924 ocl::convertTypeStr(wdepth, depth, cn, buf[1]),
2925 cn);
2981 int wdepth = std::max(depth, CV_32S), wtype = CV_MAKETYPE(wdepth, cn);
2987 "-D WT=%s -D convertToWT=%s -D convertToDT=%s -D cn=%d "
2990 ocl::convertTypeStr(depth, wdepth, cn, buf[0]),
2991 ocl::convertTypeStr(wdepth, depth, cn, buf[1]),
2992 cn, INTER_RESIZE_COEF_BITS));
3001 int wdepth = std::max(depth, CV_32S), wtype = CV_MAKETYPE(wdepth, cn);
3004 "-D WT=%s -D convertToWT=%s -D convertToDT=%s -D cn=%d "
3007 ocl::convertTypeStr(depth, wdepth, cn, buf[0]),
3008 ocl::convertTypeStr(wdepth, depth, cn, buf[1]),
3009 cn, INTER_RESIZE_COEF_BITS));
3020 format("-D INTER_NEAREST -D T=%s -D T1=%s -D cn=%d",
3021 ocl::vecopTypeToStr(type), ocl::vecopTypeToStr(depth), cn));
3031 int wtype = CV_MAKE_TYPE(wdepth, cn);
3034 cn=%d",
3036 ocl::convertTypeStr(depth, wdepth, cn, cvt[0]), cn);
3043 int wdepth2 = std::max(CV_32F, depth), wtype2 = CV_MAKE_TYPE(wdepth2, cn);
3046 ocl::convertTypeStr(wdepth2, depth, cn, cvt[0]),
3047 ocl::typeToStr(wtype2), ocl::convertTypeStr(wdepth, wdepth2, cn, cvt[1]),
3056 buildOption = buildOption + format(" -D convertToT=%s", ocl::convertTypeStr(wdepth, depth, cn, cvt[0]));
3234 int type = src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
3262 if( mode >= 0 && (cn == 1 || cn == 3 || cn == 4) &&
3302 AutoBuffer<int> _ofs(area + dsize.width*cn);
3310 ofs[k++] = (int)(sy*srcstep + sx*cn);
3314 int j = dx * cn;
3316 for( k = 0; k < cn; k++ )
3325 CV_Assert( func != 0 && cn <= 4 );
3330 int xtab_size = computeResizeAreaTab(ssize.width, dsize.width, cn, scale_x, xtab);
3350 int xmin = 0, xmax = dsize.width, width = dsize.width*cn;
3406 for( k = 0, sx *= cn; k < cn; k++ )
3407 xofs[dx*cn + k] = sx + k;
3421 ialpha[dx*cn*ksize + k] = saturate_cast<short>(cbuf[k]*INTER_RESIZE_COEF_SCALE);
3422 for( ; k < cn*ksize; k++ )
3423 ialpha[dx*cn*ksize + k] = ialpha[dx*cn*ksize + k - ksize];
3428 alpha[dx*cn*ksize + k] = cbuf[k];
3429 for( ; k < cn*ksize; k++ )
3430 alpha[dx*cn*ksize + k] = alpha[dx*cn*ksize + k - ksize];
3489 int cn = _src.channels();
3511 if( cn == 1 )
3539 for( dx = 0; dx < dsize.width; dx++, D += cn )
3545 if( cn == 3 )
3550 else if( cn == 4 )
3557 S = S0 + sy*sstep + sx*cn;
3558 for( k = 0; k < cn; k++ )
3568 S = S0 + sy*sstep + sx*cn;
3576 S = S0 + sy*sstep + sx*cn;
3578 for( k = 0; k < cn; k++ )
3600 int cn = _src.channels(), x = 0, sstep = (int)_src.step;
3602 if( (cn != 1 && cn != 3 && cn != 4) || !checkHardwareSupport(CV_CPU_SSE2) ||
3607 const short* wtab = cn == 1 ? (const short*)_wtab : &BilinearTab_iC4[0][0][0];
3610 __m128i xy2ofs = _mm_set1_epi32(cn + (sstep << 16));
3614 if( cn == 1 )
3672 else if( cn == 3 )
3731 else if( cn == 4 )
3808 int k, cn = _src.channels();
3817 for( k = 0; k < cn; k++ )
3851 D += len*cn;
3854 if( cn == 1 )
3864 else if( cn == 2 )
3874 else if( cn == 3 )
3885 else if( cn == 4 )
3899 for( ; dx < X1; dx++, D += cn )
3903 const T* S = S0 + sy*sstep + sx*cn;
3904 for( k = 0; k < cn; k++ )
3906 WT t0 = S[k]*w[0] + S[k+cn]*w[1] + S[sstep+k]*w[2] + S[sstep+k+cn]*w[3];
3913 if( borderType == BORDER_TRANSPARENT && cn != 3 )
3915 D += (X1 - dx)*cn;
3920 if( cn == 1 )
3961 for( ; dx < X1; dx++, D += cn )
3968 for( k = 0; k < cn; k++ )
3982 v0 = S0 + sy0*sstep + sx0*cn;
3983 v1 = S0 + sy0*sstep + sx1*cn;
3984 v2 = S0 + sy1*sstep + sx0*cn;
3985 v3 = S0 + sy1*sstep + sx1*cn;
3997 v0 = sx0 >= 0 && sy0 >= 0 ? S0 + sy0*sstep + sx0*cn : &cval[0];
3998 v1 = sx1 >= 0 && sy0 >= 0 ? S0 + sy0*sstep + sx1*cn : &cval[0];
3999 v2 = sx0 >= 0 && sy1 >= 0 ? S0 + sy1*sstep + sx0*cn : &cval[0];
4000 v3 = sx1 >= 0 && sy1 >= 0 ? S0 + sy1*sstep + sx1*cn : &cval[0];
4002 for( k = 0; k < cn; k++ )
4020 int cn = _src.channels();
4046 for( dx = 0; dx < dsize.width; dx++, D += cn )
4053 const T* S = S0 + sy*sstep + sx*cn;
4054 for( k = 0; k < cn; k++ )
4056 WT sum = S[0]*w[0] + S[cn]*w[1] + S[cn*2]*w[2] + S[cn*3]*w[3];
4058 sum += S[0]*w[4] + S[cn]*w[5] + S[cn*2]*w[6] + S[cn*3]*w[7];
4060 sum += S[0]*w[8] + S[cn]*w[9] + S[cn*2]*w[10] + S[cn*3]*w[11];
4062 sum += S[0]*w[12] + S[cn]*w[13] + S[cn*2]*w[14] + S[cn*3]*w[15];
4079 for( k = 0; k < cn; k++ )
4086 x[i] = borderInterpolate(sx + i, ssize.width, borderType1)*cn;
4090 for( k = 0; k < cn; k++, S0++, w -= 16 )
4110 S0 -= cn;
4125 int cn = _src.channels();
4151 for( dx = 0; dx < dsize.width; dx++, D += cn )
4155 const T* S = S0 + sy*sstep + sx*cn;
4159 for( k = 0; k < cn; k++ )
4163 sum += S[0]*w[0] + S[cn]*w[1] + S[cn*2]*w[2] + S[cn*3]*w[3] +
4164 S[cn*4]*w[4] + S[cn*5]*w[5] + S[cn*6]*w[6] + S[cn*7]*w[7];
4182 for( k = 0; k < cn; k++ )
4189 x[i] = borderInterpolate(sx + i, ssize.width, borderType1)*cn;
4193 for( k = 0; k < cn; k++, S0++, w -= 64 )
4221 cn;
4491 int cn = _src.channels(), type = _src.type(), depth = _src.depth(),
4540 ocl::typeToStr(CV_MAKE_TYPE(wdepth, cn)),
4541 ocl::convertTypeStr(wdepth, depth, cn, cvt[0]),
4542 ocl::convertTypeStr(depth, wdepth, cn, cvt[1]),
4546 int scalarcn = cn == 3 ? 4 : cn;
4548 buildOptions += format(" -D T=%s -D T1=%s -D cn=%d -D ST=%s -D depth=%d",
4550 cn, ocl::typeToStr(sctype), depth);
4593 int type = dst.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
4596 !IPPSet(borderValue, dstRoi.ptr(), (int)dstRoi.step, dstRoiSize, cn, depth))
5468 int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
5478 (!doubleSupport && depth == CV_64F) || cn > 4)
5486 int scalarcn = cn == 3 ? 4 : cn;
5495 opts = format("-D INTER_NEAREST -D T=%s%s -D T1=%s -D ST=%s -D cn=%d -D rowsPerWI=%d",
5498 ocl::typeToStr(sctype), cn, rowsPerWI);
5504 " -D convertToWT=%s -D convertToT=%s%s -D cn=%d -D rowsPerWI=%d",
5508 ocl::typeToStr(CV_MAKE_TYPE(wdepth, cn)), depth,
5509 ocl::convertTypeStr(depth, wdepth, cn, cvt[0]),
5510 ocl::convertTypeStr(wdepth, depth, cn, cvt[1]),
5511 doubleSupport ? " -D DOUBLE_SUPPORT" : "", cn, rowsPerWI);
5612 int type = src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
5614 ( cn == 1 || cn == 3 || cn == 4 ) &&
6121 int type = src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
6123 (cn == 1 || cn == 3 || cn == 4) &&