00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
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
00034
00035 #define USE_SPECTRUM7A
00036
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
00064
00065 float SnapToZero(float t);
00066
00067
00068
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 }
00078
00079 #endif