HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
COP2_ColorReplace.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_ColorReplace.h
7  *
8  * COMMENTS:
9  * Colour replacement op.
10  */
11 #ifndef _COP2_COLORREPLACE_H_
12 #define _COP2_COLORREPLACE_H_
13 
14 #include "COP2_API.h"
15 #define ARG_COLORREPLACE_SRCHUE (myParmBase + 0)
16 #define ARG_COLORREPLACE_SRCLUM (myParmBase + 1)
17 #define ARG_COLORREPLACE_TGTCLR (myParmBase + 2)
18 #define ARG_COLORREPLACE_HUE_ROLLOFF (myParmBase + 3)
19 #define ARG_COLORREPLACE_SAT_ROLLOFF (myParmBase + 4)
20 #define ARG_COLORREPLACE_LUM_ROLLOFF (myParmBase + 5)
21 #define ARG_COLORREPLACE_ROLL_FUNC (myParmBase + 6)
22 #define ARG_COLORREPLACE_OPERATION (myParmBase + 7)
23 
24 class RU_PixelFunction;
25 
26 #include "COP2_PixelOp.h"
27 #include "COP2_KeyBase.h"
28 
30 {
31 public:
32 
33  static OP_Node *myConstructor(OP_Network*, const char *,
34  OP_Operator *);
37  static PRM_Template myTemplateList[];
38  static CH_LocalVariable myVariableList[];
39  static const char * myInputLabels[];
40 
41  // Implementation of functions from COP2_KeyBase:
42  virtual bool hasSpillParms() const { return true; }
43  virtual void setColorParms(float hmin, float hmax,
44  float smin, float smax,
45  float lmin, float lmax,
46  bool add, float t);
47 
48  virtual void setSpillParms(float hmin, float hmax,
49  float smin, float smax,
50  float lmin, float lmax,
51  bool add, float t);
52 
53  protected:
54  virtual COP2_ContextData *newContextData(const TIL_Plane *, int,
55  float t, int xres, int yres,
56  int thread,
57  int max_threads);
58 
59  virtual bool usesPartialFrameScope() { return false; }
60  virtual bool isFrameEffectHandled() { return false; }
61 
62  virtual bool convertToColorSpace(COP2_Context &context,
63  const float *c1, const float *c2,
64  const float *c3, const float *c4,
65  float *&d1, float *&d2,
66  float *&d3, float *&d4,
67  int size);
68 
70  void *&data);
71 
72  virtual void colorFunction(COP2_Context &context,
73  float val[4], float key);
74  virtual int getSuperSample(COP2_Context &context);
75 
76 private:
77  COP2_ColorReplace(OP_Network *parent, const char *name,
78  OP_Operator *entry);
79  virtual ~COP2_ColorReplace();
80 
81  virtual const char *getOperationInfo();
82 
83  void SRC_HUE(float &h1, float &h2, float t)
84  {
85  h1 = evalFloat("srchuesat", 0, t);
86  h2 = evalFloat("srchuesat", 1, t);
87  }
88  void SRC_SAT(float &s1, float &s2, float t)
89  {
90  s1 = evalFloat("srchuesat", 2, t);
91  s2 = evalFloat("srchuesat", 3, t);
92  }
93  void SRC_LUM(float &l1, float &l2, float t)
94  {
95  l1 = evalFloat("srclum", 0, t);
96  l2 = evalFloat("srclum", 1, t);
97  }
98 
99  float TARGET_RED(float t)
100  { return evalFloat("targetclr", 0, t); }
101  float TARGET_GREEN(float t)
102  { return evalFloat("targetclr", 1, t); }
103  float TARGET_BLUE(float t)
104  { return evalFloat("targetclr", 2, t); }
105 
106  float HUE_ROLLOFF(float t)
107  { return evalFloat("hrolloff", 0, t); }
108  float SAT_ROLLOFF(float t)
109  { return evalFloat("srolloff", 0, t); }
110  float LUM_ROLLOFF(float t)
111  { return evalFloat("lrolloff", 0, t); }
112 
113  int ROLLOFF_FUNCTION()
114  { return evalInt("rollfunc", 0, 0.0F); }
115 
116  int OPERATION()
117  { return evalInt("operation", 0, 0.0F); }
118 
119  int SUPER_SAMPLE(float t)
120  { return evalInt("supersample", 0, t); }
121 
122  int myParmBase;
123 };
124 
126 {
127 public:
130 
131  virtual bool createPerRes() const { return false; }
132 
133  float myHueMin;
134  float myHueMax;
135  float mySatMin;
136  float mySatMax;
137  float myLumMin;
138  float myLumMax;
139 
140  float myHueRoll;
141  float mySatRoll;
142  float myLumRoll;
144 
145  float myR;
146  float myG;
147  float myB;
148 
149  float myHue;
150  float mySat;
151  float myLumScale;
152 
154 
156 };
157 #endif
png_voidp s1
Definition: png.h:2193
virtual int getSuperSample(COP2_Context &)
Definition: COP2_KeyBase.h:71
fpreal evalFloat(int pi, int vi, fpreal t) const
virtual void setSpillParms(float hmin, float hmax, float smin, float smax, float lmin, float lmax, bool add, float t)
virtual const char * getOperationInfo()
cop2_InterpType
Definition: COP2_KeyBase.h:22
GLsizeiptr size
Definition: glcorearb.h:663
virtual bool hasSpillParms() const
virtual void setColorParms(float hmin, float hmax, float smin, float smax, float lmin, float lmax, bool add, float t)
static OP_VariablePair myVariablePair
virtual COP2_KeyFunction getKeyFunction(COP2_Context &context, void *&data)
virtual bool usesPartialFrameScope()
virtual COP2_ContextData * newContextData(const TIL_Plane *plane, int array_index, float t, int xres, int yres, int thread, int max_threads)
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual bool createPerRes() const
virtual bool convertToColorSpace(COP2_Context &context, const float *c1, const float *c2, const float *c3, const float *c4, float *&d1, float *&d2, float *&d3, float *&d4, int size)
virtual bool isFrameEffectHandled()
png_voidp png_voidp s2
Definition: png.h:2193
#define COP2_API
Definition: COP2_API.h:10
cop2_InterpType myRolloffFunc
GLuint GLfloat * val
Definition: glcorearb.h:1607
static OP_TemplatePair myTemplatePair
exint evalInt(int pi, int vi, fpreal t) const
virtual void colorFunction(COP2_Context &context, float val[4], float key)
float(* COP2_KeyFunction)(void *data, const float val[4])
Definition: COP2_KeyBase.h:33