00001 // This is core/vil1/vil1_colour_space.h 00002 #ifndef vil1_colour_space_h_ 00003 #define vil1_colour_space_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Functions to convert between different colour spaces. 00010 // 00011 // Functions to convert between different colour spaces. 00012 // See Foley and van Dam, "Computer Graphics, Principles and Practice". 00013 // 00014 // \author fsm 00015 00016 //: Linear transformation from RGB to YIQ colour spaces 00017 template <class T> 00018 void vil1_colour_space_RGB_to_YIQ(T const in[3], T out[3]); 00019 00020 00021 //: Transform from RGB to HSV colour spaces 00022 // The input RGB values must lie in [0, L], for some positive L. Usually 00023 // L=1 or 255. 00024 // 00025 // The output HSV values will lie in the ranges: 00026 // H : [0, 360) (an angle, in bloody degrees) 00027 // S : [0, 1] 00028 // V : [0, L] 00029 // 00030 // [HSV is also known as HSB] 00031 template <class T> 00032 void vil1_colour_space_RGB_to_HSV(T r, T g, T b, T *h, T *s, T *v); 00033 00034 //: Transform from HSV to RGB colour space 00035 // 00036 // The input HSV values will lie in the ranges: 00037 // H : [0, 360) (an angle, in bloody degrees) 00038 // S : [0, 1] 00039 // V : [0, 255] 00040 // 00041 // The output RGB values will lie in [0, 255] 00042 // 00043 // [HSV is also known as HSB] 00044 template <class T> 00045 void vil1_colour_space_HSV_to_RGB(T h, T s, T v, T *r, T *g, T *b); 00046 00047 #endif // vil1_colour_space_h_
1.5.1