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

UpoParameterizedColor.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Trait_UpoParameterizedColor_h
00002 #define Impala_Core_Array_Trait_UpoParameterizedColor_h
00003 
00004 namespace Impala
00005 {
00006 namespace Core
00007 {
00008 namespace Array
00009 {
00010 namespace Trait
00011 {
00012 
00013 
00014 class UpoParameterizedColorPtr
00015 {
00016 public:
00017     typedef Pattern::TagTransInVar TransVarianceCategory;
00018     typedef Pattern::TagCallPointer CallCategory;
00019 
00020     typedef Real64 DstArithT;
00021     typedef Vec3Real64 SrcArithT;
00022 
00023     UpoParameterizedColorPtr(Real64 a, Real64 b, Real64 c, Real64 d, Real64 e, Real64 f, Real64 g)
00024         : a(a), b(b), c(c), d(d), e(e), f(f), g(g)
00025     {
00026     }
00027 
00028     void DoIt(Real64 *result, Real64* RGB)
00029     {
00030         Real64 teller = a * RGB[0] + b * RGB[1] + c * RGB[2];
00031         Real64 deler = d * RGB[0] + e * RGB[1] + f * RGB[2] + g;
00032         if(fabs(deler) < 0.001) {
00033             deler = 1.0;
00034         }
00035         result[0] = teller / deler;
00036     }
00037 private:
00038     Real64 a, b, c, d, e, f, g;
00039 };
00040 
00041 } // namespace Trait
00042 } // namespace Array
00043 } // namespace Core
00044 } // namespace Impala
00045 
00046 #endif //UpoParameterizedColor_h

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