casting Vec3b operator for viz::Color

This commit is contained in:
Anatoly Baksheev 2014-02-11 23:27:19 +04:00
parent f1c062c30a
commit 261546f6f6

View File

@ -63,6 +63,8 @@ namespace cv
Color(const Scalar& color);
operator Vec3b() const;
static Color black();
static Color blue();
static Color green();
@ -193,6 +195,8 @@ inline cv::viz::Color::Color(double _gray) : Scalar(_gray, _gray, _gray) {}
inline cv::viz::Color::Color(double _blue, double _green, double _red) : Scalar(_blue, _green, _red) {}
inline cv::viz::Color::Color(const Scalar& color) : Scalar(color) {}
inline cv::viz::Color::operator cv::Vec3b() const { return cv::Vec3d(val); }
inline cv::viz::Color cv::viz::Color::black() { return Color( 0, 0, 0); }
inline cv::viz::Color cv::viz::Color::green() { return Color( 0, 255, 0); }
inline cv::viz::Color cv::viz::Color::blue() { return Color(255, 0, 0); }