你看一下就会很清楚了。
typedef struct CvScalar
{
double val[4];
}
CvScalar;
CV_INLINE CvScalar
cvScalar( double val0, double val1 CV_DEFAULT(0),
double val2 CV_DEFAULT(0), double val3 CV_DEFAULT(0))
{
CvScalar scalar;
scalar.val[0] = val0; scalar.val[1] = val1;
scalar.val[2] = val2; scalar.val[3] = val3;
return scalar;
}
CV_INLINE CvScalar
cvRealScalar( double val0 )
{
CvScalar scalar;
scalar.val[0] = val0;
scalar.val[1] = scalar.val[2] = scalar.val[3] = 0;
return scalar;
}
CV_INLINE CvScalar
cvScalarAll( double val0123 )
{
CvScalar scalar;
scalar.val[0] = val0123;
scalar.val[1] = val0123;
scalar.val[2] = val0123;
scalar.val[3] = val0123;
return scalar;
}