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

UpoColSpace.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Trait_UpoColSpace_h
00002 #define Impala_Core_Array_Trait_UpoColSpace_h
00003 
00004 #include "Core/Array/Element/Color.h"
00005 #include "Core/Array/Pattern/Categories.h"
00006 
00007 namespace Impala
00008 {
00009 namespace Core
00010 {
00011 namespace Array
00012 {
00013 namespace Trait
00014 {
00015 
00016 
00019 template<class DstArrayT, class SrcArrayT>
00020 class UpoColSpace
00021 {
00022 public:
00024     typedef Pattern::TagTransInVar TransVarianceCategory;
00025 
00027     typedef Pattern::TagCallValue CallCategory;
00028 
00029     typedef typename DstArrayT::ArithType DstArithT;
00030     typedef typename SrcArrayT::ArithType SrcArithT;
00031 
00033     UpoColSpace(Element::ColorModel fromColorSpace, Element::ColorModel toColorSpace)
00034     {
00035         mFromSpace = fromColorSpace;
00036         mToSpace = toColorSpace;
00037     }
00038 
00040     DstArithT
00041     DoIt(const SrcArithT& x)
00042     {
00043         return Element::Color(x,mFromSpace).Convert(mToSpace).Value();
00044     }
00045 
00046 private:
00047     Element::ColorModel mFromSpace;
00048     Element::ColorModel mToSpace;
00049 };
00050 
00051 } // namespace Trait
00052 } // namespace Array
00053 } // namespace Core
00054 } // namespace Impala
00055 
00056 #endif

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