libBaseTypes.h
Go to the documentation of this file.00001 #ifndef __LIBBASETYPES_H__
00002 #define __LIBBASETYPES_H__
00003
00004 #include <float.h>
00005
00006
00007 #define PI 3.14
00008
00009
00010
00011 #define REAL_AS_DOUBLE 1
00012 #if REAL_AS_DOUBLE
00013 typedef double Real;
00014 # define REAL_MAX DBL_MAX
00015 # define SFMT_REAL "%lf"
00016 #else
00017 typedef float Real;
00018 # define REAL_MAX FLT_MAX
00019 # define SFMT_REAL "%f"
00020 #endif
00021
00022
00023
00024 template<class T>
00025 inline const char *ScanFormat()
00026 {
00027 return "";
00028 }
00029 template<class T>
00030 inline const char *PrintFormat()
00031 {
00032 return "";
00033 }
00034
00035 template<>
00036 inline const char *ScanFormat<int> ()
00037 {
00038 return "%d";
00039 }
00040 template<>
00041 inline const char *PrintFormat<int> ()
00042 {
00043 return "%d";
00044 }
00045
00046 template<>
00047 inline const char *ScanFormat<double> ()
00048 {
00049 return "%lf";
00050 }
00051 template<>
00052 inline const char *PrintFormat<double> ()
00053 {
00054 return "%20.20lf";
00055 }
00056
00057 template<>
00058 inline const char *ScanFormat<float> ()
00059 {
00060 return "%f";
00061 }
00062 template<>
00063 inline const char *PrintFormat<float> ()
00064 {
00065 return "%20.20f";
00066 }
00067
00068
00069
00070 typedef Real Parameter;
00071
00072
00073
00074 typedef unsigned char byte;
00075
00076
00077
00078 typedef enum
00079 {
00080 Source,
00081 SourceAccessor,
00082 SourceAccessorCubicInterpolate,
00083 SourceAccessorEdgePad,
00084 SourceAccessorLinearInterpolate,
00085 SourceAccessorNearestNeighbor,
00086 SourceMemory,
00087 SourceTransform,
00088 SourceTransform2D,
00089 SourceTransformRotate,
00090 SourceTransformScale,
00091 SourceTransformTranslate,
00092 SourceTransformWarp
00093 } SourceType;
00094
00095
00096
00097 typedef enum
00098 {
00099 Nearest = 0, Linear = 1, Cubic = 3
00100 } InterpolationType;
00101
00102
00103
00104 typedef enum
00105 {
00106 DimensionX = 0, DimensionY = 1, DimensionZ = 2,
00107 } DimensionType;
00108
00109
00110
00111 typedef enum
00112 {
00113 Zero, Reflect, Repeat, Wrap,
00114 } PaddingType;
00115
00116 #endif //__LIBBASETYPES_H__