HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #define RU_NO_OVERRIDE
23 
24 
25 // Algorithm class manages the different ops. It should be used to contain
26 // parameter and static cook data.
27 
29 {
30 public:
31  RU_Algorithm();
32  virtual ~RU_Algorithm();
33 
34  // Algorithm Initialization
35  //
36  virtual int initialize(float t);
37 
38  // Algorithm function types
39  //
40  int generate (TIL_TileList *output, float t,
41  void *ndata =0, int thread=-1, void *data=0);
42 
43  int pixelAdjust(TIL_TileList *output,
44  const TIL_TileList *input,float t,
45  void *ndata =0, int thread=-1, void *data=0);
46 
47  int filter (TIL_TileList *output,
48  const TIL_Region *input, float t,
49  void *ndata =0, int thread=-1, void *data=0);
50 
51  int filter (TIL_Region *output,
52  const TIL_Region *input, float t,
53  void *ndata =0, int thread=-1, void *data=0);
54 
55  int binary (TIL_TileList *output,
56  const TIL_Region *fore,
57  const TIL_Region *back, float t,
58  void *ndata =0, int thread=-1, void *data=0);
59 
60  int binary (TIL_Region *output,
61  const TIL_Region *fore,
62  const TIL_Region *back, float t,
63  void *ndata =0, int thread=-1, void *data=0);
64 
65  // Derived function allocators - at least one should be defined by
66  // any derived algorithm. Any algorithm can define more than 1.
67  // Pass the name of your class to the appropriate macro.
68  //
69 
70 
71  // Generators produce an output tile without any inputs.
73 
74  // PixelOps produce an output tile with an input tile. Pixel ops cannot use
75  // any pixel values other than themselves during the op.
77 
78  // Filters produce an output tile using an input region. Operations may
79  // use any pixel within the given region.
81 
82  // Binary ops take a background region input and any number of foreground
83  // regions, and produce an output tile. The regions must be the same
84  // format as the output.
86 
87  // call to check for an interrupt. You must pass the node data
88  // and the thread index to generate/pixelAdjust/filter etc.. for this
89  // to work.
90  static bool interruptCheck(int thread);
91 
92 
93  static void setInterruptCallback(bool (*cb)(void *, int));
94 
95 private:
96  static bool (*copInterruptCheck)(void *node, int thread);
97 };
98 
99 
100 
101 
102 #endif
GLenum GLenum GLenum input
Definition: glew.h:13879
#define RU_NO_OVERRIDE
Definition: RU_Algorithm.h:22
#define RU_API
Definition: RU_API.h:10
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glew.h:2981
#define DECLARE_FILTER_OP(name, override_)
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
const GLuint GLenum const void * binary
Definition: glew.h:3502
*Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
#define DECLARE_BINARY_OP(name, override_)
OPENVDB_API void initialize()
Global registration of basic types.
Definition: logging.h:291
#define DECLARE_PIXEL_OP(name, override_)
#define DECLARE_GENERATOR_OP(name, override_)
GLdouble GLdouble t
Definition: glew.h:1398