Go to the documentation of this file.
13 #ifndef RU_ALGORITHM_MACROS_H
14 #define RU_ALGORITHM_MACROS_H
18 #define DECLARE_GENERATOR_OP(name, override_) \
19 virtual RU_GeneratorOp<uint8, 0> * \
20 allocateGenerator(uint8,int) override_; \
21 virtual RU_GeneratorOp<uint16, 0> * \
22 allocateGenerator(uint16,int) override_; \
23 virtual RU_GeneratorOp<uint32, 0> * \
24 allocateGenerator(uint32,int) override_; \
25 virtual RU_GeneratorOp<fpreal32, 0> * \
26 allocateGenerator(fpreal32,int) override_; \
27 virtual RU_GeneratorOp<fpreal16, 0> * \
28 allocateGenerator(fpreal16,int) override_; \
29 virtual RU_GeneratorOp<uint8, 1> * \
30 allocateGenerator(uint8) override_; \
31 virtual RU_GeneratorOp<uint16, 1> * \
32 allocateGenerator(uint16) override_; \
33 virtual RU_GeneratorOp<uint32, 1> * \
34 allocateGenerator(uint32) override_; \
35 virtual RU_GeneratorOp<fpreal32, 1> * \
36 allocateGenerator(fpreal32) override_; \
37 virtual RU_GeneratorOp<fpreal16, 1> * \
38 allocateGenerator(fpreal16) override_;
41 #define DECLARE_PIXEL_OP(name, override_) \
42 virtual RU_PixelOp<uint8, 0> * allocatePixel(uint8, int) override_; \
43 virtual RU_PixelOp<uint16, 0> * allocatePixel(uint16, int) override_; \
44 virtual RU_PixelOp<uint32, 0> * allocatePixel(uint32, int) override_; \
45 virtual RU_PixelOp<fpreal32, 0> *allocatePixel(fpreal32, int) override_; \
46 virtual RU_PixelOp<fpreal16, 0> *allocatePixel(fpreal16, int) override_; \
47 virtual RU_PixelOp<uint8, 1> * allocatePixel(uint8) override_; \
48 virtual RU_PixelOp<uint16, 1> * allocatePixel(uint16) override_; \
49 virtual RU_PixelOp<uint32, 1> * allocatePixel(uint32) override_; \
50 virtual RU_PixelOp<fpreal32, 1> *allocatePixel(fpreal32) override_; \
51 virtual RU_PixelOp<fpreal16, 1> *allocatePixel(fpreal16) override_;
53 #define DECLARE_FILTER_OP(name, override_) \
54 virtual RU_FilterOp<uint8, 0> * allocateFilter(uint8, int) override_; \
55 virtual RU_FilterOp<uint16, 0> * allocateFilter(uint16, int) override_; \
56 virtual RU_FilterOp<uint32, 0> * allocateFilter(uint32, int) override_; \
57 virtual RU_FilterOp<fpreal32, 0> *allocateFilter(fpreal32, int) override_; \
58 virtual RU_FilterOp<fpreal16, 0> *allocateFilter(fpreal16, int) override_; \
59 virtual RU_FilterOp<uint8, 1> * allocateFilter(uint8) override_; \
60 virtual RU_FilterOp<uint16, 1> * allocateFilter(uint16) override_; \
61 virtual RU_FilterOp<uint32, 1> * allocateFilter(uint32) override_; \
62 virtual RU_FilterOp<fpreal32, 1> *allocateFilter(fpreal32) override_; \
63 virtual RU_FilterOp<fpreal16, 1> *allocateFilter(fpreal16) override_;
66 #define DECLARE_BINARY_OP(name, override_) \
67 virtual RU_BinaryOp<uint8, 0> * allocateBinary(uint8, int) override_; \
68 virtual RU_BinaryOp<uint16, 0> * allocateBinary(uint16, int) override_; \
69 virtual RU_BinaryOp<uint32, 0> * allocateBinary(uint32, int) override_; \
70 virtual RU_BinaryOp<fpreal32, 0> *allocateBinary(fpreal32, int) override_; \
71 virtual RU_BinaryOp<fpreal16, 0> *allocateBinary(fpreal16, int) override_; \
72 virtual RU_BinaryOp<uint8, 1> * allocateBinary(uint8) override_; \
73 virtual RU_BinaryOp<uint16, 1> * allocateBinary(uint16) override_; \
74 virtual RU_BinaryOp<uint32, 1> * allocateBinary(uint32) override_; \
75 virtual RU_BinaryOp<fpreal32, 1> *allocateBinary(fpreal32) override_; \
76 virtual RU_BinaryOp<fpreal16, 1> *allocateBinary(fpreal16) override_;
79 #define IMPLEMENT_GENERATOR_OP(classname,name) \
80 RU_GeneratorOp<unsigned char,0> *classname::allocateGenerator(unsigned char,int) \
81 { return new name<unsigned char,0>(this); } \
82 RU_GeneratorOp<unsigned short,0> *classname::allocateGenerator(unsigned short,int)\
83 { return new name<unsigned short,0>(this); } \
84 RU_GeneratorOp<unsigned int,0> *classname::allocateGenerator(unsigned int,int) \
85 { return new name<unsigned int,0>(this); } \
86 RU_GeneratorOp<float,0> *classname::allocateGenerator(float,int) \
87 { return new name<float,0>(this); } \
88 RU_GeneratorOp<fpreal16,0> *classname::allocateGenerator(fpreal16,int)\
89 { return new name<fpreal16,0>(this); } \
90 RU_GeneratorOp<unsigned char,1> *classname::allocateGenerator(unsigned char) \
91 { return new name<unsigned char,1>(this); } \
92 RU_GeneratorOp<unsigned short,1> *classname::allocateGenerator(unsigned short)\
93 { return new name<unsigned short,1>(this); } \
94 RU_GeneratorOp<unsigned int,1> *classname::allocateGenerator(unsigned int) \
95 { return new name<unsigned int,1>(this); } \
96 RU_GeneratorOp<float,1> *classname::allocateGenerator(float) \
97 { return new name<float,1>(this); } \
98 RU_GeneratorOp<fpreal16,1> *classname::allocateGenerator(fpreal16) \
99 { return new name<fpreal16,1>(this); }
102 #define IMPLEMENT_PIXEL_OP(classname, name) \
103 RU_PixelOp<unsigned char,0> *classname::allocatePixel(unsigned char,int)\
104 { return new name<unsigned char,0>(this); } \
105 RU_PixelOp<unsigned short,0> *classname::allocatePixel(unsigned short,int)\
106 { return new name<unsigned short,0>(this); } \
107 RU_PixelOp<unsigned int,0> *classname::allocatePixel(unsigned int,int) \
108 { return new name<unsigned int,0>(this); } \
109 RU_PixelOp<float,0> *classname::allocatePixel(float,int) \
110 { return new name<float,0>(this); } \
111 RU_PixelOp<fpreal16,0> *classname::allocatePixel(fpreal16,int) \
112 { return new name<fpreal16,0>(this); } \
113 RU_PixelOp<unsigned char,1> *classname::allocatePixel(unsigned char) \
114 { return new name<unsigned char,1>(this); } \
115 RU_PixelOp<unsigned short,1> *classname::allocatePixel(unsigned short) \
116 { return new name<unsigned short,1>(this); } \
117 RU_PixelOp<unsigned int,1> *classname::allocatePixel(unsigned int) \
118 { return new name<unsigned int,1>(this); } \
119 RU_PixelOp<float,1> *classname::allocatePixel(float) \
120 { return new name<float,1>(this); } \
121 RU_PixelOp<fpreal16,1> *classname::allocatePixel(fpreal16 ) \
122 { return new name<fpreal16,1>(this); }
125 #define IMPLEMENT_FILTER_OP(classname, name) \
126 RU_FilterOp<unsigned char,0> *classname::allocateFilter(unsigned char,int) \
127 { return new name<unsigned char,0>(this); } \
128 RU_FilterOp<unsigned short,0> *classname::allocateFilter(unsigned short,int)\
129 { return new name<unsigned short,0>(this); } \
130 RU_FilterOp<unsigned int,0> *classname::allocateFilter(unsigned int,int)\
131 { return new name<unsigned int,0>(this); } \
132 RU_FilterOp<float,0> *classname::allocateFilter(float,int) \
133 { return new name<float,0>(this); } \
134 RU_FilterOp<fpreal16,0> *classname::allocateFilter(fpreal16,int)\
135 { return new name<fpreal16,0>(this); } \
136 RU_FilterOp<unsigned char,1> *classname::allocateFilter(unsigned char) \
137 { return new name<unsigned char,1>(this); } \
138 RU_FilterOp<unsigned short,1> *classname::allocateFilter(unsigned short)\
139 { return new name<unsigned short,1>(this); } \
140 RU_FilterOp<unsigned int,1> *classname::allocateFilter(unsigned int) \
141 { return new name<unsigned int,1>(this); } \
142 RU_FilterOp<float,1> *classname::allocateFilter(float) \
143 { return new name<float,1>(this); } \
144 RU_FilterOp<fpreal16,1> *classname::allocateFilter(fpreal16) \
145 { return new name<fpreal16,1>(this); }
148 #define IMPLEMENT_BINARY_OP(classname, name) \
149 RU_BinaryOp<unsigned char,0> *classname::allocateBinary(unsigned char,int)\
150 { return new name<unsigned char,0>(this); } \
151 RU_BinaryOp<unsigned short,0> *classname::allocateBinary(unsigned short,int)\
152 { return new name<unsigned short,0>(this); } \
153 RU_BinaryOp<unsigned int,0> *classname::allocateBinary(unsigned int,int) \
154 { return new name<unsigned int,0>(this); } \
155 RU_BinaryOp<float,0> *classname::allocateBinary(float,int) \
156 { return new name<float,0>(this); } \
157 RU_BinaryOp<fpreal16,0> *classname::allocateBinary(fpreal16,int)\
158 { return new name<fpreal16,0>(this); } \
159 RU_BinaryOp<unsigned char,1> *classname::allocateBinary(unsigned char)\
160 { return new name<unsigned char,1>(this); } \
161 RU_BinaryOp<unsigned short,1> *classname::allocateBinary(unsigned short)\
162 { return new name<unsigned short,1>(this); } \
163 RU_BinaryOp<unsigned int,1> *classname::allocateBinary(unsigned int)\
164 { return new name<unsigned int,1>(this); } \
165 RU_BinaryOp<float,1> *classname::allocateBinary(float) \
166 { return new name<float,1>(this); } \
167 RU_BinaryOp<fpreal16,1> *classname::allocateBinary(fpreal16) \
168 { return new name<fpreal16,1>(this); }