Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxRgbDirect.h

00001 /*
00002  *  Copyright (c) 2000, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *  Author(s):
00006  *  Dennis Koelma (koelma@wins.uva.nl)
00007  *
00008  */
00009 
00010 #ifndef HxRgbDirect_h
00011 #define HxRgbDirect_h
00012 
00013 #include "HxTagList.h"
00014 #include "HxClassName.h"
00015 #include "HxColConvert.h"
00016 
00017 
00021 template<class ValT, class ValDoubleT>
00022 class HxRgbDirect
00023 {
00024 public:
00025                         HxRgbDirect(HxTagList&)
00026                             {}
00027 
00028     int                 doIt(const ValT& pixV)
00029                             { return HxColRGB2int((HxVec3Int) pixV); }
00030 
00031     int                 doItDouble(const ValDoubleT& pixV)
00032                             { return HxColRGB2int((HxVec3Double) pixV); }
00033 
00034     static HxString     className()
00035                             { return HxString("Direct"); }
00036 };
00037 
00038 
00042 template<class ValT, class ValDoubleT>
00043 class HxRgbDirectNC
00044 {
00045 public:
00046                         HxRgbDirectNC(HxTagList&)
00047                             {}
00048 
00049     int                 doIt(const ValT& pixV)
00050                             {
00051                                 HxVec3Int v = (HxVec3Int) pixV;
00052                                 return (255 << 24) | (v.x() << 16) | (v.y() << 8) | v.z();
00053                             }
00054 
00055     int                 doItDouble(const ValDoubleT& pixV)
00056                             {
00057                                 HxVec3Int v = (HxVec3Int) pixV;
00058                                 return (255 << 24) | (v.x() << 16) | (v.y() << 8) | v.z();
00059                             }
00060 
00061     static HxString     className()
00062                             { return HxString("DirectNC"); }
00063 };
00064 
00065 
00066 #endif

Generated on Tue Jan 8 13:59:16 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001