Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

UpoRGB2rg.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Trait_UpoRGB2rg_h
00002 #define Impala_Core_Array_Trait_UpoRGB2rg_h
00003 
00004 namespace Impala
00005 {
00006 namespace Core
00007 {
00008 namespace Array
00009 {
00010 namespace Trait
00011 {
00012 
00013 
00014 template<class StorT>
00015 class UpoRGB2rgPtr
00016 {
00017 public:
00018     typedef Pattern::TagTransInVar TransVarianceCategory;
00019     typedef Pattern::TagCallPointer CallCategory;
00020 
00021     UpoRGB2rgPtr()
00022     {
00023     }
00024 
00025     void DoIt(Real64 *rg, StorT* RGB)
00026     {
00027         Real64 total = RGB[0] + RGB[1] + RGB[2];
00028         if(fabs(total) < 0.00001) {
00029             rg[0] = 1.0 / 3.0;
00030             rg[1] = 1.0 / 3.0;
00031             rg[2] = 1.0 / 3.0;
00032         }
00033         else
00034         {
00035             rg[0] = RGB[0] / total;
00036             rg[1] = RGB[1] / total;
00037             rg[2] = RGB[2] / total;
00038         }
00039     }
00040 };
00041 
00042 } // namespace Trait
00043 } // namespace Array
00044 } // namespace Core
00045 } // namespace Impala
00046 
00047 #endif //UpoRGB2rg_h

Generated on Fri Mar 19 09:31:02 2010 for ImpalaSrc by  doxygen 1.5.1