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  TIL_Sequence *cookSequenceInfo(OP_ERROR &err) override;
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  bool isPixelBased() const override { return true; }
47 
48  void setScope(const UT_String &st);
49 
50  bool isTimeDepOperation() override;
51 protected:
52  COP2_PixelBase(OP_Network *parent,
53  const char *name,
54  OP_Operator *entry);
55  ~COP2_PixelBase() override;
56 
57  bool updateParmsFlags() override;
58 
59  int scope(UT_String &scope) override;
60  int frameScope(UT_String &scope) override;
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) override;
72 
73  bool isFrameScoped(int image_index) override;
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 
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
bool isPixelBased() const override
GLuint start
Definition: glcorearb.h:475
void FRANGE(float &start, float &end)
float FSCOPE_EFFECT()
fpreal evalFloat(int pi, int vi, fpreal t) const
UT_ErrorSeverity
Definition: UT_Error.h:25
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
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:346
virtual int scope(UT_String &)
Definition: COP2_Node.h:1174
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:475
void FRAME_SPECIFIC(UT_String &st)
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:112
GLuint const GLchar * name
Definition: glcorearb.h:786
#define ARG_PIXELBASE_AUTOFRAME
GLdouble t
Definition: glad.h:2397
void SCOPE(UT_String &st)
#define ARG_PIXELBASE_CURLENGTH
int canAccess(unsigned mask) const
#define COP2_API
Definition: COP2_API.h:10
GT_API const UT_StringHolder st
GLuint color
Definition: glcorearb.h:1261
virtual void getInputDependenciesForOutputArea(COP2_CookAreaInfo &output_area, const COP2_CookAreaList &input_areas, COP2_CookAreaList &needed_areas)
#define ARG_PIXELBASE_RGBA
#define ARG_PIXELBASE_SCOPE
COP2_ThreadPref getThreadPreference() const override
#define ARG_PIXELBASE_FRANGE
void SET_FRANGE(float start, float end)
#define ARG_PIXELBASE_FDROP
virtual bool isFrameScoped(int)
Definition: COP2_Node.h:1171
#define ARG_PIXELBASE_FEFFECT
virtual int frameScope(UT_String &)
Definition: COP2_Node.h:1175
exint evalInt(int pi, int vi, fpreal t) const
virtual TIL_Sequence * cookSequenceInfo(OP_ERROR &error)=0
virtual bool usesPartialFrameScope()
Definition: format.h:895
void SET_FDROP(float start, float end)