00001 #ifndef IMG_BASE_H_
00002 #define IMG_BASE_H_
00003
00009
00010 template<bool> struct NON_TRUE_EXPR_CompileTimeError;
00012 template<> struct NON_TRUE_EXPR_CompileTimeError<true> {};
00013
00015 #define STATIC_ASSERT(exp) (NON_TRUE_EXPR_CompileTimeError< (exp) >())
00016
00018 template<typename> struct NON_FLOAT_OR_DOUBLE_TYPE_CompileTimeError;
00020 template<> struct NON_FLOAT_OR_DOUBLE_TYPE_CompileTimeError<float> {};
00022 template<> struct NON_FLOAT_OR_DOUBLE_TYPE_CompileTimeError<double> {};
00023
00025 #define STATIC_FLOAT_OR_DOUBLE_TYPECHECK(type) (NON_FLOAT_OR_DOUBLE_TYPE_CompileTimeError< type >())
00026
00028 #ifndef NULL
00029 #ifdef __cplusplus
00030 #define NULL 0
00031 #else
00032 #define NULL ((void *)0)
00033 #endif
00034 #endif
00035
00036 #include <assert.h>
00037 #include <math.h>
00038 #include <exception>
00039 #include <typeinfo>
00040
00045 namespace img {
00046
00051 class ImageException: public std::exception
00052 {
00053 public:
00055 const char *message;
00057 ImageException():exception(),message("no message"){}
00062 ImageException(const char *arg_message):exception(),message(arg_message){}
00064 virtual ~ImageException () throw (){}
00065 };
00066
00067 }
00068
00069 #endif