Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxUpoColSpace.h

00001 /*
00002  *  Copyright (c) 2001, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *  Author(s):
00006  *  Jan-Mark Geusebroek (mark@science.uva.nl)
00007  */
00008 
00009 #ifndef HxUpoColSpace_h
00010 #define HxUpoColSpace_h
00011 
00012 #include "HxTagList.h"
00013 #include "HxClassName.h"
00014 #include "HxColor.h"
00015 #include "HxCategories.h"
00016 
00017 
00020 template<class DstValT, class SrcValT>
00021 class HxUpoColSpace
00022 {
00023 public:
00025     typedef HxTagTransInVar TransVarianceCategory;
00026 
00028                     HxUpoColSpace(HxTagList& tags)
00029                         {
00030                             _fromSpace = HxGetTag<HxColorModel>(tags,
00031                                 "fromColorSpace");
00032                             _toSpace = HxGetTag<HxColorModel>(tags,
00033                                 "toColorSpace");
00034                         }
00035 
00037     DstValT         doIt(const SrcValT& x)
00038                         { return HxColor(x,_fromSpace).convert(_toSpace).value();}
00039 
00041     static HxString className()
00042                         { return HxString("colorSpace"); }
00043 
00044 private:
00045     HxColorModel _fromSpace;
00046     HxColorModel _toSpace;
00047 };
00048 
00049 #endif

Generated on Tue Feb 3 14:18:43 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001