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

UpoRGB2Gray.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Trait_UpoRGB2Gray_h
00002 #define Impala_Core_Array_Trait_UpoRGB2Gray_h
00003 
00004 #include "Core/Array/Pattern/Categories.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Array
00011 {
00012 namespace Trait
00013 {
00014 
00015 
00017 template<class DstArrayT, class SrcArrayT>
00018 class UpoRGB2Gray
00019 {
00020 public:
00022     typedef Pattern::TagTransInVar TransVarianceCategory;
00023 
00025     typedef Pattern::TagCallValue CallCategory;
00026 
00027     typedef typename DstArrayT::ArithType DstArithT;
00028     typedef typename SrcArrayT::ArithType SrcArithT;
00029 
00031     UpoRGB2Gray()
00032     {
00033     }
00034 
00036     DstArithT
00037     DoIt(const SrcArithT& x)
00038     {
00039         /* corresponds to Matlab rgb2gray function */
00040         return (0.298936021293775*x.X() + 0.587043074451121*x.Y() + 0.114020904255103*x.Z());
00041     }
00042 };
00043 
00044 } // namespace Trait
00045 } // namespace Array
00046 } // namespace Core
00047 } // namespace Impala
00048 
00049 #endif

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