HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RU_AlgorithmMacros.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: RU_Algorithm.h
7  *
8  * COMMENTS:
9  * Simply too hideous to be lurking about in RU_Algorithm. Uggh.
10  *
11  * Leave now, while you still have eyes.
12  */
13 #ifndef RU_ALGORITHM_MACROS_H
14 #define RU_ALGORITHM_MACROS_H
15 
16 #include <SYS/SYS_Types.h>
17 
18 #define DECLARE_GENERATOR_OP(name) \
19  virtual RU_GeneratorOp<unsigned char,0> *allocateGenerator(unsigned char,int); \
20  virtual RU_GeneratorOp<unsigned short,0> *allocateGenerator(unsigned short,int);\
21  virtual RU_GeneratorOp<unsigned int,0> *allocateGenerator(unsigned int,int); \
22  virtual RU_GeneratorOp<float,0> *allocateGenerator(float,int); \
23  virtual RU_GeneratorOp<fpreal16,0> *allocateGenerator(fpreal16,int); \
24  virtual RU_GeneratorOp<unsigned char,1> *allocateGenerator(unsigned char); \
25  virtual RU_GeneratorOp<unsigned short,1> *allocateGenerator(unsigned short);\
26  virtual RU_GeneratorOp<unsigned int,1> *allocateGenerator(unsigned int); \
27  virtual RU_GeneratorOp<float,1> *allocateGenerator(float); \
28  virtual RU_GeneratorOp<fpreal16,1> *allocateGenerator(fpreal16);
29 
30 
31 #define DECLARE_PIXEL_OP(name) \
32  virtual RU_PixelOp<unsigned char,0> *allocatePixel(unsigned char,int);\
33  virtual RU_PixelOp<unsigned short,0> *allocatePixel(unsigned short,int);\
34  virtual RU_PixelOp<unsigned int,0> *allocatePixel(unsigned int,int); \
35  virtual RU_PixelOp<float,0> *allocatePixel(float,int); \
36  virtual RU_PixelOp<fpreal16,0> *allocatePixel(fpreal16,int); \
37  virtual RU_PixelOp<unsigned char,1> *allocatePixel(unsigned char); \
38  virtual RU_PixelOp<unsigned short,1> *allocatePixel(unsigned short); \
39  virtual RU_PixelOp<unsigned int,1> *allocatePixel(unsigned int); \
40  virtual RU_PixelOp<float,1> *allocatePixel(float); \
41  virtual RU_PixelOp<fpreal16,1> *allocatePixel(fpreal16);
42 
43 #define DECLARE_FILTER_OP(name) \
44  virtual RU_FilterOp<unsigned char,0> *allocateFilter(unsigned char,int);\
45  virtual RU_FilterOp<unsigned short,0> *allocateFilter(unsigned short,int);\
46  virtual RU_FilterOp<unsigned int,0> *allocateFilter(unsigned int,int); \
47  virtual RU_FilterOp<float,0> *allocateFilter(float,int); \
48  virtual RU_FilterOp<fpreal16,0> *allocateFilter(fpreal16,int); \
49  virtual RU_FilterOp<unsigned char,1> *allocateFilter(unsigned char); \
50  virtual RU_FilterOp<unsigned short,1> *allocateFilter(unsigned short); \
51  virtual RU_FilterOp<unsigned int,1> *allocateFilter(unsigned int); \
52  virtual RU_FilterOp<float,1> *allocateFilter(float); \
53  virtual RU_FilterOp<fpreal16,1> *allocateFilter(fpreal16);
54 
55 
56 #define DECLARE_BINARY_OP(name) \
57  virtual RU_BinaryOp<unsigned char,0> *allocateBinary(unsigned char,int); \
58  virtual RU_BinaryOp<unsigned short,0> *allocateBinary(unsigned short,int);\
59  virtual RU_BinaryOp<unsigned int,0> *allocateBinary(unsigned int,int); \
60  virtual RU_BinaryOp<float,0> *allocateBinary(float,int); \
61  virtual RU_BinaryOp<fpreal16,0> *allocateBinary(fpreal16, int); \
62  virtual RU_BinaryOp<unsigned char,1> *allocateBinary(unsigned char); \
63  virtual RU_BinaryOp<unsigned short,1> *allocateBinary(unsigned short); \
64  virtual RU_BinaryOp<unsigned int,1> *allocateBinary(unsigned int); \
65  virtual RU_BinaryOp<float,1> *allocateBinary(float); \
66  virtual RU_BinaryOp<fpreal16,1> *allocateBinary(fpreal16);
67 
68 
69 #define IMPLEMENT_GENERATOR_OP(classname,name) \
70  RU_GeneratorOp<unsigned char,0> *classname::allocateGenerator(unsigned char,int) \
71  { return new name<unsigned char,0>(this); } \
72  RU_GeneratorOp<unsigned short,0> *classname::allocateGenerator(unsigned short,int)\
73  { return new name<unsigned short,0>(this); } \
74  RU_GeneratorOp<unsigned int,0> *classname::allocateGenerator(unsigned int,int) \
75  { return new name<unsigned int,0>(this); } \
76  RU_GeneratorOp<float,0> *classname::allocateGenerator(float,int) \
77  { return new name<float,0>(this); } \
78  RU_GeneratorOp<fpreal16,0> *classname::allocateGenerator(fpreal16,int)\
79  { return new name<fpreal16,0>(this); } \
80  RU_GeneratorOp<unsigned char,1> *classname::allocateGenerator(unsigned char) \
81  { return new name<unsigned char,1>(this); } \
82  RU_GeneratorOp<unsigned short,1> *classname::allocateGenerator(unsigned short)\
83  { return new name<unsigned short,1>(this); } \
84  RU_GeneratorOp<unsigned int,1> *classname::allocateGenerator(unsigned int) \
85  { return new name<unsigned int,1>(this); } \
86  RU_GeneratorOp<float,1> *classname::allocateGenerator(float) \
87  { return new name<float,1>(this); } \
88  RU_GeneratorOp<fpreal16,1> *classname::allocateGenerator(fpreal16) \
89  { return new name<fpreal16,1>(this); }
90 
91 
92 #define IMPLEMENT_PIXEL_OP(classname, name) \
93  RU_PixelOp<unsigned char,0> *classname::allocatePixel(unsigned char,int)\
94  { return new name<unsigned char,0>(this); } \
95  RU_PixelOp<unsigned short,0> *classname::allocatePixel(unsigned short,int)\
96  { return new name<unsigned short,0>(this); } \
97  RU_PixelOp<unsigned int,0> *classname::allocatePixel(unsigned int,int) \
98  { return new name<unsigned int,0>(this); } \
99  RU_PixelOp<float,0> *classname::allocatePixel(float,int) \
100  { return new name<float,0>(this); } \
101  RU_PixelOp<fpreal16,0> *classname::allocatePixel(fpreal16,int) \
102  { return new name<fpreal16,0>(this); } \
103  RU_PixelOp<unsigned char,1> *classname::allocatePixel(unsigned char) \
104  { return new name<unsigned char,1>(this); } \
105  RU_PixelOp<unsigned short,1> *classname::allocatePixel(unsigned short) \
106  { return new name<unsigned short,1>(this); } \
107  RU_PixelOp<unsigned int,1> *classname::allocatePixel(unsigned int) \
108  { return new name<unsigned int,1>(this); } \
109  RU_PixelOp<float,1> *classname::allocatePixel(float) \
110  { return new name<float,1>(this); } \
111  RU_PixelOp<fpreal16,1> *classname::allocatePixel(fpreal16 ) \
112  { return new name<fpreal16,1>(this); }
113 
114 
115 #define IMPLEMENT_FILTER_OP(classname, name) \
116  RU_FilterOp<unsigned char,0> *classname::allocateFilter(unsigned char,int) \
117  { return new name<unsigned char,0>(this); } \
118  RU_FilterOp<unsigned short,0> *classname::allocateFilter(unsigned short,int)\
119  { return new name<unsigned short,0>(this); } \
120  RU_FilterOp<unsigned int,0> *classname::allocateFilter(unsigned int,int)\
121  { return new name<unsigned int,0>(this); } \
122  RU_FilterOp<float,0> *classname::allocateFilter(float,int) \
123  { return new name<float,0>(this); } \
124  RU_FilterOp<fpreal16,0> *classname::allocateFilter(fpreal16,int)\
125  { return new name<fpreal16,0>(this); } \
126  RU_FilterOp<unsigned char,1> *classname::allocateFilter(unsigned char) \
127  { return new name<unsigned char,1>(this); } \
128  RU_FilterOp<unsigned short,1> *classname::allocateFilter(unsigned short)\
129  { return new name<unsigned short,1>(this); } \
130  RU_FilterOp<unsigned int,1> *classname::allocateFilter(unsigned int) \
131  { return new name<unsigned int,1>(this); } \
132  RU_FilterOp<float,1> *classname::allocateFilter(float) \
133  { return new name<float,1>(this); } \
134  RU_FilterOp<fpreal16,1> *classname::allocateFilter(fpreal16) \
135  { return new name<fpreal16,1>(this); }
136 
137 
138 #define IMPLEMENT_BINARY_OP(classname, name) \
139  RU_BinaryOp<unsigned char,0> *classname::allocateBinary(unsigned char,int)\
140  { return new name<unsigned char,0>(this); } \
141  RU_BinaryOp<unsigned short,0> *classname::allocateBinary(unsigned short,int)\
142  { return new name<unsigned short,0>(this); } \
143  RU_BinaryOp<unsigned int,0> *classname::allocateBinary(unsigned int,int) \
144  { return new name<unsigned int,0>(this); } \
145  RU_BinaryOp<float,0> *classname::allocateBinary(float,int) \
146  { return new name<float,0>(this); } \
147  RU_BinaryOp<fpreal16,0> *classname::allocateBinary(fpreal16,int)\
148  { return new name<fpreal16,0>(this); } \
149  RU_BinaryOp<unsigned char,1> *classname::allocateBinary(unsigned char)\
150  { return new name<unsigned char,1>(this); } \
151  RU_BinaryOp<unsigned short,1> *classname::allocateBinary(unsigned short)\
152  { return new name<unsigned short,1>(this); } \
153  RU_BinaryOp<unsigned int,1> *classname::allocateBinary(unsigned int)\
154  { return new name<unsigned int,1>(this); } \
155  RU_BinaryOp<float,1> *classname::allocateBinary(float) \
156  { return new name<float,1>(this); } \
157  RU_BinaryOp<fpreal16,1> *classname::allocateBinary(fpreal16) \
158  { return new name<fpreal16,1>(this); }
159 
160 
161 #endif