HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP2_PixelBase.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_PixelBase.h
7  *
8  * COMMENTS:
9  * Base class for single pixel operations (ie. gamma, bright)
10  */
11 #ifndef __COP2_PixelBase_h__
12 #define __COP2_PixelBase_h__
13 
14 #include "COP2_API.h"
15 #include <UT/UT_IntArray.h>
16 #include "COP2_Node.h"
17 
18 #define ARG_PIXELBASE_RGBA "scopergba"
19 #define ARG_PIXELBASE_SCOPE "pscope"
20 #define ARG_PIXELBASE_FSCOPE "fscope"
21 #define ARG_PIXELBASE_FRANGE "frange"
22 #define ARG_PIXELBASE_FDROP "fdropoff"
23 #define ARG_PIXELBASE_FFUNC "fdropfunc"
24 #define ARG_PIXELBASE_FEFFECT "foutside"
25 #define ARG_PIXELBASE_SPECIFIC "flist"
26 // menu 8
27 #define ARG_PIXELBASE_AUTOFRAME "fautoadjust"
28 #define ARG_PIXELBASE_CURLENGTH "currange"
29 
31 {
32 public:
33 
34  virtual TIL_Sequence *cookSequenceInfo(OP_ERROR &err);
35 
37  static PRM_Template myTemplateList[];
38 
39  static int scopeChanged(void *data, int idx, float t,
40  const PRM_Template *);
41  static int toggleScope(void *data, int idx, float t,
42  const PRM_Template *);
43  static int frameChanged(void *data, int idx, float t,
44  const PRM_Template *);
45 
46  virtual bool isPixelBased() const { return true; }
47 
48  void setScope(const UT_String &st);
49 
50  virtual bool isTimeDepOperation();
51 protected:
52  COP2_PixelBase(OP_Network *parent,
53  const char *name,
54  OP_Operator *entry);
55  virtual ~COP2_PixelBase();
56 
57  virtual bool updateParmsFlags();
58 
59  virtual int scope(UT_String &scope);
60  virtual int frameScope(UT_String &scope);
61 
62  virtual bool usesPartialFrameScope() { return true; }
63  virtual float getFrameScopeEffect(int image_index);
64 
66  { return COP2_THREAD_MULTI; }
67 
69  COP2_CookAreaInfo &output_area,
70  const COP2_CookAreaList &input_areas,
71  COP2_CookAreaList &needed_areas);
72 
73  virtual bool isFrameScoped(int image_index);
74 
75  virtual void setDefaultScope(bool color, bool alpha,
76  const char *others);
77 
78 private:
79  void toggleScope(int comp);
80  void updateButtons();
81  void updateFrameScope(int op, float t);
82 
83  void getFrameScope(UT_IntArray &scope_frames,
84  bool &allscoped);
85 
86  void autoAdjustLength(int oldlen, int newlen);
87 
88  int myFrameScopeMethod;
89  float myFrameScopeStart;
90  float myFrameScopeEnd;
91  float myFrameScopePreDrop;
92  float myFrameScopePostDrop;
93  int myFrameScopeFunction;
94  float myFrameScopeEffect;
95  UT_IntArray mySpecificFrames;
96  bool myScopeAllFlag;
97 
98 protected:
99  int RGBA()
100  { return evalInt(ARG_PIXELBASE_RGBA,0,0); }
101 
102 
104  { return evalInt(ARG_PIXELBASE_FSCOPE,0,0); }
105 
106  void FRANGE(float &start, float &end)
107  { start = evalFloat(ARG_PIXELBASE_FRANGE,0,0);
108  end = evalFloat(ARG_PIXELBASE_FRANGE,1,0); }
109 
110  void FDROP(float &start, float &end)
111  { start = evalFloat(ARG_PIXELBASE_FDROP,0,0);
112  end = evalFloat(ARG_PIXELBASE_FDROP,1,0); }
113 
115  { return evalInt(ARG_PIXELBASE_FFUNC,0,0); }
116 
118  { return evalFloat(ARG_PIXELBASE_FEFFECT, 0, 0); }
119 
121  { evalString(st, ARG_PIXELBASE_SPECIFIC,0,0); }
122 
123  int FAUTO()
124  { return evalInt(ARG_PIXELBASE_AUTOFRAME, 0,0); }
125 
127  { return evalInt(ARG_PIXELBASE_CURLENGTH, 0,0); }
128 
129  void SCOPE(UT_String &st)
130  { evalString(st, ARG_PIXELBASE_SCOPE,0,0); }
131 
132 
133  void SET_SCOPE(const UT_String &st)
134  {
137  }
138 
139  void SET_FRANGE(float start, float end)
140  {
141  if( canAccess(PRM_WRITE_OK) )
142  {
145  }
146  }
147 
148  void SET_FDROP(float start, float end)
149  {
150  if( canAccess(PRM_WRITE_OK) )
151  {
154  }
155  }
156 
158  {
159  if( canAccess(PRM_WRITE_OK) )
161  }
162 
163 };
164 
165 #endif
#define ARG_PIXELBASE_SPECIFIC
virtual bool updateParmsFlags()
void SET_SCOPE(const UT_String &st)
#define ARG_PIXELBASE_FFUNC
GLuint start
Definition: glcorearb.h:474
void FRANGE(float &start, float &end)
GLuint color
Definition: glcorearb.h:1260
float FSCOPE_EFFECT()
fpreal evalFloat(int pi, int vi, fpreal t) const
UT_ErrorSeverity
Definition: UT_Error.h:25
void setChRefString(const UT_StringRef &val, CH_StringMeaning meaning, int pi, int vi, fpreal t, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING, bool propagate=true)
#define ARG_PIXELBASE_FSCOPE
static OP_TemplatePair myTemplatePair
void SET_CURRENT_LENGTH(int length)
COP2_ThreadPref
Definition: COP2_Common.h:249
void setSilentFloat(int parmi, int vectori, fpreal t, fpreal value, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
virtual bool isTimeDepOperation()
Definition: COP2_Node.h:349
virtual int scope(UT_String &)
Definition: COP2_Node.h:1179
void FDROP(float &start, float &end)
void setSilentInt(int parmi, int vectori, fpreal t, exint value)
void evalString(UT_String &val, int pi, int vi, fpreal t) const
GLuint GLuint end
Definition: glcorearb.h:474
void FRAME_SPECIFIC(UT_String &st)
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:111
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
#define ARG_PIXELBASE_AUTOFRAME
void SCOPE(UT_String &st)
virtual COP2_ThreadPref getThreadPreference() const
#define ARG_PIXELBASE_CURLENGTH
int canAccess(unsigned mask) const
#define COP2_API
Definition: COP2_API.h:10
virtual void getInputDependenciesForOutputArea(COP2_CookAreaInfo &output_area, const COP2_CookAreaList &input_areas, COP2_CookAreaList &needed_areas)
#define ARG_PIXELBASE_RGBA
#define ARG_PIXELBASE_SCOPE
#define ARG_PIXELBASE_FRANGE
void SET_FRANGE(float start, float end)
#define ARG_PIXELBASE_FDROP
virtual bool isFrameScoped(int)
Definition: COP2_Node.h:1176
#define ARG_PIXELBASE_FEFFECT
virtual int frameScope(UT_String &)
Definition: COP2_Node.h:1180
exint evalInt(int pi, int vi, fpreal t) const
virtual TIL_Sequence * cookSequenceInfo(OP_ERROR &error)=0
virtual bool isPixelBased() const
virtual bool usesPartialFrameScope()
void SET_FDROP(float start, float end)
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794