core/vil/vil_rgb.txx
Go to the documentation of this file.
00001 // This is core/vil/vil_rgb.txx
00002 #ifndef vil_rgb_txx_
00003 #define vil_rgb_txx_
00004 
00005 #include "vil_rgb.h"
00006 
00007 //--------------------------------------------------------------------------------
00008 
00009 #undef SPECIALIZE_CLAMP_PIXEL
00010 #define SPECIALIZE_CLAMP_PIXEL(T) \
00011 VCL_DEFINE_SPECIALIZATION \
00012 vil_rgb<T> vil_clamp_pixel(vil_rgb<T> const& d, double min, double max) \
00013 { \
00014   return vil_rgb<T>(vil_clamp_pixel(d.r, min , max), \
00015                     vil_clamp_pixel(d.g, min , max), \
00016                     vil_clamp_pixel(d.b, min , max)); \
00017 }
00018 
00019 // instantiation macros for vil_rgb<T>s
00020 #undef VIL_RGB_INSTANTIATE
00021 #define VIL_RGB_INSTANTIATE(T) \
00022 template struct vil_rgb<T >; \
00023 /* VCL_INSTANTIATE_INLINE(vil_rgb<T > max(const vil_rgb<T >& a, const vil_rgb<T >& b)); */\
00024 /* VCL_INSTANTIATE_INLINE(vil_rgb<T > min(const vil_rgb<T >& a, const vil_rgb<T >& b)); */\
00025 VCL_INSTANTIATE_INLINE(vil_rgb<T > average(const vil_rgb<T >& a, const vil_rgb<T >& b)); \
00026 VCL_INSTANTIATE_INLINE(vil_rgb<T > operator+(const vil_rgb<T >& a, const vil_rgb<T >& b)); \
00027 VCL_INSTANTIATE_INLINE(vil_rgb<double > operator/(const vil_rgb<T >& a, double b)); \
00028 VCL_INSTANTIATE_INLINE(vil_rgb<double > operator*(const vil_rgb<T >& a, double b)); \
00029 VCL_INSTANTIATE_INLINE(vil_rgb<double > operator*(double b, const vil_rgb<T >& a))
00030 
00031 // must do << separately for byte specialization
00032 #undef VIL_RGB_INSTANTIATE_LS
00033 #define VIL_RGB_INSTANTIATE_LS(T) \
00034 VCL_DEFINE_SPECIALIZATION \
00035 vcl_ostream& operator<<(vcl_ostream& s, vil_rgb<T > const& rgb) \
00036 { \
00037 return s<< '[' << (int)rgb.r << ' ' << (int)rgb.g << ' ' << (int)rgb.b << ']'; \
00038 }
00039 
00040 #endif // vil_rgb_txx_