extended Mat::setTo() to support multi-channel arrays; fixed bug #1095

This commit is contained in:
Vadim Pisarevsky
2011-06-13 20:56:27 +00:00
parent 07217b17bf
commit 6407093463
5 changed files with 68 additions and 116 deletions

View File

@@ -194,6 +194,19 @@ static inline IppiSize ippiSize(Size _sz) { IppiSize sz = { _sz.wid
#define IF_IPP(then_call, else_call) else_call
#endif
inline bool checkScalar(const Mat& sc, int atype, int sckind, int akind)
{
if( sc.dims > 2 || (sc.cols != 1 && sc.rows != 1) || !sc.isContinuous() )
return false;
int cn = CV_MAT_CN(atype);
if( akind == _InputArray::MATX && sckind != _InputArray::MATX )
return false;
return sc.size() == Size(1, 1) || sc.size() == Size(1, cn) || sc.size() == Size(cn, 1) ||
(sc.size() == Size(1, 4) && sc.type() == CV_64F && cn <= 4);
}
void convertAndUnrollScalar( const Mat& sc, int buftype, uchar* scbuf, size_t blocksize );
}
#endif /*_CXCORE_INTERNAL_H_*/