00001
00002
00003 #ifndef MISC_H
00004 #define MISC_H
00005
00006 #include <iostream.h>
00007
00008 #define ERROR(string) { cout<<string<<endl; }
00009
00010 #ifndef MAX
00011 #define MIN(a,b) (((a)<(b)) ? (a) : (b))
00012 #define MAX(a,b) (((a)>(b)) ? (a) : (b))
00013 #endif
00014
00015 typedef unsigned char byte;
00016
00017 enum PADDING_TYPE { ZEROS=0, REFLECTION=1, WRAP=2};
00018 enum CONN_TYPE {FOUR=0, EIGHT=1};
00019 extern const char* types[6];
00020
00021 #define SWAP(a,b) {tempr=(a); (a)=(b); (b)=tempr; }
00022 #define RANGE(i, j, h, w) ( (i>=0) && (j>=0) && (i<h) && (j<w) )
00023
00024 #endif
00025