47 #ifndef _MIRA_IMGPIXEL_H_ 48 #define _MIRA_IMGPIXEL_H_ 50 #include <opencv2/core/core.hpp> 64 template<
typename T,
int Channels>
92 operator cv::Scalar()
const {
93 return (cv::Scalar)
v;
97 cv::Vec<T, Channels>
v;
109 template<
typename T,
int Channels>
179 this->
v[0] = (T) (c.
b * 255.0f);
180 this->
v[1] = (T) (c.
g * 255.0f);
181 this->
v[2] = (T) (c.
r * 255.0f);
205 cv::Scalar c = color;
217 namespace mira {
namespace detail {
227 template<
typename T,
int Channels,
230 public cv::DataType<cv::Vec<T, Channels> > {
233 template<
typename T,
int Channels>
235 public cv::DataType<cv::Vec<T, Channels> > {
237 typedef cv::DataType<cv::Vec<T, Channels> > Base;
239 enum { depth = cv::DataType<typename Base::channel_type>::depth };
244 template<
typename T,
int Channels,
250 template<
typename T,
int Channels>
256 enum {
type = CV_MAKETYPE(Base::depth, Base::channels) };
263 template<
typename T,
int Channels>
264 class DataType<mira::ImgPixel<T, Channels> > :
T operator()(int i) const
access to index i of vector
Definition: ImgPixel.h:77
base interface for all colors in different color spaces The class provides a base interface for all c...
Definition: Color.h:75
bool operator==(const ImgPixelBase &other) const
Definition: ImgPixel.h:86
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
virtual Color::RGB toRGB() const =0
converts the color of every color space to a RGB color.
T & operator()(int i)
const access to index i of vector
Definition: ImgPixel.h:81
float r
Definition: Color.h:152
ImgPixel(T v0, T v1)
constructor setting the values of the pixel
Definition: ImgPixel.h:151
Definition: ImgPixel.h:246
ImgPixel(const ColorBase &color)
constructor that takes ColorBase, internally the cv::Scalar conversion operator of the color is used...
Definition: ImgPixel.h:204
float g
Definition: Color.h:152
#define MIRA_HAS_MEMBER_TEMPLATE(Class, Identifier)
Definition: HasMember.h:140
ImgPixel(const ColorBase &color)
construction from a color of ColorBase
Definition: ImgPixel.h:177
T operator[](int i) const
access to index i of vector
Definition: ImgPixel.h:68
PropertyHint type(const std::string &t)
Sets the attribute "type" to the specified value.
Definition: PropertyHint.h:295
ImgPixel(T v0)
constructor setting the value of the pixel
Definition: ImgPixel.h:133
Definition: ImgPixel.h:251
MIRA_MEMBER_DETECTOR(mNoPublicDefaultConstructor)
Definition: ImgPixel.h:229
ImgPixel()
The default constructor.
Definition: ImgPixel.h:129
This file contains color classes for the Img class.
ImgPixel()
The default constructor.
Definition: ImgPixel.h:113
float b
Definition: Color.h:152
ImgPixel()
The default constructor.
Definition: ImgPixel.h:147
ImgPixel(T v0, T v1, T v2, T v3)
constructor setting the values of the pixel
Definition: ImgPixel.h:194
ImgPixel(T v0, T v1, T v2)
constructor setting the values of the pixel
Definition: ImgPixel.h:170
dynamic ImgPixel class template ImgPixel class providing flexible types and channels.
Definition: ImgPixel.h:110
The different color spaces.
Definition: Color.h:104
T & operator[](int i)
const access to index i of vector
Definition: ImgPixel.h:72
ImgPixel(const cv::Scalar &s)
setting cv::Vector from Scalar
Definition: ImgPixel.h:117
ImgPixel()
The default constructor.
Definition: ImgPixel.h:166
ImgPixel()
Definition: ImgPixel.h:191
base interface for ImgPixel classes This class wraps typed cv::Vect to represent an ImagePixel The Ve...
Definition: ImgPixel.h:65
cv::Vec< T, Channels > v
Definition: ImgPixel.h:97