00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef RU_ALGORITHM_MACROS_H
00023 #define RU_ALGORITHM_MACROS_H
00024
00025 #include <SYS/SYS_Types.h>
00026
00027 #define DECLARE_GENERATOR_OP(name) \
00028 virtual RU_GeneratorOp<unsigned char,0> *allocateGenerator(unsigned char,int); \
00029 virtual RU_GeneratorOp<unsigned short,0> *allocateGenerator(unsigned short,int);\
00030 virtual RU_GeneratorOp<unsigned int,0> *allocateGenerator(unsigned int,int); \
00031 virtual RU_GeneratorOp<float,0> *allocateGenerator(float,int); \
00032 virtual RU_GeneratorOp<fpreal16,0> *allocateGenerator(fpreal16,int); \
00033 virtual RU_GeneratorOp<unsigned char,1> *allocateGenerator(unsigned char); \
00034 virtual RU_GeneratorOp<unsigned short,1> *allocateGenerator(unsigned short);\
00035 virtual RU_GeneratorOp<unsigned int,1> *allocateGenerator(unsigned int); \
00036 virtual RU_GeneratorOp<float,1> *allocateGenerator(float); \
00037 virtual RU_GeneratorOp<fpreal16,1> *allocateGenerator(fpreal16);
00038
00039
00040 #define DECLARE_PIXEL_OP(name) \
00041 virtual RU_PixelOp<unsigned char,0> *allocatePixel(unsigned char,int);\
00042 virtual RU_PixelOp<unsigned short,0> *allocatePixel(unsigned short,int);\
00043 virtual RU_PixelOp<unsigned int,0> *allocatePixel(unsigned int,int); \
00044 virtual RU_PixelOp<float,0> *allocatePixel(float,int); \
00045 virtual RU_PixelOp<fpreal16,0> *allocatePixel(fpreal16,int); \
00046 virtual RU_PixelOp<unsigned char,1> *allocatePixel(unsigned char); \
00047 virtual RU_PixelOp<unsigned short,1> *allocatePixel(unsigned short); \
00048 virtual RU_PixelOp<unsigned int,1> *allocatePixel(unsigned int); \
00049 virtual RU_PixelOp<float,1> *allocatePixel(float); \
00050 virtual RU_PixelOp<fpreal16,1> *allocatePixel(fpreal16);
00051
00052 #define DECLARE_FILTER_OP(name) \
00053 virtual RU_FilterOp<unsigned char,0> *allocateFilter(unsigned char,int);\
00054 virtual RU_FilterOp<unsigned short,0> *allocateFilter(unsigned short,int);\
00055 virtual RU_FilterOp<unsigned int,0> *allocateFilter(unsigned int,int); \
00056 virtual RU_FilterOp<float,0> *allocateFilter(float,int); \
00057 virtual RU_FilterOp<fpreal16,0> *allocateFilter(fpreal16,int); \
00058 virtual RU_FilterOp<unsigned char,1> *allocateFilter(unsigned char); \
00059 virtual RU_FilterOp<unsigned short,1> *allocateFilter(unsigned short); \
00060 virtual RU_FilterOp<unsigned int,1> *allocateFilter(unsigned int); \
00061 virtual RU_FilterOp<float,1> *allocateFilter(float); \
00062 virtual RU_FilterOp<fpreal16,1> *allocateFilter(fpreal16);
00063
00064
00065 #define DECLARE_BINARY_OP(name) \
00066 virtual RU_BinaryOp<unsigned char,0> *allocateBinary(unsigned char,int); \
00067 virtual RU_BinaryOp<unsigned short,0> *allocateBinary(unsigned short,int);\
00068 virtual RU_BinaryOp<unsigned int,0> *allocateBinary(unsigned int,int); \
00069 virtual RU_BinaryOp<float,0> *allocateBinary(float,int); \
00070 virtual RU_BinaryOp<fpreal16,0> *allocateBinary(fpreal16, int); \
00071 virtual RU_BinaryOp<unsigned char,1> *allocateBinary(unsigned char); \
00072 virtual RU_BinaryOp<unsigned short,1> *allocateBinary(unsigned short); \
00073 virtual RU_BinaryOp<unsigned int,1> *allocateBinary(unsigned int); \
00074 virtual RU_BinaryOp<float,1> *allocateBinary(float); \
00075 virtual RU_BinaryOp<fpreal16,1> *allocateBinary(fpreal16);
00076
00077
00078 #define IMPLEMENT_GENERATOR_OP(classname,name) \
00079 RU_GeneratorOp<unsigned char,0> *classname::allocateGenerator(unsigned char,int) \
00080 { return new name<unsigned char,0>(this); } \
00081 RU_GeneratorOp<unsigned short,0> *classname::allocateGenerator(unsigned short,int)\
00082 { return new name<unsigned short,0>(this); } \
00083 RU_GeneratorOp<unsigned int,0> *classname::allocateGenerator(unsigned int,int) \
00084 { return new name<unsigned int,0>(this); } \
00085 RU_GeneratorOp<float,0> *classname::allocateGenerator(float,int) \
00086 { return new name<float,0>(this); } \
00087 RU_GeneratorOp<fpreal16,0> *classname::allocateGenerator(fpreal16,int)\
00088 { return new name<fpreal16,0>(this); } \
00089 RU_GeneratorOp<unsigned char,1> *classname::allocateGenerator(unsigned char) \
00090 { return new name<unsigned char,1>(this); } \
00091 RU_GeneratorOp<unsigned short,1> *classname::allocateGenerator(unsigned short)\
00092 { return new name<unsigned short,1>(this); } \
00093 RU_GeneratorOp<unsigned int,1> *classname::allocateGenerator(unsigned int) \
00094 { return new name<unsigned int,1>(this); } \
00095 RU_GeneratorOp<float,1> *classname::allocateGenerator(float) \
00096 { return new name<float,1>(this); } \
00097 RU_GeneratorOp<fpreal16,1> *classname::allocateGenerator(fpreal16) \
00098 { return new name<fpreal16,1>(this); }
00099
00100
00101 #define IMPLEMENT_PIXEL_OP(classname, name) \
00102 RU_PixelOp<unsigned char,0> *classname::allocatePixel(unsigned char,int)\
00103 { return new name<unsigned char,0>(this); } \
00104 RU_PixelOp<unsigned short,0> *classname::allocatePixel(unsigned short,int)\
00105 { return new name<unsigned short,0>(this); } \
00106 RU_PixelOp<unsigned int,0> *classname::allocatePixel(unsigned int,int) \
00107 { return new name<unsigned int,0>(this); } \
00108 RU_PixelOp<float,0> *classname::allocatePixel(float,int) \
00109 { return new name<float,0>(this); } \
00110 RU_PixelOp<fpreal16,0> *classname::allocatePixel(fpreal16,int) \
00111 { return new name<fpreal16,0>(this); } \
00112 RU_PixelOp<unsigned char,1> *classname::allocatePixel(unsigned char) \
00113 { return new name<unsigned char,1>(this); } \
00114 RU_PixelOp<unsigned short,1> *classname::allocatePixel(unsigned short) \
00115 { return new name<unsigned short,1>(this); } \
00116 RU_PixelOp<unsigned int,1> *classname::allocatePixel(unsigned int) \
00117 { return new name<unsigned int,1>(this); } \
00118 RU_PixelOp<float,1> *classname::allocatePixel(float) \
00119 { return new name<float,1>(this); } \
00120 RU_PixelOp<fpreal16,1> *classname::allocatePixel(fpreal16 ) \
00121 { return new name<fpreal16,1>(this); }
00122
00123
00124 #define IMPLEMENT_FILTER_OP(classname, name) \
00125 RU_FilterOp<unsigned char,0> *classname::allocateFilter(unsigned char,int) \
00126 { return new name<unsigned char,0>(this); } \
00127 RU_FilterOp<unsigned short,0> *classname::allocateFilter(unsigned short,int)\
00128 { return new name<unsigned short,0>(this); } \
00129 RU_FilterOp<unsigned int,0> *classname::allocateFilter(unsigned int,int)\
00130 { return new name<unsigned int,0>(this); } \
00131 RU_FilterOp<float,0> *classname::allocateFilter(float,int) \
00132 { return new name<float,0>(this); } \
00133 RU_FilterOp<fpreal16,0> *classname::allocateFilter(fpreal16,int)\
00134 { return new name<fpreal16,0>(this); } \
00135 RU_FilterOp<unsigned char,1> *classname::allocateFilter(unsigned char) \
00136 { return new name<unsigned char,1>(this); } \
00137 RU_FilterOp<unsigned short,1> *classname::allocateFilter(unsigned short)\
00138 { return new name<unsigned short,1>(this); } \
00139 RU_FilterOp<unsigned int,1> *classname::allocateFilter(unsigned int) \
00140 { return new name<unsigned int,1>(this); } \
00141 RU_FilterOp<float,1> *classname::allocateFilter(float) \
00142 { return new name<float,1>(this); } \
00143 RU_FilterOp<fpreal16,1> *classname::allocateFilter(fpreal16) \
00144 { return new name<fpreal16,1>(this); }
00145
00146
00147 #define IMPLEMENT_BINARY_OP(classname, name) \
00148 RU_BinaryOp<unsigned char,0> *classname::allocateBinary(unsigned char,int)\
00149 { return new name<unsigned char,0>(this); } \
00150 RU_BinaryOp<unsigned short,0> *classname::allocateBinary(unsigned short,int)\
00151 { return new name<unsigned short,0>(this); } \
00152 RU_BinaryOp<unsigned int,0> *classname::allocateBinary(unsigned int,int) \
00153 { return new name<unsigned int,0>(this); } \
00154 RU_BinaryOp<float,0> *classname::allocateBinary(float,int) \
00155 { return new name<float,0>(this); } \
00156 RU_BinaryOp<fpreal16,0> *classname::allocateBinary(fpreal16,int)\
00157 { return new name<fpreal16,0>(this); } \
00158 RU_BinaryOp<unsigned char,1> *classname::allocateBinary(unsigned char)\
00159 { return new name<unsigned char,1>(this); } \
00160 RU_BinaryOp<unsigned short,1> *classname::allocateBinary(unsigned short)\
00161 { return new name<unsigned short,1>(this); } \
00162 RU_BinaryOp<unsigned int,1> *classname::allocateBinary(unsigned int)\
00163 { return new name<unsigned int,1>(this); } \
00164 RU_BinaryOp<float,1> *classname::allocateBinary(float) \
00165 { return new name<float,1>(this); } \
00166 RU_BinaryOp<fpreal16,1> *classname::allocateBinary(fpreal16) \
00167 { return new name<fpreal16,1>(this); }
00168
00169
00170 #endif