Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Util.h

Go to the documentation of this file.
00001 //
00002 // File:   Util.h
00003 // Author: Steve Kilthau
00004 // Date:   August, 1999
00005 // 
00006 // This file defines several utility functions
00007 // used in other parts of the program.
00008 //
00009 
00010 // Modifications by Steven Bergner, Aug 2001
00011 // This file does not need any documentation ;-)
00012 
00013 #ifndef _UTIL_H_
00014 #define _UTIL_H_
00015 
00016 #include <math.h>
00017 #include "vuVector.h"
00018 #include "vuColourRGBa.h"
00019 #include "vuColourXYZa.h"
00020 #include "vuColour31a.h"
00021 #include "vuColour7a.h"
00022 #include "vuColour9a.h"
00023 
00024 
00025 #define DEG2RAD    0.01745329251994  // PI/180
00026 #define SNAP_TOLERANCE  0.0000001
00027 #define D65_NORMAL 1056.442   // D65 Normalizing luminance
00028 
00029 
00030 #define DO_POST_CLASSIFICATION
00031 #define USE_VUTFUNC
00032 
00033 //#define USE_RGBA
00034 //#define USE_SPECTRUM31A
00035 #define USE_SPECTRUM7A
00036 //#define USE_SPECTRUM9A
00037 
00038 #if defined USE_RGBA
00039     typedef vuColourRGBa ColourType;
00040 #elif defined USE_SPECTRUM31A
00041     typedef vuColour31a ColourType;
00042 #elif defined USE_SPECTRUM7A
00043     typedef vuColour7a ColourType;
00044 #elif defined USE_SPECTRUM9A
00045     typedef vuColour9a ColourType;
00046 #endif
00047 
00048 
00049 #ifndef Min
00050 #define Min(a,b)        (a<b ? a : b)
00051 #endif
00052 #ifndef Max
00053 #define Max(a,b)        (a>b ? a : b)
00054 #endif
00055 #ifndef Sgn
00056 #define Sgn(a)          (a>0 ? 1 : a<0 ? -1 : 0)
00057 #endif
00058 
00059 namespace ns_vu1112112 {
00060 using namespace ns_vu1112112;
00061 
00062 
00063 // Check if value is within TOLERANCE of zero.  If it
00064 // is then make value equal to zero.
00065 float SnapToZero(float t);
00066 
00067 
00068 // Swap the values of two items.
00069 template<class T>
00070 void Swap(T& t1, T& t2)
00071 {
00072     T t(t1);
00073     t1 = t2;
00074     t2 = t;
00075 }
00076 
00077 } // end of namespace
00078 
00079 #endif

Generated on Wed Dec 15 21:20:32 2004 for vuVolume by  doxygen 1.3.9.1