HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RU_Algorithm.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  * Base classes for a templated Raster algorithm.
10  */
11 #ifndef RU_ALGORITHM_H
12 #define RU_ALGORITHM_H
13 
14 #include "RU_API.h"
15 #include "RU_AlgorithmMacros.h"
16 #include "RU_AlgorithmTemplates.h"
17 
18 class TIL_TileList;
19 class TIL_Region;
20 class RU_Algorithm;
21 
22 
23 // Algorithm class manages the different ops. It should be used to contain
24 // parameter and static cook data.
25 
27 {
28 public:
29  RU_Algorithm();
30  virtual ~RU_Algorithm();
31 
32  // Algorithm Initialization
33  //
34  virtual int initialize(float t);
35 
36  // Algorithm function types
37  //
38  int generate (TIL_TileList *output, float t,
39  void *ndata =0, int thread=-1, void *data=0);
40 
41  int pixelAdjust(TIL_TileList *output,
42  const TIL_TileList *input,float t,
43  void *ndata =0, int thread=-1, void *data=0);
44 
45  int filter (TIL_TileList *output,
46  const TIL_Region *input, float t,
47  void *ndata =0, int thread=-1, void *data=0);
48 
49  int filter (TIL_Region *output,
50  const TIL_Region *input, float t,
51  void *ndata =0, int thread=-1, void *data=0);
52 
53  int binary (TIL_TileList *output,
54  const TIL_Region *fore,
55  const TIL_Region *back, float t,
56  void *ndata =0, int thread=-1, void *data=0);
57 
58  int binary (TIL_Region *output,
59  const TIL_Region *fore,
60  const TIL_Region *back, float t,
61  void *ndata =0, int thread=-1, void *data=0);
62 
63  // Derived function allocators - at least one should be defined by
64  // any derived algorithm. Any algorithm can define more than 1.
65  // Pass the name of your class to the appropriate macro.
66  //
67 
68 
69  // Generators produce an output tile without any inputs.
71 
72  // PixelOps produce an output tile with an input tile. Pixel ops cannot use
73  // any pixel values other than themselves during the op.
75 
76  // Filters produce an output tile using an input region. Operations may
77  // use any pixel within the given region.
79 
80  // Binary ops take a background region input and any number of foreground
81  // regions, and produce an output tile. The regions must be the same
82  // format as the output.
84 
85  // call to check for an interrupt. You must pass the node data
86  // and the thread index to generate/pixelAdjust/filter etc.. for this
87  // to work.
88  static bool interruptCheck(int thread);
89 
90 
91  static void setInterruptCallback(bool (*cb)(void *, int));
92 
93 private:
94  static bool (*copInterruptCheck)(void *node, int thread);
95 };
96 
97 
98 
99 
100 #endif
#define DECLARE_FILTER_OP(name)
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
#define RU_API
Definition: RU_API.h:10
#define DECLARE_PIXEL_OP(name)
GLboolean * data
Definition: glcorearb.h:130
OPENVDB_API void initialize()
Global registration of basic types.
Definition: logging.h:316
#define DECLARE_BINARY_OP(name)
#define DECLARE_GENERATOR_OP(name)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296