

#ifndef INC_MISC_HH
#define INC_MISC_HH



typedef int bool;

const int false = 0;
const int true  = 1;


typedef unsigned char uchar;
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned int uint;


// rgb and hsv structures...
  
struct RGB      { uchar r, g, b; };
struct RGBFloat { float r, g, b; };
struct HSV      { float h, s, v; };


inline template<class T> T max(T a, T b) { return (a > b) ? a : b; }
inline template<class T> T min(T a, T b) { return (a < b) ? a : b; }
inline template<class T> T abs(T x)      { return (x >= 0) ? x : -x; }
inline template<class T> T sqr(T x)      { return x * x; }

#endif   
