HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP2_Levels.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: COP2_Levels.h ( COP2 Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __COP2_Levels__
12 #define __COP2_Levels__
13 
14 #define ARG_LEVELS_GAMMA (myParmBase + 2)
15 #define ARG_LEVELS_GAMMA_RED (myParmBase + 6)
16 #define ARG_LEVELS_GAMMA_GREEN (myParmBase + 10)
17 #define ARG_LEVELS_GAMMA_BLUE (myParmBase + 14)
18 #define ARG_LEVELS_GAMMA_A (myParmBase + 18)
19 #define ARG_LEVELS_GAMMA_W (myParmBase + 22)
20 
21 #define ARG_LEVELS_INPUT (myParmBase + 1)
22 #define ARG_LEVELS_RED_INPUT (myParmBase + 5)
23 #define ARG_LEVELS_GREEN_INPUT (myParmBase + 9)
24 #define ARG_LEVELS_BLUE_INPUT (myParmBase + 13)
25 #define ARG_LEVELS_ALPHA_INPUT (myParmBase + 17)
26 #define ARG_LEVELS_W_INPUT (myParmBase + 21)
27 
28 #define ARG_LEVELS_OUTPUT (myParmBase + 4)
29 #define ARG_LEVELS_RED_OUTPUT (myParmBase + 8)
30 #define ARG_LEVELS_GREEN_OUTPUT (myParmBase + 12)
31 #define ARG_LEVELS_BLUE_OUTPUT (myParmBase + 16)
32 #define ARG_LEVELS_ALPHA_OUTPUT (myParmBase + 20)
33 #define ARG_LEVELS_W_OUTPUT (myParmBase + 24)
34 
35 #include "COP2_PixelOp.h"
36 
38 {
39 public:
40 
41  static OP_Node *myConstructor(OP_Network*, const char *,
42  OP_Operator *);
45  static PRM_Template myTemplateList[];
46  static CH_LocalVariable myVariableList[];
47  static const char * myInputLabels[];
48 
49  static const float theGammaMax;
50  static const float theGammaMin;
51  static const char* theName;
52  static const char* theEnglish;
53 
54  virtual const char *className() const;
55 
56 protected:
58  int array_index, float t,
59  int xres, int yres,
60  int thread) override;
61 
62  static int editHist(void *, int, float,
63  const PRM_Template *);
64 private:
65  COP2_Levels(OP_Network *parent, const char *name,
66  OP_Operator *entry);
67  ~COP2_Levels() override;
68 
69  const char *getOperationInfo() override;
70 
71  float GAMMA(float t)
72  { return evalFloat(ARG_LEVELS_GAMMA,0,t); }
73 
74  float GAMMA_RED(float t)
75  { return evalFloat(ARG_LEVELS_GAMMA_RED,0,t); }
76  float GAMMA_GREEN(float t)
77  { return evalFloat(ARG_LEVELS_GAMMA_GREEN,0,t); }
78  float GAMMA_BLUE(float t)
79  { return evalFloat(ARG_LEVELS_GAMMA_BLUE,0,t); }
80  float GAMMA_W(float t)
81  { return evalFloat(ARG_LEVELS_GAMMA_W,0,t); }
82  float GAMMA_ALPHA(float t)
83  { return evalFloat(ARG_LEVELS_GAMMA_A,0,t); }
84 
85  void INPUT_MAP(float t, float &range_min, float &range_max)
86  { loadMapParm(ARG_LEVELS_INPUT, t, range_min, range_max);
87  }
88 
89  void INPUT_RED_MAP(float t, float &range_min, float &range_max)
90  { loadMapParm(ARG_LEVELS_RED_INPUT, t, range_min, range_max);
91  }
92 
93  void INPUT_GREEN_MAP(float t, float &range_min, float &range_max)
94  { loadMapParm(ARG_LEVELS_GREEN_INPUT, t, range_min, range_max);
95  }
96 
97  void INPUT_BLUE_MAP(float t, float &range_min, float &range_max)
98  { loadMapParm(ARG_LEVELS_BLUE_INPUT, t, range_min, range_max);
99  }
100 
101  void INPUT_ALPHA_MAP(float t, float &range_min, float &range_max)
102  { loadMapParm(ARG_LEVELS_ALPHA_INPUT, t, range_min, range_max);
103  }
104 
105  void INPUT_W_MAP(float t, float &range_min, float &range_max)
106  { loadMapParm(ARG_LEVELS_W_INPUT, t, range_min, range_max);
107  }
108 
109 
110  void OUTPUT_MAP(float t, float &range_min, float &range_max)
111  { loadMapParm(ARG_LEVELS_OUTPUT, t, range_min, range_max);
112  }
113 
114  void OUTPUT_RED_MAP(float t, float &range_min, float &range_max)
115  { loadMapParm(ARG_LEVELS_RED_OUTPUT, t, range_min, range_max);
116  }
117 
118  void OUTPUT_GREEN_MAP(float t, float &range_min, float &range_max)
119  { loadMapParm(ARG_LEVELS_GREEN_OUTPUT, t, range_min, range_max);
120  }
121 
122  void OUTPUT_BLUE_MAP(float t, float &range_min, float &range_max)
123  { loadMapParm(ARG_LEVELS_BLUE_OUTPUT, t, range_min, range_max);
124  }
125 
126  void OUTPUT_ALPHA_MAP(float t, float &range_min, float &range_max)
127  { loadMapParm(ARG_LEVELS_ALPHA_OUTPUT, t, range_min, range_max);
128  }
129 
130  void OUTPUT_W_MAP(float t, float &range_min, float &range_max)
131  { loadMapParm(ARG_LEVELS_W_OUTPUT, t, range_min, range_max);
132  }
133 
134  void loadMapParm(const int pi, float t,
135  float& range_min, float& range_max);
136 
137  int myParmBase;
138 
139  static PRM_Name theNames[];
140  static PRM_Range theGammaRange;
141  static PRM_Range theLevelsRange;
142  static PRM_Default theLevelsDef[];
143  static PRM_Default theCompDefs[];
144 
145 };
146 #endif
#define ARG_LEVELS_ALPHA_OUTPUT
Definition: COP2_Levels.h:32
#define ARG_LEVELS_RED_OUTPUT
Definition: COP2_Levels.h:29
static OP_VariablePair myVariablePair
Definition: COP2_Levels.h:44
#define ARG_LEVELS_GAMMA_GREEN
Definition: COP2_Levels.h:16
#define ARG_LEVELS_OUTPUT
Definition: COP2_Levels.h:28
static const char * theName
Definition: COP2_Levels.h:51
#define ARG_LEVELS_W_INPUT
Definition: COP2_Levels.h:26
static const char * theEnglish
Definition: COP2_Levels.h:52
#define ARG_LEVELS_GAMMA
Definition: COP2_Levels.h:14
fpreal evalFloat(int pi, int vi, fpreal t) const
static const float theGammaMax
Definition: COP2_Levels.h:49
virtual const char * getOperationInfo()
#define ARG_LEVELS_INPUT
Definition: COP2_Levels.h:21
static OP_TemplatePair myTemplatePair
Definition: COP2_Levels.h:43
#define ARG_LEVELS_GAMMA_RED
Definition: COP2_Levels.h:15
#define ARG_LEVELS_GREEN_OUTPUT
Definition: COP2_Levels.h:30
#define ARG_LEVELS_GAMMA_W
Definition: COP2_Levels.h:19
#define ARG_LEVELS_BLUE_INPUT
Definition: COP2_Levels.h:24
static const float theGammaMin
Definition: COP2_Levels.h:50
GLuint const GLchar * name
Definition: glcorearb.h:786
#define ARG_LEVELS_GAMMA_BLUE
Definition: COP2_Levels.h:17
#define ARG_LEVELS_GAMMA_A
Definition: COP2_Levels.h:18
#define ARG_LEVELS_W_OUTPUT
Definition: COP2_Levels.h:33
GLdouble t
Definition: glad.h:2397
#define ARG_LEVELS_GREEN_INPUT
Definition: COP2_Levels.h:23
**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 COP2_API
Definition: COP2_API.h:10
__hostdev__ constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Definition: NanoVDB.h:976
#define ARG_LEVELS_BLUE_OUTPUT
Definition: COP2_Levels.h:31
#define ARG_LEVELS_ALPHA_INPUT
Definition: COP2_Levels.h:25
#define ARG_LEVELS_RED_INPUT
Definition: COP2_Levels.h:22
virtual RU_PixelFunction * addPixelFunction(const TIL_Plane *plane, int array_index, float t, int xres, int yres, int thread)=0