diff include/cvutils.hpp @ 131:3a11dba30655

added colors
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 17 Aug 2011 19:03:11 -0400
parents 536510f60854
children 47329bd16cc0
line wrap: on
line diff
--- a/include/cvutils.hpp	Wed Aug 17 17:30:30 2011 -0400
+++ b/include/cvutils.hpp	Wed Aug 17 19:03:11 2011 -0400
@@ -7,7 +7,6 @@
 class CvCapture;
 
 /// constant that indicates if the image should be flipped
-
 //static const int flipImage = CV_CVTIMG_FLIP;
 
 void keyPoints2Points(const std::vector<cv::KeyPoint>& kpts, std::vector<cv::Point2f>& pts, const bool& clearPts = true);
@@ -22,4 +21,24 @@
     Returns the frame number that was reached.*/
 int goToFrameNum(CvCapture* inputVideo, const int& currentFrameNum, const int& targetFrameNum);
 
+/// Pre-defined colors
+class Colors {
+public:
+  static const int nColors = 8;
+  static const cv::Scalar color[];
+
+  static cv::Scalar black(void);
+  static cv::Scalar red(void);
+  static cv::Scalar green(void);
+  static cv::Scalar blue(void);
+  static cv::Scalar white(void);
+  static cv::Scalar magenta(void);
+  static cv::Scalar cyan(void);
+  static cv::Scalar yellow(void);
+
+  /** Maps integers to primary colors. */
+  static cv::Scalar color3(const int& num);
+  static cv::Scalar color8(const int& num);
+};
+
 #endif