From 261546f6f619bb5c77cad529e8114bdc16b5f508 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Tue, 11 Feb 2014 23:27:19 +0400 Subject: [PATCH] casting Vec3b operator for viz::Color --- modules/viz/include/opencv2/viz/types.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/viz/include/opencv2/viz/types.hpp b/modules/viz/include/opencv2/viz/types.hpp index acbece2edf..3e8e87c65e 100644 --- a/modules/viz/include/opencv2/viz/types.hpp +++ b/modules/viz/include/opencv2/viz/types.hpp @@ -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); }