vil_rgb.hxx
Go to the documentation of this file.
1 // This is core/vil/vil_rgb.hxx
2 #ifndef vil_rgb_hxx_
3 #define vil_rgb_hxx_
4 
5 #include "vil_rgb.h"
6 
7 //--------------------------------------------------------------------------------
8 
9 #undef SPECIALIZE_CLAMP_PIXEL
10 #define SPECIALIZE_CLAMP_PIXEL(T) \
11 template <> \
12 vil_rgb<T> vil_clamp_pixel(vil_rgb<T> const& d, double min, double max) \
13 { \
14  return vil_rgb<T>(vil_clamp_pixel(d.r, min , max), \
15  vil_clamp_pixel(d.g, min , max), \
16  vil_clamp_pixel(d.b, min , max)); \
17 }
18 
19 // instantiation macros for vil_rgb<T>s
20 #undef VIL_RGB_INSTANTIATE
21 #define VIL_RGB_INSTANTIATE(T) \
22 template struct vil_rgb<T >; \
23 /*template vil_rgb<T > max(const vil_rgb<T >& a, const vil_rgb<T >& b); */\
24 /*template vil_rgb<T > min(const vil_rgb<T >& a, const vil_rgb<T >& b); */\
25 /*template vil_rgb<T > average(const vil_rgb<T >& a, const vil_rgb<T >& b) ; */ \
26 /*template vil_rgb<T > operator+(const vil_rgb<T >& a, const vil_rgb<T >& b) ; */ \
27 /*template vil_rgb<double > operator/(const vil_rgb<T >& a, double b) ; */ \
28 /*template vil_rgb<double > operator*(const vil_rgb<T >& a, double b) ; */ \
29 /*template vil_rgb<double > operator*(double b, const vil_rgb<T >& a) */
30 
31 // must do << separately for byte specialization
32 #undef VIL_RGB_INSTANTIATE_LS
33 #define VIL_RGB_INSTANTIATE_LS(T) \
34 template <> \
35 std::ostream& operator<<(std::ostream& s, vil_rgb<T > const& rgb) \
36 { \
37 return s<< '[' << (int)rgb.r << ' ' << (int)rgb.g << ' ' << (int)rgb.b << ']'; \
38 }
39 
40 #endif // vil_rgb_hxx_
Pixel type for 24 bit images.