Templates -- Meow  1.1.4
A C++ template which is unable and also not allowed to compile to obj-file first.
HSV.h
Go to the documentation of this file.
1 #ifndef HSV_H_
2 #define HSV_H_
3 
4 #include "RGB.h"
5 #include "YUV.h"
6 #include "HSL.h"
7 
8 namespace meow{
9  template<class T> class HSV{
10  protected:
11  T hsv_[3];
12  HSV();
13  HSV(T const& h, T const& s, T const& v);
14  HSV(T const* hsv);
15  public:
16  virtual ~HSV(){ }
18  virtual T hMax() const = 0;
19  virtual T hMin() const = 0;
20  virtual T sMax() const = 0;
21  virtual T sMin() const = 0;
22  virtual T vMax() const = 0;
23  virtual T vMin() const = 0;
25  T h() const;
26  T s() const;
27  T v() const;
28  T hsv(size_t i) const;
29  T vsh(size_t i) const;
31  T h(T const& val);
32  T s(T const& val);
33  T v(T const& val);
34  T hsv(size_t i, T const& val);
35  T vsh(size_t i, T const& val);
36  };
37 
38  class HSVf: public HSV<double>{
39  public:
40  HSVf();
41  ~HSVf();
42  HSVf(double const&h,double const&s,double const&v);
43  HSVf(double const* hsv);
44  double hMin() const;
45  double hMax() const;
46  double sMin() const;
47  double sMax() const;
48  double vMin() const;
49  double vMax() const;
50  };
51 
52  template<class RGB_T, class HSV_T> inline void RGB_to_HSV(
53  RGB<RGB_T> const& rgb,
54  HSV<HSV_T> * hsv);
55  template<class HSV_T, class RGB_T> inline void HSV_to_RGB(
56  HSV<HSV_T> const& hsv,
57  RGB<RGB_T> * rgb);
58  template<class YUV_T, class HSV_T> inline void YUV_to_HSV(
59  YUV<YUV_T> const& yuv,
60  HSV<HSV_T> * hsv);
61  template<class HSV_T, class YUV_T> inline void HSV_to_YUV(
62  HSV<HSV_T> const& hsv,
63  YUV<YUV_T> * yuv);
64  template<class HSL_T, class HSV_T> inline void HSL_to_HSV(
65  HSL<HSL_T> const& hsl,
66  HSV<HSV_T> * hsv);
67  template<class HSV_T, class HSL_T> inline void HSV_to_HSL(
68  HSV<HSV_T> const& hsv,
69  HSL<HSL_T> * hsl);
70 }
71 
72 #include "HSV.hpp"
73 
74 #endif // HSV_H_
virtual ~HSV()
Definition: HSV.h:16
T h() const
Definition: HSV.hpp:18
void RGB_to_HSV(RGB< RGB_T > const &rgb, HSV< HSV_T > *hsv)
Definition: HSV.hpp:53
T s() const
Definition: HSV.hpp:19
virtual T hMax() const =0
void HSV_to_YUV(HSV< HSV_T > const &hsv, YUV< YUV_T > *yuv)
Definition: HSV.hpp:103
virtual T sMin() const =0
Definition: HSV.h:38
virtual T vMax() const =0
Definition: RGB.h:5
Definition: HSV.h:9
~HSVf()
Definition: HSV.hpp:40
double sMax() const
Definition: HSV.hpp:46
T hsv(size_t i) const
Definition: HSV.hpp:21
Definition: YUV.h:7
void HSV_to_RGB(HSV< HSV_T > const &hsv, RGB< RGB_T > *rgb)
Definition: HSV.hpp:74
double hMax() const
Definition: HSV.hpp:44
void HSL_to_HSV(HSL< HSL_T > const &hsl, HSV< HSV_T > *hsv)
Definition: HSV.hpp:110
Definition: HSL.h:8
T hsv_[3]
Definition: HSV.h:11
void YUV_to_HSV(YUV< YUV_T > const &yuv, HSV< HSV_T > *hsv)
Definition: HSV.hpp:96
virtual T hMin() const =0
virtual T sMax() const =0
HSV()
Definition: HSV.hpp:10
T v() const
Definition: HSV.hpp:20
double sMin() const
Definition: HSV.hpp:45
virtual T vMin() const =0
double hMin() const
Definition: HSV.hpp:43
T vsh(size_t i) const
Definition: HSV.hpp:24
double vMin() const
Definition: HSV.hpp:47
HSVf()
Definition: HSV.hpp:39
double vMax() const
Definition: HSV.hpp:48
void HSV_to_HSL(HSV< HSV_T > const &hsv, HSL< HSL_T > *hsl)
Definition: HSV.hpp:117