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 OP_Node;
19 class TIL_TileList;
20 class TIL_Region;
21 class RU_Algorithm;
22 
23 #define RU_NO_OVERRIDE
24 
25 
26 // Algorithm class manages the different ops. It should be used to contain
27 // parameter and static cook data.
28 
30 {
31 public:
32  RU_Algorithm();
33  virtual ~RU_Algorithm();
34 
35  // Algorithm Initialization
36  //
37  virtual int initialize(float t);
38 
39  // Algorithm function types
40  //
41  int generate (TIL_TileList *output, float t,
42  OP_Node *ndata =0, int thread=-1, void *data=0);
43 
44  int pixelAdjust(TIL_TileList *output,
45  const TIL_TileList *input,float t,
46  OP_Node *ndata =0, int thread=-1, void *data=0);
47 
48  int filter (TIL_TileList *output,
49  const TIL_Region *input, float t,
50  OP_Node *ndata =0, int thread=-1, void *data=0);
51 
52  int filter (TIL_Region *output,
53  const TIL_Region *input, float t,
54  OP_Node *ndata =0, int thread=-1, void *data=0);
55 
56  int binary (TIL_TileList *output,
57  const TIL_Region *fore,
58  const TIL_Region *back, float t,
59  OP_Node *ndata =0, int thread=-1, void *data=0);
60 
61  int binary (TIL_Region *output,
62  const TIL_Region *fore,
63  const TIL_Region *back, float t,
64  OP_Node *ndata =0, int thread=-1, void *data=0);
65 
66  // Derived function allocators - at least one should be defined by
67  // any derived algorithm. Any algorithm can define more than 1.
68  // Pass the name of your class to the appropriate macro.
69  //
70 
71 
72  // Generators produce an output tile without any inputs.
74 
75  // PixelOps produce an output tile with an input tile. Pixel ops cannot use
76  // any pixel values other than themselves during the op.
78 
79  // Filters produce an output tile using an input region. Operations may
80  // use any pixel within the given region.
82 
83  // Binary ops take a background region input and any number of foreground
84  // regions, and produce an output tile. The regions must be the same
85  // format as the output.
87 
88  // call to check for an interrupt. You must pass the node data
89  // and the thread index to generate/pixelAdjust/filter etc.. for this
90  // to work.
91  static bool interruptCheck(int thread);
92 
93 
94  static void setInterruptCallback(bool (*cb)(OP_Node *, int));
95 
96 private:
97  static bool (*cop2InterruptCheck)(OP_Node *node, int thread);
98 };
99 
100 
101 
102 
103 #endif
#define RU_NO_OVERRIDE
Definition: RU_Algorithm.h:23
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
#define RU_API
Definition: RU_API.h:10
#define DECLARE_FILTER_OP(name, override_)
#define DECLARE_BINARY_OP(name, override_)
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
GLdouble t
Definition: glad.h:2397
#define DECLARE_PIXEL_OP(name, override_)
**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_GENERATOR_OP(name, override_)
Definition: format.h:895
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297