HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP2_Node.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_Node.h
7  *
8  * COMMENTS:
9  * 2nd Generation Composite operator base class
10  */
11 
12 #ifndef __COP2_Node_h__
13 #define __COP2_Node_h__
14 
15 #include "COP2_API.h"
16 #include <UT/UT_ErrorManager.h>
17 #include <UT/UT_SymbolTable.h>
18 #include <UT/UT_FloatArray.h>
19 #include <UT/UT_IntArray.h>
20 #include <UT/UT_ValArray.h>
21 #include <UT/UT_Array.h>
22 #include <UT/UT_Lock.h>
23 #include <UT/UT_Rect.h>
24 #include <UT/UT_TokenString.h>
25 #include <UT/UT_Thread.h>
26 #include <UT/UT_FilterType.h>
27 #include <UT/UT_VectorTypes.h>
28 
29 #include <OP/OP_Network.h>
30 
31 #include <TIL/TIL_Defines.h>
32 #include <TIL/TIL_Sequence.h>
33 #include <TIL/TIL_Region.h>
34 #include <TIL/TIL_TileList.h>
35 
36 #include "COP2_Common.h"
37 #include "COP2_Context.h"
38 #include "COP2_BoundsCache.h"
39 
40 class UT_Color;
41 class UT_FileLUT;
42 class UT_Interrupt;
43 class UT_StringArray;
44 class IMG_TileOptions;
45 class TIL_Raster;
46 class TIL_TileCache;
47 class TIL_Plane;
48 class TIL_ProxyManager;
49 class TIL_Region;
50 class TIL_Tile;
51 class TIL_TileList;
52 class TIL_TileManager;
53 class TIL_TileMPlay;
54 class PXL_Lookup;
55 class OP_OperatorTable;
56 class OP_TemplatePair;
57 class OP_VariablePair;
58 class COP2_ImageSource;
59 class COP2_PixelFunction;
63 class COP2_CheckpointWrapper;
64 class COP2_CookAreaInfo;
65 class COP2_CookAreaList;
66 class COP2_VolatileParmManager;
68 
70  TIL_Region *, COP2_Node *);
71 
72 
74 {
75 public:
76 
77  // Lets the COP know that we are accessing, and again when we're done.
78  virtual OP_ERROR open(short &key, int clear_errors = 0);
79  bool isOpen() const { return myCopOpenCount > 0; }
80  virtual void close(short key);
81 
82  // gets sequence information for this COP: start/end, res, rate.
83  TIL_Sequence * getSequenceInfo(OP_ERROR *error = 0);
84 
85  // gets the sequence info for an input to this COP.
86  const TIL_Sequence *inputInfo(int input);
87 
88  // gets the sequence time for the current time.
89  float getSequenceTime() const;
90 
91  // gets the image source for the viewer.
92  COP2_ImageSource *getImageSource() { return myImageSource; }
93 
94  virtual void forceRecook(bool evensmartcache = false);
95 
96  // Used for collecting cook timing statistics all nodes in one cook.
97  // You maintain ownership of the table.
98  static void setNodeTimingTable(COP2_DebugTimingTable *table);
99 
100  // Sets the LUT (globally) that will be used for previewing nodes in
101  // the network editor
102  static void
103  setPreviewLUT(const UT_String &name, bool is_ocio = false);
104 
105  static UT_SharedPtr<PXL_Lookup> getPreviewLUT();
106  static const char* getPreviewLUTName();
107 
108  // cooks this COP and produces an output raster, stored in 'raster'.
109  // the second method cooks a sub-region of the image; if subregion
110  // is 1, the raster contains the full image and only the sub-region
111  // is updated. If 0, the raster will only contain the sub-region.
112  // returns 1 on success or 0 if an error occurred.
113  int cookToRaster(TIL_Raster *raster, OP_Context &,
114  const TIL_Plane *plane,
115  int array_index = 0,
116  int subregion = 1, int clear = 1,
117  float black = 0.0F, float white = 1.0F,
118  int compindex = -1,
119  int ignore_bwpoints=0,
120  const int *comp_map=0,
121  float gamma = 1.0F,
122  bool interactive = false);
123 
124  int cookToRaster(TIL_Raster *raster, OP_Context &,
125  const TIL_Plane *plane,
126  int array_index,
127  int xstart,int ystart,int xend,int yend,
128  int subregion = 1, int clear = 1,
129  float black = 0.0F, float white = 1.0F,
130  int compindex = -1,
131  int ignore_bwpoints=0,
132  const int *comp_map=0,
133  float gamma = 1.0F,
134  bool interactive = false,
135  UT_ValArray<TIL_Raster *> *tiles = 0,
136  int tile_index = 0, TIL_TileMPlay * =0,
137  bool cleanup_after = true);
138 
139  // This method cooks multiple output rasters at a time. The arrays must all
140  // be the same size (except in the case of flipbooking to TIL_TileMplay,
141  // where rasters may be empty). Currently, rendering to different
142  // OP_Context resolutions is not supported; only to different
143  // context.myTime's.
144  int cookToRaster(UT_ValArray<TIL_Raster *> &rasters,
145  UT_ValArray<OP_Context *> &contexts,
147  UT_IntArray &array_index,
148  UT_ValArray<const int *> &comp_map,
150  int subregion = 1, int clear = 1,
151  float black = 0.0F, float white = 1.0F,
152  int compindex = -1,
153  int ignore_bwpoints=0,
154  float gamma = 1.0F,
155  bool interactive = false,
156  UT_ValArray<TIL_Raster *> *tiles = 0,
157  int tile_index = 0, TIL_TileMPlay * =0,
158  bool cleanup_after = true);
159 
160  // This method sets data in "plane_parms" corresponding to the other
161  // parameters that are passed in. The plane cooking parms are passed
162  // to the different threads that perform the cooking.
163  void computePlaneCookParms(COP2_PlaneCookParms &plane_parms,
164  OP_Context &context,
165  const TIL_Plane *rplane,
166  int array_index,
167  TIL_Raster *raster,
168  int thread_index,
169  const int *compmap,
170  int xstart, int ystart,
171  int xend, int yend,
172  bool flipbook,
173  UT_ValArray<TIL_Tile *> *tile_list);
174 
175  // Is the specified plane in the tile cache?
176  bool isPlaneCached(const TIL_Plane &refplane,
177  int array_index, float time,
178  int xres, int yres,
179  int xstart, int ystart, int xend, int yend,
180  bool flipbook);
181  bool isPlaneCached(COP2_Context &context,
182  const TIL_Plane &refplane,
183  int xstart, int ystart, int xend, int yend,
184  bool flipbook);
185 
186  // Move tiles for a particular plane from the regular cache into the
187  // list of checkpointed tiles. This method is called from the cook
188  // scheduler.
189  void checkpointCachedTilesForPlane(
190  const TIL_Plane &refplane,
191  int array_index, float time,
192  int xres, int yres,
193  int xstart, int ystart, int xend, int yend,
194  bool flipbook,
195  UT_ValArray<TIL_Tile *> &tile_list);
196  void checkpointCachedTilesForPlane(COP2_Context &context,
197  const TIL_Plane &refplane,
198  int xstart, int ystart, int xend, int yend,
199  bool flipbook,
200  UT_ValArray<TIL_Tile *> &tile_list);
201 
202  // This method maps from playbar time to the time in the sequence when the
203  // node will actually be cooked. File COPs, for example, always cook at
204  // time 0 if their sequence is a single image.
205  double mapTimeIntoSequence(double time);
206 
207 
208  // cooks this OP into a file (which should not be open yet). If scope isn't
209  // null, only the scoped planes in that sequence will be writen to the file.
210  int cookToFile(const UT_StringArray &filenames,
211  const IMG_TileOptions *,
212  const TIL_Sequence *scope,
213  const UT_IntArray &image_index,
214  const char *uselut = 0,
215  float gamma = 1.0F,
216  UT_InclusiveRect *bounds = 0,
217  bool single_frame = false,
218  bool thread_io = false,
219  bool env_map = false,
220  bool use_progress_dialog=true);
221 
222  int cookToFile(const UT_StringArray &filenames,
223  const IMG_TileOptions *,
224  OP_Context &context,
225  const UT_IntArray &image_index,
226  const char *cplane, const char *aplane = 0,
227  const char *uselut = 0,
228  float gamma = 1.0F,
229  UT_InclusiveRect *bounds = 0,
230  bool single_frame = false,
231  bool thread_io = false,
232  bool env_map = false,
233  bool use_progress_dialog=true);
234 
235  void waitForLastFile();
236 
237  // Does a flipbook render. 'info' should contain the planes to render,
238  // the frame range and image size.
239  int cookFlipbook(const TIL_Sequence &info, int step = 1,
240  float gamma = 1.0f,
241  const char *lut = 0, bool startnew=true,
242  bool (*updateCallback)(void *) = 0,
243  void *updateEntity = 0,
244  bool write_houdini_frame = true,
245  const char *session_label = NULL);
246 
247  // returns the identifier for a specific image at this node, described by
248  // context.xres/yres/time, plane and array_index. You must free
249  // the token string when you're done with it.
250  virtual UT_TokenString *getImageIdentifier(const TIL_Plane *plane,
251  int array_index, float t,
252  int xres, int yres,
253  int thread);
254 
255  // getContextData returns an existing context data or allocates a new
256  // context if it's not found. Contexts only exist for a single cook, and
257  // are deleted once close() is called.
258  COP2_Context *getContextData(const TIL_Plane *plane,
259  int array_index,
260  float t,
261  int xres,
262  int yres,
263  int thread,
264  bool force_bounds = true);
265 
266  // Determines the bounds of the operation. Normally (0,0) - (xres-1,yres-1)
267  void getImageBounds(const TIL_Plane *plane, int array,
268  float t, int xres, int yres, int thread,
269  int &x1, int &y1,int &x2, int &y2);
270  inline void getImageBounds(COP2_Context &context,
271  int &x1, int &y1,int &x2, int &y2);
272 
273  // Gets the bounds of input 'input'. Returns false if the input does not
274  // exist.
275  inline bool getInputBounds(int input, COP2_Context &context,
276  int &x1, int &y1, int &x2, int &y2);
277 
278  // General version of above.
279  bool getInputBounds(int input,
280  const TIL_Plane *plane, int array,
281  float t, int xres, int yres,
282  int thread,
283  int &x1, int &y1, int &x2, int &y2);
284 
285  // returns true if the tile at (tilex,tiley) pixel coords is aligned &
286  // the same size as the corresponding tile in the input. This can only
287  // be called once this nodes bounds have been determined (ie, don't call
288  // from computeImageBounds). with_node is optional; it uses a different
289  // node instead of 'this' ('with_node' and its input 'input').
290  bool isTileAlignedWithInput(int input,
291  COP2_Context &context,
292  int tilex, int tiley,
293  COP2_Node *with_node = 0);
294  bool isTileAlignedWithInput(int input,
295  const TIL_Plane *plane,
296  int array_index,
297  float t, int xres, int yres,
298  int thread,
299  int tilex, int tiley,
300  COP2_Node *with_node=0);
301 
302  // The following method is called when you wish to compare the alignment
303  // with the input at a different time.
304  bool isTileAlignedWithInputAtTime(int input,
305  COP2_Context &context,
306  int tilex, int tiley,
307  float input_time,
308  COP2_Node *with_node=0);
309 
310  // The following function is very similar to isTileAlignedWithInput,
311  // except it compares the tile in the specified input plane with that
312  // specified in this node's context. In particular, this is used when
313  // we cannot assume that this node actually contains the input plane.
314  bool isInputTileAlignedWithContext(int input,
315  const TIL_Plane *plane,
316  int tilex, int tiley,
317  COP2_Context &context,
318  COP2_Node *with_node=0);
319 
320  bool arePlanesAligned(COP2_Context &context,
321  const TIL_Plane *plane1, int aindex1,
322  const TIL_Plane *plane2, int aindex2,
323  int tilex, int tiley);
324 
325 
326  bool isInputPlaneCompatible(COP2_Context &context,
327  int input_num);
328 
329  // Returns the difference in origin of the this bound with its input.
330  bool getInputBoundsDiff(int input, COP2_Context &context,
331  int &dx, int &dy);
332 
333 
334  // Allows input COPs to remap the time into their time space.
335  virtual fpreal getTimeTransform(int input, fpreal t);
336 
337  // Set the resolution in the input context to the input's resolution.
338  virtual void getInputRes(int input, fpreal t,
339  const OP_Context &context,
340  OP_Context &icontext);
341 
342  // allows generators to remap their cook time.
343  virtual double remapTime(double t);
344  virtual bool isTimeModifier() const { return false; }
345 
346  // return true if this is a slow operation that may need interactive
347  // quality reduction help.
348  virtual bool isSlowOperation() const { return true; }
349  virtual bool isTimeDepOperation() { return false; }
350  virtual bool isGPUAssisted(const TIL_Plane & /*plane*/,
351  int /*array_index*/, float /*t*/,
352  int /*xres*/, int /*yres*/,
353  int /*thread_index*/)
354  { return false; }
355 
356  virtual bool isGenerator() const { return false; }
357  virtual bool isPixelBased() const { return false; }
358 
359  virtual int getMaskInput() const { return -1; }
360 
361  // these functions return a scale factor for biasing U and V lengths for
362  // things like blur kernels and transforms based on the proxy level,
363  // pixel aspect ratio and interlacing.
364  void getScaleFactors(int xres, int yres,
365  float &sx, float &sy) const;
366  float getXScaleFactor(int xres) const;
367  float getYScaleFactor(int yres) const;
368 
369  // returns a plane which determines what should be displayed in the icon
370  // preview (RGB, alpha, depth, etc).
371  TIL_Plane *getPreviewPlane(int &index);
372  int getPreviewPlane(int &pindex, int &aindex);
373  int isFollowingParent(const COP2_Node *parent);
374  void setPreviewPlane(int pindex, int aindex =0);
375  void parentPreviewChanged();
376 
377  // return one of the follwing if your COP cannot be cooked multithreaded.
378  // COP_MULTITHREADED allows multiple threads in the COP at once.
379  // COP_SINGLE_THREAD allows only one thread in the COP at once, but
380  // releases the lock when the COP cooks its inputs.
381  // COP_EXCLUSIVE_THREAD locks the COP until its cleanup function is called.
382  // This mode pretty much kills multithreaded performance. Use with
383  // care! (useful for debugging code).
384  virtual int isSingleThreadedCop() const {return COP_MULTITHREADED;}
385 
386  // clears out the cache for this node.
387  void clearTilesInCache();
388 
389  // returns true if the frame in question exists. Only really overridden
390  // by the file COP. Set adjust to be true if you can use another frame
391  // in its place (like using the closest frame instead)
392  virtual bool doesFrameExist(int /*frame*/,
393  bool /*adjust*/ =true) { return true; }
394 
395  // frame locking
396 
397  // returns 1 if any plane at any time is locked.
398  int isAnythingLocked() const;
399 
400  // returns 1 if the plane is ever locked.
401  int isPlaneLocked(const TIL_Plane *p) const;
402 
403  // returns 1 if the COP is locked at time t
404  int isSequenceLocked(float t);
405 
406  // returns 1 if the plane is locked at time t
407  int isPlaneLocked(const TIL_Plane *p, float t);
408 
409  // both methods return 1 if the op was successful.
410  int lockPlane(const TIL_Plane *p, float t);
411  int lockPlanes(float t);
412  int unlockPlane(const TIL_Plane *p, float t);
413  int unlockPlanes(float t);
414  int unlockAll();
415 
416  // Disk Caching for this node
417  void enableDiskCache(bool enable);
418  bool isDiskCacheEnabled() const { return myProxyEnable; }
419 
420  // Color selections.
421  virtual void setColorSelection(float *col, int size, bool accum);
422 
423  // Callback from the cache manager to remove tiles from a COP's list
424  // when the tile is thrown out of the cache.
425  static void tileRemovalCallback(void *parent, TIL_Tile *removed);
426  void tileRemoved(TIL_Tile *removed);
427 
428  static void setUpdateCallback(void (*callback)(float, bool, bool));
429  static void setViewerCallback(void (*viewer)(COP2_Node *, void *,
430  TIL_ViewerType ),
431  void *data);
432 
433  // interactive render commands.
434  static void setCookPosition(float u, float v);
435  static void abortCook();
436  static bool isCookAborted();
437  static void resetAbortFlag();
438  static bool isCooking();
439 
440  bool isCookAborted(int thread_index);
441 
442  bool isInterrupted(int threadidx);
443  void setInterrupted(int threadidx);
444 
445  static TIL_TileCache *getCache();
446  static TIL_ProxyManager *getProxyManager();
447  static TIL_TileManager *getTileManager();
448  static bool isInitialized();
449 
451  { return error(); }
452 
453  virtual OP_ERROR error()
454  {
455  // Call OP_Network::getErrorSeverity() directly
456  // here to avoid locking.
458  OP_ERROR csev = myCookErrorManager.getSeverity();
459 
460  return sev > csev ? sev : csev;
461  }
462  virtual OP_ERROR error(OP_Context &context)
463  {
464  // Call OP_Network::getErrorSeverity() directly
465  // here to avoid locking.
467  OP_ERROR csev = myCookErrorManager.getSeverity();
468 
469  return sev > csev ? sev : csev;
470  }
471 
472  // need to add a few things to the parm hash code.
473  virtual UT_TokenString & getParmHashCode(OP_Context &context,
474  int group_mask = 1);
475 
476 
477  // Collapsable Color & transform functions.
478  virtual void getPixelFunction(const TIL_Plane *plane,
479  int array_index, float t,
480  int xres, int yres,
481  int thread,
482  COP2_PixelFunction *&function,
483  bool concatenate,
484  bool dependent_too);
485 
486  virtual void getImageTransform(COP2_Context &context,
487  COP2_TransformParms &parms,
488  COP2_Node *& source,
489  int &input_index);
490 
491  // returns the color of pixel (x,y) for the given plane in color.
492  // 'color' should be big enough to hold the single pixels' values (use
493  // 4 floats if in doubt). If it could not be evaluated, false is returned.
494  // NB: This cooks the COP for the given pixel.
495  //
496  bool getPixelValue(const TIL_Plane *plane,
497  int array_index, float t,
498  int xres, int yres,
499  int x, int y,
500  float *color);
501 
502  bool getPixelValueByUV(const char *plane_name,
503  double u, double v,
504  bool interpolate,
505  UT_FloatArray &vals);
506 
507  bool getPixelColorValueByUV(COP2_ColorComponent comp,
508  double u, double v,
509  bool interpolate,
510  float &val);
511 
512  COP2_ThreadPref getThreadPref() const { return myThreadPreference; }
513 
514  // by default, most nodes can have as many threads as possible in their
515  // cook method. But some COPs can block with more than 1 thread, so this
516  // method gives a hint to the engine as to how many threads to allow at
517  // once in the cook - set 'plane' to the # of threads that can be cooking
518  // a given plane/time in a node; set 'node' to the # of threads that can be
519  // cooking in the node, regardless of plane/time; set 'op' to the # of
520  // threads that can be in a single Operator type at a time.
522  int &plane,
523  int &node,
524  int &op) const
525  { plane = node = op = TIL_MAX_THREADS; }
526 
527  // if true, only thread 0 can cook this operator.
528  virtual bool onlyCookInMainThread() const { return false; }
529 
530  // These functions setup and reset the table which translates thread
531  // process id's into our thread indices (0-TIL_MAX_THREADS).
532  static void setWorkingThreadId(int thread_index);
533  static void clearWorkingThreadId(int thread_index);
534 
535  // Returns the thread index based on the calling thread id
536  // (setWorkingThreadId must have been called first).
537  int getThreadIndex();
538 
539  // Menu building methods.
540  static void buildPlanePreviewMenu(
541  void *, PRM_Name *, int,
542  const PRM_SpareData *, const PRM_Parm *);
543  static void buildScopeMenu(
544  void *, PRM_Name *, int,
545  const PRM_SpareData *, const PRM_Parm *);
546  static void buildPlaneScopeMenu(
547  void *, PRM_Name *, int,
548  const PRM_SpareData *, const PRM_Parm *);
549  static void buildScopeMenuNoColAlpha(
550  void *, PRM_Name *, int,
551  const PRM_SpareData *, const PRM_Parm *);
552  static void buildPlaneMenu(
553  void *, PRM_Name *, int,
554  const PRM_SpareData *, const PRM_Parm *);
555  static void buildCompMenu(
556  void *, PRM_Name *, int,
557  const PRM_SpareData *, const PRM_Parm *);
558  static void buildInputScopeMenu(
559  void *, PRM_Name *, int,
560  const PRM_SpareData *, const PRM_Parm *);
561  static void buildInputPlaneMenu(
562  void *, PRM_Name *, int,
563  const PRM_SpareData *, const PRM_Parm *);
564  static void buildInputCompMenu(
565  void *, PRM_Name *, int,
566  const PRM_SpareData *, const PRM_Parm *);
567 
568  void buildPlaneMenu(PRM_Name *items, int maxsize,
569  bool useinput = false,
570  bool planes_only = false,
571  bool comps_only = false,
572  bool wild = true,
573  int input = 0,
574  bool nocoloralpha = false);
575 
576  static const char *getColorPlaneName();
577  static const char *getAlphaPlaneName();
578  static const char *getMaskPlaneName();
579  static const char *getDepthPlaneName();
580  static const char *getLumPlaneName();
581  static const char *getBumpPlaneName();
582  static const char *getPointPlaneName();
583  static const char *getNormalPlaneName();
584  static const char *getVelocityPlaneName();
585  static const char *getThumbnailPlaneKey();
586 
587  // Override to specify a plane to view in the COP viewer. No preference
588  // by default.
589  virtual bool preferredViewPlane(UT_WorkBuffer &) { return false; }
590 
591  // DEBUG stuff:
592  static int dumpCache(void *me, int i, float t,
593  const PRM_Template *);
594  static void printMe(void *me, std::ostream &os);
595 
596  static void addToFileLoadTime(float t);
597 
598  // Normal Public OP Stuff ************************************************
599  static const char *theChildTableName;
600  virtual const char *getChildType() const { return COP2_OPTYPE_NAME; }
601  virtual const char *getOpType() const { return COP2_OPTYPE_NAME; }
602 
603  virtual OP_OpTypeId getChildTypeID() const { return COP2_OPTYPE_ID; }
604  virtual OP_OpTypeId getOpTypeID() const { return COP2_OPTYPE_ID; }
605 
606  virtual int64 getMemoryUsage(bool inclusive) const
607  {
608  int64 mem = inclusive ? sizeof(*this) : 0;
609  mem += OP_Network::getMemoryUsage(false);
610  // FIXME: Count the actual memory here!!!
611  return mem;
612  }
613 
614  virtual OP_DataType getCookedDataType() const { return OP_RASTER_DATA; }
615  virtual void *getCookedData(OP_Context &) { return 0; }
616 
617  // Query color for Net Overview rendering
618  virtual int getNetOverviewColor( UT_Color &color );
619  virtual void opChanged(OP_EventType type, void *data);
620  virtual void userDataChanged(const UT_StringHolder &key);
621 
622  static void initializeExpressions();
623  static void initializeCache();
624  static void buildOperatorTable(OP_OperatorTable &table);
625  static void installCommands();
626 
629  static PRM_Template myTemplateList[];
630  static CH_LocalVariable myVariableList[];
631 
632  virtual void getNodeSpecificInfoText(OP_Context &context,
633  OP_NodeInfoParms &iparms);
634  virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree,
635  const OP_NodeInfoTreeParms &parms);
636 
637  void inputRes(int input, float t, int xres, int yres,
638  int &i_xres, int &i_yres);
639 
640  // This is the function called by multiple threads to cook the tiles
641  // of a node.
642  void processTile(COP2_ThreadCookParms *p);
643 
644  void setInputBlocked(bool blocked, int thread);
645 
646  // Remove all the regions for this node. This method is called when
647  // a node is uncheckpointed.
648  void removeRegions();
649 
650  // Allows you to define which inputs (or nodes) are opened and closed
651  // by this node.
652  virtual int getNumInputsToOpen() const { return nInputs(); }
653  virtual COP2_Node *getInputToOpen(int i)
654  { return CAST_COP2NODE(getInput(i, true)); }
655 
656  // For the output area (an area of a plane belonging to this node)
657  // and a set of input areas, determine which input areas and which
658  // parts of these areas are needed to cook the output area.
659  virtual void getInputDependenciesForOutputArea(
660  COP2_CookAreaInfo &output_area,
661  const COP2_CookAreaList &input_areas,
662  COP2_CookAreaList &needed_areas);
663 
664  // A checkpoint wrapper is a data structure that's internal to the
665  // cook scheduler. However, it's convenient to have a fast mapping
666  // from a node to a wrapper, the the node stores a pointer to the wrapper.
667  COP2_CheckpointWrapper *getCheckpointWrapper(int array_index);
668  void setCheckpointWrapper(int array_index,
669  COP2_CheckpointWrapper *wrap);
670 
671  // these are basically private for the cook scheduler ----- vvvvvv
672  // COP2_CheckpointWrapper is not a public class.
673  int getNumCheckpointWrappers() const;
674  COP2_CheckpointWrapper *getWrapper(int i) const;
675  void resetCheckpointWrappers();
676  // --------------------------------------------------------- ^^^^^^
677 
678  virtual void modifyViewMatrix(int input,
679  COP2_Context &context,
680  UT_Matrix4 &matrix,
681  float zoom);
682 
683  virtual COP2_Node *selectInput(int px, int py, const char *plane_name,
684  int array_index);
685  /// @{
686  /// Methods defined on OP_Node
687  //Absolute Width
688  virtual fpreal getW() const;
689  //Absolute Height
690  virtual fpreal getH() const;
691  /// @}
692 
693  // call to reset any missing or bad frames.
694  static void resetBadMissingFrames();
695 
696  // Global preferences controlled by the pref dialog.
697  static bool getShowPreviewPref();
698  static void setShowPreviewPref(bool show);
699 
700  virtual unsigned referenceAllParameters(OP_Parameters *from,
701  bool relative_references = true);
702 
703 protected:
704  COP2_Node(OP_Network *net, const char *name, OP_Operator *entry);
705  virtual ~COP2_Node();
706 
707  virtual OP_ERROR cookMe (OP_Context &) { return UT_ERROR_NONE; }
708  virtual bool cook (OP_Context &);
709  virtual OP_ERROR bypassMe(OP_Context &, int &) { return UT_ERROR_NONE; }
710 
711  static unsigned int getCookScore(float cooktime);
712 
713  // Set this appropriately if $W, $H should use the full resolution,
714  // and not the proxy resolution. By default, we use the proxy
715  // resolution, but if the node itself performs the correction, we
716  // want to use the full resolution.
717  void setVariableUseFullRes(bool onoff);
718 
719  virtual bool evalVariableValue(fpreal &val, int index, int thread);
720  virtual bool evalVariableValue(UT_String &v, int i, int thr)
721  { return OP_Network::evalVariableValue(v, i, thr); }
722 
723  virtual void getMyExternalReferences(UT_StringArray &reflist,
724  UT_StringArray *nodelist =0,
725  bool collapse = false,
726  bool check_missing = false,
727  bool show_missing_only=false);
728 
729  void launchViewer(TIL_ViewerType view);
730 
731  // call these methods when an error occurs during cookSequenceInfo().
732  void addError(int code, const char *msg = 0);
733  void addSystemError(const char *msg = 0);
734  void addWarning(int code, const char *msg = 0);
735  void addSystemWarning(const char *msg = 0);
736  void addMessage(int code, const char *msg = 0);
737 
738  // Call these methods when an error occurs during cooking.
739  void addCookError(int code, const char *msg = 0);
740  void addCookSystemError(const char *msg = 0);
741  void addCookWarning(int code, const char *msg = 0);
742  void addCookSystemWarning(int code, const char *msg = 0);
743  void addCookMessage(int code, const char *msg = 0);
744 
746 
747  // normally, an image cooked at 100x100 will look similar to the same image
748  // cooked at 200x200. If your node does NOT scale with resolution, return 1
749  virtual int isScaledImageDifferent() const { return 0; }
750 
751  // inputOpenFailed is called if the node fails to open.
752  virtual void inputOpenFailed(int ) { }
753 
754 
756  { return COP2_THREAD_NO_PREF; }
757 
758  // returns a short phrase describing the operation.
759  virtual const char *getOperationInfo();
760 
761  // cooks the information for the sequence.
762  virtual TIL_Sequence * cookSequenceInfo(OP_ERROR &error) = 0;
763 
764  bool isInputBlocked(int thread);
765 
766  // gets a specific tile of an input.
767  TIL_TileList *inputTile(int input_index,
768  COP2_Context &context,
769  const TIL_Plane *plane,
770  int array_index,
771  float t,
772  int xstart,
773  int ystart,
774  OP_ERROR *err = 0,
775  int block = 1,
776  bool *mask = 0,
777  COP2_Node *fromtile = 0,
778  bool correctorig = true,
779  bool *blocked = 0,
780  bool *was_corrected = 0);
781 
782  // gets a tile out of the plane specified by the context.
783  inline TIL_TileList *inputTile(int input_index,
784  COP2_Context &context,
785  int xstart,
786  int ystart,
787  OP_ERROR *err = 0,
788  int block = 1,
789  bool *mask = 0,
790  bool *blocked = 0,
791  bool *was_corrected = 0);
792 
793  // gets a specific tile of an input that corresponds to this tile.
794  inline TIL_TileList *inputTile(int input,
795  COP2_Context &context,
796  TIL_TileList *mytile,
797  float t,
798  OP_ERROR *err = 0,
799  int block = 1,
800  bool *mask = 0,
801  bool *blocked = 0,
802  bool *was_corrected = 0);
803 
804  // gets a specific tile specified by the tilelist and the context.
805  inline TIL_TileList *inputTile(int input,
806  COP2_Context &context,
807  TIL_TileList *mytile,
808  OP_ERROR *err = 0,
809  int block = 1,
810  bool *mask = 0,
811  bool *blocked = 0,
812  bool *was_corrected = 0);
813 
814  // copies the input tile specified in tilelist.
815  bool copyInput(int input,
816  COP2_Context &context,
817  TIL_TileList *tilelist,
818  float t,
819  OP_ERROR *err = 0,
820  int block = 1,
821  bool *mask = 0);
822 
823  bool copyInput(int input,
824  COP2_Context &context,
825  TIL_TileList *mytile,
826  OP_ERROR *err = 0,
827  int block = 1,
828  bool *mask = 0);
829 
830  // this is a modified version of inputTile() which should be called from
831  // passThroughTiles() only, instead of inputTile().
832  TIL_TileList *passInputTile(int input_index,
833  COP2_Context &context,
834  const TIL_Plane *plane,
835  int array_index,
836  float t,
837  int xstart,
838  int ystart,
839  int block,
840  bool *blocked,
841  bool *mask,
842  COP2_Node *fromTile = 0);
843 
844  // must be used to release a tile returned by inputTile when you are
845  // finished working with it. 'reset' removes the tiles from the cache.
846  void releaseTile(TIL_TileList *&, bool reset = false);
847 
848  // gets a region of an input channel, cooking tiles where necessary.
849  // region_data holds a list of num_region regions, which are allocated
850  // by the caller. returns 0 if errors were encountered.
851  TIL_Region * inputRegion(int input_index,
852  COP2_Context &context,
853  const TIL_Plane *plane,
854  int array_index,
855  float t,
856  int xstart,
857  int ystart,
858  int xend,
859  int yend,
861  int share = 1,
862  void *regionmem[PLANE_MAX_VECTOR_SIZE]=0,
863  bool correct_aspect = true,
864  bool correct_bounds = true,
865  int scan_alignment = 0);
866 
867  // gets a region out of an input. Plane & array index are specified in the
868  // context.
869  inline TIL_Region * inputRegion(int input_index,
870  COP2_Context &context,
871  int xstart,
872  int ystart,
873  int xend,
874  int yend,
876  int share = 1,
877  void *regionmem[PLANE_MAX_VECTOR_SIZE]=0,
878  bool correct_aspect = true,
879  bool correct_bounds = true,
880  int scan_alignment = 0);
881 
882  // gets an input region corresponding to a tilelist, an optional shift and
883  // an option to write the region data directly into the tilelist data.
884  TIL_Region * inputRegion(int input_index,
885  COP2_Context &context,
886  const TIL_Plane *plane,
887  int array_index,
888  float t,
889  TIL_TileList *tilelist,
890  int xshift=0,
891  int yshift=0,
892  int copy = 0,
893  TIL_RegionExtend hold = TIL_BLACK);
894 
895 
896  // gets a region out of an input. Plane & array index are specified in the
897  // context, while the region is determined by the tile dimensions.
898  inline TIL_Region * inputRegion(int input_index,
899  COP2_Context &context,
900  TIL_TileList *tilelist,
901  int xshift=0,
902  int yshift=0,
903  int copy = 0,
904  TIL_RegionExtend hold = TIL_BLACK);
905 
906  // allocates a region for output (ie, files read in scanline by scanline
907  // require temporary storage before being divided into tiles for
908  // efficiency.
909  inline TIL_Region * outputRegion(const TIL_Plane *plane, int array_index,
910  float t, int xres, int yres, int thread,
911  int xstart, int ystart,
912  int xend, int yend,
913  int share = 1,
914  int rindex = 0,
915  int alignment = 0);
916 
917  TIL_Region * outputRegion(COP2_Context &context,
918  int xstart, int ystart,
919  int xend, int yend,
920  int share = 1,
921  int rindex = 0,
922  int alignment = 0);
923 
924  // The following version of outputRegion takes a reference plane to use
925  // to compute the bounds. This is useful, for example, when the region
926  // we wish to store only has one channel, but we wish the plane to have
927  // 3 channels in our sequence info.
928  TIL_Region * outputRegion(const TIL_Plane *plane,
929  const TIL_Plane *ref_plane,
930  int array_index, float t,
931  int xres, int yres, int thread,
932  int xstart, int ystart,
933  int xend, int yend,
934  int share = 1,
935  int rindex = 0,
936  int alignment = 0);
937 
938  ////////////////////////////////////////////////////////////////////////
939  // Simple Scale related functions
940  // Implemented in COP2_NodeScale.C
941 
942  // This method simply scales the input to the current resolution and
943  // copies it into the given tilelist.
944  void scaleInput(int input, COP2_Context &context,
945  const TIL_Plane *plane, int array_index,
946  float t, UT_FilterType xfilter,
947  UT_FilterType yfilter,
948  TIL_TileList *tilelist);
949 
950  // This utility method is used to scale the supplied image bounds by
951  // the specified factors.
952  static void scaleImageArea(float sx, float sy,
953  int ix1, int iy1, int ix2, int iy2,
954  int &x1, int &y1, int &x2, int &y2);
955 
956  ////////////////////////////////////////////////////////////////////////
957  // Transform Related Fucntions
958  // Implemented in COP2_NodeTransform.C
959 
960  // given an area, this grabs the transformed image data from the input.
961  TIL_Region * transformRegion(int input,
962  COP2_Context &context,
963  const TIL_Plane *plane,
964  int aindex,
965  float t,
966  int xres,
967  int yres,
968  int xstart,
969  int ystart,
970  int xend,
971  int yend,
972  const COP2_TransformParms &parms,
973  bool input_aspect_adjust = true,
974  bool streak_off_frame = false);
975 
976  // transforms the input area/plane given by the region.
977  // The region bounds should be in the input's canvas space, if they aren't,
978  // set bounds_in_canvas_space to false;
979  bool transformRegion(int input,
980  COP2_Context &context,
981  TIL_Region *region,
982  const COP2_TransformParms &parms,
983  bool input_aspect_adjust = true,
984  bool bounds_in_canvas_space = true,
985  bool streak_off_frame = false);
986 
987  bool isFullTransform(int input,
988  COP2_Context &context,
989  const COP2_TransformParms &cparms,
990  bool input_aspect_adjust=true,
991  COP2_Node **source_node=0,
992  int *source_index=0,
993  float *aspectx1=0,
994  float *aspectx2=0,
995  float *aspecty1=0,
996  float *aspecty2=0,
997  COP2_TransformParms *prepped_parms=0);
998 
999  TIL_Region * transformBlurRegion(int input,
1000  COP2_Context &context,
1001  const TIL_Plane *plane,
1002  int aindex,
1003  float t,
1004  int xres,
1005  int yres,
1006  int xstart,
1007  int ystart,
1008  int xend,
1009  int yend,
1010  float amount,
1011  float bias,
1013  bool deformation = false);
1014 
1015  bool transformBlurRegion(int input,
1016  COP2_Context &context,
1017  TIL_Region *region,
1018  float amount,
1019  float bias,
1021  bool deformation = false,
1022  bool bounds_in_canvas_space = true);
1023 
1024  // Helper function for transformRegion. It is called when all the
1025  // transform has to do is translate the region.
1026  bool translateRegion(COP2_Context &context,
1027  COP2_Node &source_node,
1028  int source_input,
1029  TIL_Region *region, float tx, float ty,
1030  TIL_RegionExtend hold,
1031  bool bounds_in_canvas_space,
1032  bool streak_off_frame);
1033 
1034  // Helper function for transformRegion. It is called on to do a full
1035  // transform.
1036  bool fullTransformRegion(COP2_Context &context,
1037  COP2_Node &source_node,
1038  int source_input,
1039  TIL_Region *region,
1040  COP2_TransformParms &parms,
1041  float haspect, float input_haspect,
1042  float vaspect, float input_vaspect,
1043  bool bounds_in_canvas_space);
1044 
1045  UT_Matrix4 getShiftedInverseTransformMatrix(COP2_Context &context,
1046  COP2_Node &source_node,
1047  int source_input,
1048  const TIL_Plane *iplane,
1049  int array_index,
1050  const COP2_TransformParms &parms,
1051  int &dx, int &dy);
1052 
1053  // Helper function for transformRegion and computeImageBounds. It is called
1054  // to prepare the transform parms for extraction. This method will do all
1055  // the collapsing of transforms as well. "source_node" will contain the
1056  // node whose input at "source_index" should be read for the data.
1057  // "source_node" will be initialized, but "source_index" needs to be the
1058  // index of the input for which we wish to prepare the parms (it may be
1059  // modified if transforms have collapsed).
1060  void prepareTransformParms(COP2_Context &context,
1061  COP2_TransformParms &parms,
1062  COP2_Node *& source_node,
1063  int &source_index,
1064  bool input_aspect_adjust);
1065 
1066  // adjustPivotParms adjusts the pivot and translate parms in order to
1067  // account for aspect ratios (it is a helper function to
1068  // prepareTransformParms).
1069  void adjustPivotParms(int input_index,
1070  COP2_TransformParms &parms,
1071  bool input_aspect_adjust);
1072 
1073  // Helper function for transformBlurRegion and computeImageBounds. It is
1074  // called to copy the set of transform parms and it prepares the new copies
1075  // for use.
1076  void copyAndPrepareTransformParms(
1078  &source_parms,
1080 
1081  //
1082  ////////////////////////////////////////////////////////////////////////
1083 
1084 
1085  void extractFromOutputRegion(TIL_TileList *tiles,
1086  TIL_Region *output);
1087 
1088  // like releaseTile for regions... call when you're finished with the
1089  // region.
1090  void releaseRegion(TIL_Region *, int output = 0);
1091 
1092  // gets tiles to process for this node. Normally, you just process the
1093  // nodes passed into cookMyTile(); however, if you need more to complete
1094  // the cook efficiently, request more using this function.
1095  // If block is 0, this function may return null. Only COP2_Node should
1096  // ever call this method with block set to 1.
1097  TIL_TileList *requestWorkingTiles(COP2_Context &context,
1098  const TIL_Plane *plane,
1099  int array_index,
1100  float t,
1101  int xstart, int ystart,
1102  int *cache_flag = 0,
1103  int ignore_bypass = 0,
1104  int block = 0);
1105 
1106  // once you're done processing the tiles requested with requestWorkingTiles
1107  // you must call this function. Do not call this function on the tilelist
1108  // passed in to cookMyTile().
1109  void releaseWorkingTiles(TIL_TileList *list);
1110 
1111  // Passes tiles from the input to the output.
1112  virtual void passThroughTiles(COP2_Context &context,
1113  const TIL_Plane *plane,
1114  int array_index,
1115  float t,
1116  int xstart, int ystart,
1117  TIL_TileList *&tile,
1118  int block = 1,
1119  bool *mask = 0,
1120  bool *blocked = 0);
1121 
1122  // return 1 if you want to pass a specific tile through; allows you to
1123  // scope regions of the data.
1124  virtual int passThrough(COP2_Context &context,
1125  const TIL_Plane *plane, int comp_index,
1126  int array_index, float t,
1127  int xstart, int ystart);
1128 
1129  TIL_TileList *getBlackTile(const TIL_Plane *plane, int aindex,
1130  float t, int xres, int yres, int thread,
1131  int xstart, int ystart, bool *mask =0);
1132 
1133  // Called to cook a single tile. Called for each tile in the image.
1134  virtual OP_ERROR cookMyTile(COP2_Context &context,
1135  TIL_TileList *tiles);
1136 
1137 
1138  OP_ERROR cookFullImage(COP2_Context &context,
1139  TIL_TileList *tiles,
1140  COP2_FullImageCB callback,
1141  UT_Lock &fullimagelock,
1142  bool use_float);
1143 
1144  inline void lockParms(bool lock);
1145 
1146  // Returns a new context. Overide to return your context derived from
1147  // COP2_ContextData and initialize it. This should only ever be called from
1148  // getContextData().
1149  virtual COP2_ContextData *newContextData(const TIL_Plane *plane,
1150  int array_index,
1151  float t,
1152  int xres,
1153  int yres,
1154  int thread,
1155  int max_threads);
1156 
1157  // retrieves only the context, without creating a context data.
1158  COP2_Context *getContext(const TIL_Plane *plane,
1159  int array_index,
1160  float t,
1161  int xres,
1162  int yres,
1163  int thread);
1164 
1165  // Copies the bounds of the input specified into the context. The pointers
1166  // are optional; they are assigned to the new bounds if non-null.
1167  bool copyInputBounds(int input, COP2_Context &context,
1168  int *x1 = 0, int *y1 = 0,
1169  int *x2 = 0, int *y2 = 0);
1170 
1171  // Override if your operation expands the op bounds. This method should set
1172  // the bounds in the context using setBounds()
1173  virtual void computeImageBounds(COP2_Context &context);
1174 
1175  // Scoping
1176  virtual bool isFrameScoped(int /*image_index*/) { return true; }
1177  // Override to return a scope string if the COP has a scope field. If there
1178  // is a valid scope, return 1, otherwise 0.
1179  virtual int scope(UT_String & /*scope*/) { return 0; }
1180  virtual int frameScope(UT_String & /*scope*/) { return 0; }
1181 
1182  virtual OP_ERROR save(std::ostream &os, const OP_SaveFlags &flags,
1183  const char *pathPrefix,
1184  const UT_String &name_override = UT_String());
1185  virtual OP_ERROR saveIntrinsic(std::ostream &os, const OP_SaveFlags &flags);
1186  virtual bool load(UT_IStream &is, const char *extension,
1187  const char *path=0);
1188 
1189  // This function will convert a tile at index in the tilelist
1190  // to floating point or return the image data pointer if the tile
1191  // is already FP. This function returns true if it allocated memory that
1192  // you need to free (with delete [])
1193  bool getTileInFP(TIL_TileList *tilelist, float *&dest,
1194  int index, void *dtile =0);
1195 
1196  // This function will write a block of floating point data back to the
1197  // tile at index in the tilelist, converting it if necessary. It's
1198  // assumed that the FP source data is the proper size (tilelist->mySize).
1199  void writeFPtoTile(TIL_TileList *tilelist, float *&src,
1200  int index);
1201 
1202  UT_Interrupt *getInterrupt();
1203 
1204  void setCOPColoring(COP2_OpColorType type, bool enable);
1205 
1206  void getOvercookStats(int &redone, int &total);
1207  void clearOvercookStats();
1208 
1209  void ensureSequenceContainsColorAndAlpha();
1210 
1211  // This method is overridden by COP2_SubNet because its "input" is
1212  // special.
1213  virtual void cleanUpInputsRecursively();
1214 
1215 
1216  // This method returns the cook area info for a given context. Can
1217  // only be called during cookMyTile().
1218  const COP2_CookAreaInfo *getAreaInfo(COP2_Context &context) const;
1219 
1220  // This method makes the output area of the plane depend on all parts of
1221  // all input planes, regardless of the size of the output area.
1222  void makeOutputAreaDependOnAllInputAreas(
1223  COP2_CookAreaInfo &output_area,
1224  const COP2_CookAreaList &input_areas,
1225  COP2_CookAreaList &needed_areas);
1226 
1227  // This method makes the output area depended on all planes for a given
1228  // input.
1229  void makeOutputAreaDependOnInputAreas(int input,
1230  COP2_CookAreaInfo &output_area,
1231  const COP2_CookAreaList &input_areas,
1232  COP2_CookAreaList &needed_areas);
1233 
1234  // Selects a plane from the input to be dependent on. Returns the plane
1235  // added to the needed_areas list.
1236  COP2_CookAreaInfo *makeOutputAreaDependOnInputPlane(int input,
1237  const char *planename, int array_index, float t,
1238  const COP2_CookAreaList &input_areas,
1239  COP2_CookAreaList &needed_areas);
1240 
1241  // selects the corresponding plane from an input to be dependent on.
1242  // Returns the plane added to the needed_areas list.
1243  COP2_CookAreaInfo *makeOutputAreaDependOnMyPlane(int input,
1244  COP2_CookAreaInfo &output_area,
1245  const COP2_CookAreaList &input_areas,
1246  COP2_CookAreaList &needed_areas);
1247 
1248  // This method will try to collapse the transforms in the input areas,
1249  // setting the real input node in the needed areas. It will delete
1250  // the contents of uncollapsed_input_areas.
1251  void getInputAreasForCollapsedTransformInputs(
1252  COP2_Context &context,
1253  const COP2_TransformParms &transform_parms,
1254  COP2_CookAreaInfo &output_area,
1255  COP2_CookAreaList &uncollapsed_input_areas,
1256  COP2_CookAreaList &needed_areas,
1257  bool input_aspect_adjust,
1258  bool clear_uncollapse_list);
1259 
1260  // Override this method if the derived COP does not support partially
1261  // scoped planes and uses the default scope mechanism inside
1262  // COP2_PixelBase.
1263  virtual bool allowPartiallyScopedPlanes() const {return true;}
1264 
1265 
1266  void registerVolatileParm(const char *name,PRM_Callback c,
1267  bool ignore_missing = false);
1268 
1269  // the following set methods will follow channel references, if any
1270  // are present on the parm.
1271  void deAnimateFollowChanRef(const char *parmname,
1272  int vecidx );
1273 
1274  void getDependencyInfo(fpreal t, UT_WorkBuffer &text);
1275  void getDependencyInfoTree(fpreal t, UT_InfoTree &tree);
1276 
1277  void swapParm(const char *name1,const char *name2,
1278  int vsize);
1279  void swapStringParm(const char *name1,const char *name2,
1280  int vsize);
1281 public:
1282  // these are the 'manager' methods for setting up, cooking tiles and
1283  // cleaning up. The functions 'setupCook' and 'cookMyTile' are the ones
1284  // that should be overridden for normal operations. These methods do things
1285  // like lock inputs, make sure the cook is setup, etc.
1286  virtual OP_ERROR setup(float t, int xres, int yres, int max_threads,
1287  bool doinput = true);
1288  OP_ERROR cookTile(TIL_TileList *&, float t,
1289  int xres, int yres, int thread_index,
1290  int max_threads);
1291 
1292  // Clean up this node and its inputs. Cleaning up involves cleaning up
1293  // cook contexts and updating the performance monitor.
1294  void recursivelyCleanUp();
1295  void cleanUpCookContexts();
1296 
1297  // Clean up all the regions. This method is not called as part of the
1298  // normal cleanup.
1299  void cleanUpAllRegions();
1300 
1301  void bumpCookSerial() { myCookSerial++; }
1302  int getCookSerial() { return myCookSerial; }
1303 protected:
1306  unsigned char myCopRecurseFlag :1,
1307  myFramesAllScopedFlag:1;
1311 
1312 private:
1313  UT_ValArray<COP2_Context *> myCookContexts;
1314  UT_ValArray<TIL_Region *> myNonSharedRegions;
1315 
1316  int myInitCook;
1317  int64 myTotalCookTime[TIL_MAX_THREADS];
1318  int64 myInputTileCookTime[TIL_MAX_THREADS];
1319  int64 myTotalTileCookTime[TIL_MAX_THREADS];
1320  unsigned char myCookStateFlags[TIL_MAX_THREADS];
1321  UT_IntArray myInputOpenKeys;
1322  int myCookDepth;
1323  int myCacheHits;
1324  int myCacheMisses;
1325  OP_Context mySequenceContext;
1326  UT_ValArray<copLockInfo *> myLockedPlanes;
1327  int myPreviewPlaneIndex;
1328  int myPreviewPlaneArrayIndex;
1329  OP_ERROR myCookError;
1330  OP_ERROR myLastCopCookError;
1331  float myLastErrorTime;
1332  bool myProxyEnable;
1333  bool myCopDirtyFlag;
1334 
1335  // The following serial counter is included in the image identifier
1336  // string for this node. Forcing a recook will increment this counter,
1337  // thus preventing use of any cached tiles or images.
1338  int myCookSerial;
1339 
1340  // locks
1341  static TIL_FastLock theParmEvalLock;
1342  static TIL_FastLock theParmHashCodeLock;
1343  TIL_FastLock mySingleThreadedLock;
1344  TIL_FastLock mySetupFuncLock;
1345  TIL_FastLock myCookVarLock;
1346  TIL_FastLock myRegionLock;
1347  TIL_FastLock myErrorLock;
1348  TIL_FastLock myIntrLock;
1349  TIL_FastLock myInputBlockLock;
1350  TIL_FastLock myContextDataLock;
1351 
1352  // Viewer image source
1353  COP2_ImageSource *myImageSource;
1354 
1355  // Local variables
1356  int myVarResX[TIL_MAX_THREADS];
1357  int myVarResY[TIL_MAX_THREADS];
1358  int myVarImageIndex[TIL_MAX_THREADS];
1359  float myVarImageTime[TIL_MAX_THREADS];
1360  int myVarImageArray[TIL_MAX_THREADS];
1361  int myVarPlaneIndex[TIL_MAX_THREADS];
1362  int myVarPlaneChannels[TIL_MAX_THREADS];
1363 
1364  unsigned char myVarResUsed :1,
1365  myVarImageArrayUsed :1,
1366  myVarImagePlaneUsed :1,
1367  myVarUseFullRes :1,
1368  myCookOccurred :1;
1369  // Overcooking detection
1370  int myNumCookedTiles;
1371  int myDupCookedTiles;
1372 
1373  UT_Array<COP2_CheckpointWrapper *> myCheckpointWrapper;
1374 
1375  COP2_VolatileParmManager *myVolatileParms;
1376 
1377  // stuff for caching the image bounds.
1378  COP2_BoundsCache myBoundsCache;
1379  TIL_FastLock myBoundsLock;
1380 
1381  // This variable keeps track of the thread that opened the node.
1382  // If the node is not open, then it is set to UT_INVALID_THREAD_ID.
1383  ut_thread_id_t myOpenThreadId;
1384 
1385  // This variable locks the sections in the open() and close()
1386  // functions.
1387  UT_Lock myOpenLock;
1388 
1389  static bool theShowPreviewPref;
1390 
1391 private:
1392  // Sets node's opener thread id. Pass in UT_INVALID_THREAD_ID
1393  // to signal that the node is closed.
1394  void setOpenerThread(ut_thread_id_t thread_id)
1395  { myOpenThreadId = thread_id; }
1396 
1397  // Returns true if the current thread is the same thread that
1398  // opened the node. Returns false if the threads do not match or
1399  // if the node is closed.
1400  bool isOpenerThread() const
1401  { return myOpenThreadId
1402  == UT_Thread::getMyThreadId(); }
1403 
1404  virtual float copTimeTransform(int input, COP2_Context &context,
1405  float t);
1406 
1407  void setupVariables(const TIL_Plane *plane,
1408  int array,
1409  int xres,
1410  int yres,
1411  float t,
1412  int thread);
1413 
1414  // checks for parameter time dependency, and out-of-range keyframes.
1415  void checkTimeDepAndRange();
1416 
1417  // mostly used for debugging & correcting cache problems.
1418  void verifyCacheIntegrity() { }
1419 
1420  // Methods to fetch tiles from the cache or from an input.
1421  int getWorkingTiles(COP2_Context &context,
1422  const TIL_Plane *plane,
1423  int array_index,
1424  float t,
1425  int xstart,int ystart,
1426  TIL_TileList *tilelist,
1427  int ignore_bypass = 0,
1428  int block = 1,
1429  bool *mask = 0,
1430  double *passtime = 0);
1431 
1432  bool fillInteractiveTile(COP2_Context &context,
1433  const TIL_Plane *plane,
1434  int array_index, float t,
1435  int xstart,int ystart,
1436  TIL_Tile *tile, int cindex,
1437  int findex);
1438 
1439  // used only by inputTile, to resolve tile size/offset problems introduced
1440  // by the workspace & scoping channels.
1441  TIL_TileList * correctInputTile(int input_index,
1442  COP2_Context &context,
1443  const TIL_Plane *plane,
1444  int array_index,
1445  int xstart, int ystart,
1446  TIL_TileList *tilelist,
1447  int block, bool *blocked, bool *mask);
1448 
1449  void doneCookOnTiles(TIL_TileList *tiles, OP_ERROR errstate,
1450  int thread_index);
1451 
1452  // This function is used by processTile to send data to a tile devide.
1453  // This is nontrivial because the tile may extend outside the bounds
1454  // of the region of interest for the tile device.
1455  bool writeSafeDeepTile(COP2_ThreadCookParms *p,
1456  TIL_TileList *tilelist) const;
1457 
1458  // performance related functions
1459  void markTimerStart(int64 *now) const;
1460  void getElapsedTime(int64 *now) const;
1461  void appendCookTimesToPerformanceMonitor();
1462  void setCookDepth(int d);
1463 
1464  // Allocates or returns a pointer to a previously allocated region.
1465  TIL_Region * allocateRegion(const TIL_Plane *plane, int input_index,
1466  int array_index, float t,
1467  int xres, int yres,
1468  int x1, int y1, int x2, int y2,
1469  int bx1, int by1, int bx2, int by2,
1470  TIL_RegionExtend hold,
1471  int output, int share,
1472  int scan_alignment);
1473 
1474  // Preps a region for use; only called by allocateRegion & inputRegion.
1475  void openRegion(TIL_Region *region, void *regionmem[4],
1476  bool output);
1477 
1478  // called by the multiprocessor cooks as the 'thread method'.
1479  static void * threadCookTile(void *data);
1480 
1481  // These methods do the actual work of manipulating the rasters.
1482 
1483  // insert into full raster, possibly with a colour subrange.
1484  void insertIntoRaster(TIL_Raster *r, TIL_Tile *t,int tindex,
1485  float low=0.0F,float high=1.0F) const;
1486 
1487  // insert into subregion of a raster, possibly with a colour subrange.
1488  // (x1,y1) -> (x2,y2) defines the rectangular region to be updated.
1489  // (x,y)shift defines how the tile origins are translated to fit into the
1490  // region.
1491  void insertIntoRaster(TIL_Raster *r, TIL_Tile *t,int tindex,
1492  int x1, int y1, int x2, int y2,
1493  int xshift=0, int yshift=0,
1494  float low=0.0F,float high=1.0F,
1495  int greyscale = 0,
1496  int ignore_points =0,
1497  float gamma = 1.0F) const;
1498 
1499  void highlightTile(int thread, int onoff);
1500  void resetHighlight();
1501 
1502  // These methods compute a number of bounds related variables.
1503  void computeBoundsVariables(const OP_Context &context,
1504  const TIL_Plane *rplane,
1505  int array_index, TIL_Raster *raster,
1506  int thread_index,
1507  int orig_xstart, int orig_ystart,
1508  int orig_xend, int orig_yend,
1509  int &xstart, int &ystart, int &xend, int &yend,
1510  int &xtile1, int &ytile1,
1511  int &xtile2, int &ytile2,
1512  int &x1, int &y1, int &x2, int &y2,
1513  int &xshift, int &yshift,
1514  int &bounds_xstart, int &bounds_ystart,
1515  int &bounds_xend, int &bounds_yend,
1516  bool flipbook);
1517 
1518  void computeBoundsVariables(const TIL_Plane *rplane,
1519  float time, int xres, int yres,
1520  int array_index, TIL_Raster *raster,
1521  int thread_index,
1522  int orig_xstart, int orig_ystart,
1523  int orig_xend, int orig_yend,
1524  int &xstart, int &ystart, int &xend, int &yend,
1525  int &xtile1, int &ytile1, int &xtile2, int &ytile2,
1526  int &x1, int &y1, int &x2, int &y2,
1527  int &xshift, int &yshift,
1528  int &bounds_xstart, int &bounds_ystart,
1529  int &bounds_xend, int &bounds_yend,
1530  bool flipbook);
1531 
1532  // This convenience method returns the token string for the plane and
1533  // the tile indices for the area of interest. The area of interest
1534  // (xstart,ystart)-(xend,yend) is in frame space.
1535  UT_TokenString *getPlaneIdentifierAndTileBoundaries(
1536  COP2_Context &context,
1537  const TIL_Plane &refplane,
1538  int xstart, int ystart, int xend, int yend,
1539  int &xtile1, int &ytile1, int &xtile2, int &ytile2,
1540  bool flipbook);
1541 
1542  TIL_Region * getTransformRegionGPU(
1543  COP2_Node &source_node, int source_input,
1544  COP2_Context &context,
1545  const TIL_Plane *plane, int array_index,
1546  int x1, int y1, int x2, int y2,
1547  int input_origx, int input_origy,
1548  int input_xres, int input_yres,
1549  int filt_xoffset, int filt_yoffset,
1550  const COP2_TransformParms &parms,
1551  bool bounds_in_canvas_space,
1552  int &tx1, int &ty1, int &tx2, int &ty2,
1553  int preoffset[2], int postoffset[2]);
1554 
1555  bool fullTransformRegionCPU(COP2_Context &context,
1556  COP2_Node &source_node,
1557  int source_input,
1558  TIL_Region *region,
1559  const COP2_TransformParms &parms,
1560  int x1, int y1, int x2, int y2,
1561  int input_x1, int input_y1,
1562  int input_x2, int input_y2,
1563  int input_xres, int input_yres,
1564  int full_input_xres, int full_input_yres,
1565  int filt_xoffset, int filt_yoffset,
1566  float haspect, float input_haspect,
1567  float vaspect, float input_vaspect,
1568  bool bounds_in_canvas_space,
1569  const UT_Matrix4 &xform);
1570 
1571  bool fullTransformRegionGPU(COP2_Context &context,
1572  COP2_Node &source_node,
1573  int source_input,
1574  TIL_Region *region,
1575  const COP2_TransformParms &parms,
1576  int x1, int y1, int x2, int y2,
1577  int input_x1, int input_y1,
1578  int node_x1, int node_y1,
1579  int node_x2, int node_y2,
1580  int input_xres, int input_yres,
1581  int full_input_xres, int full_input_yres,
1582  int filt_xoffset, int filt_yoffset,
1583  float haspect, float input_haspect,
1584  float vaspect, float input_vaspect,
1585  bool bounds_in_canvas_space,
1586  const UT_Matrix4 &xform);
1587 
1588  bool transformBlurRegionCPU(int input,
1589  COP2_Context &context,
1590  TIL_Region *region,
1592  bool deformation,
1593  float prev, float next, int numtimes,
1594  float itime[3], float ifact[3],
1595  bool bounds_in_canvas_space,
1596  int filt_xoffset, int filt_yoffset,
1597  int input_origx, int input_origy,
1598  int ixres, int iyres,
1599  int x1, int y1, int x2, int y2,
1600  float startt, float endt, float incr,
1601  float bfact);
1602 
1603  bool transformBlurRegionGPU(int input,
1604  COP2_Context &context,
1605  TIL_Region *region,
1607  int deformation,
1608  float prev, float next, int numtimes,
1609  float itime[3], float ifact[3],
1610  bool bounds_in_canvas_space,
1611  int filt_xoffset, int filt_yoffset,
1612  int input_origx, int input_origy,
1613  int ixres, int iyres,
1614  int x1, int y1, int x2, int y2,
1615  float startt, float endt, float incr,
1616  float bfact);
1617 
1618  // These virtuals are methods that nobody should override...
1619  //
1620  // I/O methods
1621  //
1622  virtual bool loadPacket(UT_IStream &is, short class_id, short sig, const char *path=0);
1623  virtual bool loadPacket(UT_IStream &is, const char *token, const char *path=0);
1624 
1625  virtual void deleteCookedData() {}
1626  virtual int saveCookedData(const char *, OP_Context &);
1627  virtual int saveCookedData(std::ostream &, OP_Context &, int = 0)
1628  { return 0; }
1629  virtual const char *getFileExtension(int binary) const
1630  { return binary ? "bcop2" : "cop2"; }
1631 
1632  static void installExpressions();
1633 
1634  friend class COP2_CookScheduler;
1635  friend class COP2_VexVariableMap;
1636  friend class COP2_PixelOp;
1637  friend class COP2_VexOp;
1638  friend class COP2_MaskOp;
1639 };
1640 
1641 inline TIL_TileList *
1642 COP2_Node::inputTile(int input_index, COP2_Context &context,
1643  int xstart, int ystart, OP_ERROR *err, int block,
1644  bool *mask, bool *blocked, bool *was_corrected)
1645 {
1646  return inputTile(input_index, context,
1647  context.myPlane, context.myArrayIndex,
1648  context.myTime, xstart, ystart, err, block, mask, 0,
1649  true, blocked, was_corrected);
1650 }
1651 
1652 
1653 inline TIL_TileList *
1654 COP2_Node::inputTile(int input_index, COP2_Context &context,
1655  TIL_TileList *tiles, OP_ERROR *err, int block,
1656  bool *mask, bool *blocked, bool *was_corrected)
1657 {
1658  return inputTile(input_index, context,
1659  context.myPlane, context.myArrayIndex,
1660  context.myTime,
1661  tiles->myX1,
1662  tiles->myY1,
1663  err, block, mask, 0, true, blocked, was_corrected);
1664 }
1665 
1666 inline TIL_TileList *
1668  TIL_TileList *tilelist, float t,
1669  OP_ERROR *err,int block, bool *mask, bool *blocked,
1670  bool *was_corrected)
1671 {
1672  return inputTile(index, context, tilelist->myPlane, tilelist->myArrayIndex,
1673  t, tilelist->myX1, tilelist->myY1, err, block, mask,
1674  0, true, blocked, was_corrected);
1675 }
1676 
1677 inline TIL_Region *
1678 COP2_Node::inputRegion(int input_index,
1679  COP2_Context &context,
1680  TIL_TileList *tilelist,
1681  int xshift,int yshift, int copy, TIL_RegionExtend hold)
1682 {
1683  return inputRegion(input_index, context,
1684  context.myPlane, context.myArrayIndex,
1685  context.myTime, tilelist, xshift, yshift, copy, hold);
1686 }
1687 
1688 inline TIL_Region *
1689 COP2_Node::inputRegion(int input_index, COP2_Context &context,
1690  int xstart, int ystart, int xend, int yend,
1691  TIL_RegionExtend hold, int share,
1692  void *regionmem[PLANE_MAX_VECTOR_SIZE],
1693  bool correct_aspect, bool correct_bounds,
1694  int scan_alignment)
1695 {
1696  return inputRegion(input_index, context,
1697  context.myPlane, context.myArrayIndex,
1698  context.myTime, xstart, ystart, xend, yend,
1699  hold, share, regionmem, correct_aspect,
1700  correct_bounds, scan_alignment);
1701 }
1702 
1703 inline TIL_Region *
1704 COP2_Node::outputRegion(const TIL_Plane *plane, int array_index, float seqt,
1705  int xres, int yres, int thread,
1706  int xstart, int ystart, int xend, int yend, int share,
1707  int rindex, int alignment)
1708 {
1709  return outputRegion(plane, plane, array_index, seqt, xres, yres, thread,
1710  xstart, ystart, xend, yend, share, rindex,alignment);
1711 }
1712 
1713 inline void
1715 {
1716  if(lock)
1717  TIL_LOCK(theParmEvalLock);
1718  else
1719  TIL_UNLOCK(theParmEvalLock);
1720 }
1721 
1722 inline bool
1724  int &x1, int &y1, int &x2, int &y2)
1725 {
1726  return getInputBounds(input, context.myPlane, context.myArrayIndex,
1727  context.myTime, context.myXres, context.myYres,
1728  context.myThreadIndex, x1,y1, x2,y2);
1729 }
1730 
1731 inline void
1733  int &x1,int &y1, int &x2,int &y2)
1734 {
1735  getImageBounds(context.myPlane, context.myArrayIndex, context.myTime,
1736  context.myXres, context.myYres, context.myThreadIndex,
1737  x1,y1, x2,y2);
1738 }
1739 
1740 // Some common defines.
1741 extern "C" {
1743 };
1744 
1745 #endif
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
SYS_VISIBILITY_EXPORT void newCop2Operator(OP_OperatorTable *table)
install the cop.
UT_ErrorSeverity OP_ERROR
Definition: OP_Error.h:6
#define COP2_OPTYPE_NAME
Definition: OP_Node.h:252
#define TIL_UNLOCK(loc)
Definition: TIL_Defines.h:254
virtual OP_OpTypeId getChildTypeID() const
Definition: COP2_Node.h:603
virtual bool isSlowOperation() const
Definition: COP2_Node.h:348
virtual OP_ERROR error()
virtual OP_ERROR getErrorSeverity()
Definition: COP2_Node.h:450
virtual int getNetOverviewColor(UT_Color &color)
virtual OP_ERROR cookMe(OP_Context &)
Definition: COP2_Node.h:707
virtual fpreal getH() const
Node position/scale is used by the UI.
TIL_Sequence mySequence
Definition: COP2_Node.h:1304
#define SYS_VISIBILITY_EXPORT
virtual bool isPixelBased() const
Definition: COP2_Node.h:357
GT_API const UT_StringHolder time
virtual int isScaledImageDifferent() const
Definition: COP2_Node.h:749
const GLdouble * v
Definition: glcorearb.h:836
void bumpCookSerial()
Definition: COP2_Node.h:1301
GLuint color
Definition: glcorearb.h:1260
virtual bool doesFrameExist(int, bool=true)
Definition: COP2_Node.h:392
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
#define TIL_LOCK(loc)
Definition: TIL_Defines.h:253
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
void lockParms(bool lock)
Definition: COP2_Node.h:1714
int myInterruptFlags
Definition: COP2_Node.h:1308
virtual bool preferredViewPlane(UT_WorkBuffer &)
Definition: COP2_Node.h:589
TIL_RegionExtend
Definition: TIL_Region.h:24
virtual void forceRecook(bool evensmartcache=true)
COP2_ThreadPref getThreadPref() const
Definition: COP2_Node.h:512
GLint GLuint mask
Definition: glcorearb.h:123
UT_ErrorSeverity
Definition: UT_Error.h:25
GLbitfield flags
Definition: glcorearb.h:1595
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
TIL_Region * outputRegion(const TIL_Plane *plane, int array_index, float t, int xres, int yres, int thread, int xstart, int ystart, int xend, int yend, int share=1, int rindex=0, int alignment=0)
Definition: COP2_Node.h:1704
GLint y
Definition: glcorearb.h:102
virtual unsigned referenceAllParameters(OP_Parameters *from, bool relative_references=true)
UT_ErrorManager myCookErrorManager
Definition: COP2_Node.h:745
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &parms)
UT_FilterType
Definition: UT_FilterType.h:16
static OP_VariablePair myVariablePair
Definition: COP2_Node.h:628
png_uint_32 i
Definition: png.h:2877
virtual bool load(UT_IStream &is, const char *ext="", const char *path=0)
static const char * theChildTableName
Definition: COP2_Node.h:599
virtual int getNumInputsToOpen() const
Definition: COP2_Node.h:652
GLsizeiptr size
Definition: glcorearb.h:663
const TIL_Plane * myPlane
Definition: TIL_TileList.h:61
COP2_ThreadPref
Definition: COP2_Common.h:249
virtual unsigned nInputs() const
virtual bool isTimeDepOperation()
Definition: COP2_Node.h:349
virtual bool allowPartiallyScopedPlanes() const
Definition: COP2_Node.h:1263
virtual void opChanged(OP_EventType reason, void *data=0)
long long int64
Definition: SYS_Types.h:107
short myArrayIndex
Definition: TIL_TileList.h:64
virtual int64 getMemoryUsage(bool inclusive) const
OP_ERROR(* COP2_FullImageCB)(COP2_Context &, const TIL_Region *, TIL_Region *, COP2_Node *)
Definition: COP2_Node.h:69
GLfloat f
Definition: glcorearb.h:1925
virtual OP_ERROR getErrorSeverity()
virtual bool isGenerator() const
Definition: COP2_Node.h:356
virtual int scope(UT_String &)
Definition: COP2_Node.h:1179
int myCopOpenCount
Definition: COP2_Node.h:1305
virtual OP_ERROR bypassMe(OP_Context &, int &)
Definition: COP2_Node.h:709
virtual COP2_ThreadPref getThreadPreference() const
Definition: COP2_Node.h:755
virtual bool evalVariableValue(UT_String &v, int i, int thr)
Definition: COP2_Node.h:720
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
virtual OP_ERROR saveIntrinsic(std::ostream &os, const OP_SaveFlags &flags)
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
virtual void getMaxNumThreadsInCook(COP2_Context &, int &plane, int &node, int &op) const
Definition: COP2_Node.h:521
OP_Node * getInput(unsigned idx, bool mark_used=false) const
Returns the node connected to a particular input (may be null).
#define PLANE_MAX_VECTOR_SIZE
Definition: TIL_Defines.h:156
virtual bool cook(OP_Context &context)
virtual void userDataChanged(const UT_StringHolder &key)
virtual fpreal getW() const
Node position/scale is used by the UI.
OP_OpTypeId
Definition: OP_OpTypeId.h:15
GLboolean * data
Definition: glcorearb.h:130
bool isOpen() const
Definition: COP2_Node.h:79
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual const char * getOpType() const
Definition: COP2_Node.h:601
virtual int open(float queuesize)
virtual bool isTimeModifier() const
Definition: COP2_Node.h:344
int getCookSerial()
Definition: COP2_Node.h:1302
bool getInputBounds(int input, COP2_Context &context, int &x1, int &y1, int &x2, int &y2)
Definition: COP2_Node.h:1723
int myInputBlockFlags
Definition: COP2_Node.h:1309
TIL_ViewerType
Definition: TIL_Defines.h:128
virtual OP_ERROR error()
Definition: COP2_Node.h:453
virtual OP_ERROR error(OP_Context &context)
Definition: COP2_Node.h:462
IFDmantra py
Definition: HDK_Image.dox:266
virtual void getInputRes(int input, fpreal t, const OP_Context &context, OP_Context &input_context)
double fpreal
Definition: SYS_Types.h:270
virtual const char * getFileExtension(int binary) const =0
TIL_Region * inputRegion(int input_index, COP2_Context &context, const TIL_Plane *plane, int array_index, float t, int xstart, int ystart, int xend, int yend, TIL_RegionExtend hold=TIL_BLACK, int share=1, void *regionmem[PLANE_MAX_VECTOR_SIZE]=0, bool correct_aspect=true, bool correct_bounds=true, int scan_alignment=0)
virtual bool onlyCookInMainThread() const
Definition: COP2_Node.h:528
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
#define COP2_API
Definition: COP2_API.h:10
Base Integer Rectangle class.
virtual int isSingleThreadedCop() const
Definition: COP2_Node.h:384
virtual fpreal getTimeTransform(int input, fpreal t)
virtual void close()
GLuint index
Definition: glcorearb.h:785
GLint GLenum GLint x
Definition: glcorearb.h:408
GLuint GLfloat * val
Definition: glcorearb.h:1607
static ut_thread_id_t getMyThreadId()
virtual bool loadPacket(UT_IStream &is, short class_id, short sig, const char *path=0)
OP_EventType
Definition: OP_Value.h:22
A global error manager scope.
OP_DataType
Definition: OP_DataTypes.h:28
virtual void getMyExternalReferences(UT_StringArray &reflist, UT_StringArray *nodelist=0, bool collapse=false, bool check_missing=false, bool show_missing_only=false)
static OP_TemplatePair myTemplatePair
Definition: COP2_Node.h:627
virtual void * getCookedData(OP_Context &)
Definition: COP2_Node.h:615
virtual bool evalVariableValue(UT_String &val, int index, int thread)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
#define TIL_MAX_THREADS
Definition: TIL_Defines.h:37
virtual bool isFrameScoped(int)
Definition: COP2_Node.h:1176
virtual OP_OpTypeId getOpTypeID() const
Definition: COP2_Node.h:604
virtual bool isGPUAssisted(const TIL_Plane &, int, float, int, int, int)
Definition: COP2_Node.h:350
void getImageBounds(const TIL_Plane *plane, int array, float t, int xres, int yres, int thread, int &x1, int &y1, int &x2, int &y2)
virtual int frameScope(UT_String &)
Definition: COP2_Node.h:1180
const TIL_Plane * myPlane
Definition: COP2_Context.h:74
virtual OP_ERROR save(std::ostream &os, const OP_SaveFlags &flags, const char *path_prefix="", const UT_String &name_override=UT_String())
virtual COP2_Node * getInputToOpen(int i)
Definition: COP2_Node.h:653
#define COP_MULTITHREADED
Definition: COP2_Common.h:214
GLboolean r
Definition: glcorearb.h:1221
virtual OP_DataType getCookedDataType() const
Definition: COP2_Node.h:614
COP2_ThreadPref myThreadPreference
Definition: COP2_Node.h:1310
virtual void inputOpenFailed(int)
Definition: COP2_Node.h:752
COP2_ImageSource * getImageSource()
Definition: COP2_Node.h:92
virtual int getMaskInput() const
Definition: COP2_Node.h:359
virtual int64 getMemoryUsage(bool inclusive) const
Definition: COP2_Node.h:606
virtual UT_TokenString & getParmHashCode(OP_Context &context, int group_mask=1)
virtual const char * getChildType() const
Definition: COP2_Node.h:600
TIL_TileList * inputTile(int input_index, COP2_Context &context, const TIL_Plane *plane, int array_index, float t, int xstart, int ystart, OP_ERROR *err=0, int block=1, bool *mask=0, COP2_Node *fromtile=0, bool correctorig=true, bool *blocked=0, bool *was_corrected=0)
COP2_ColorComponent
Definition: COP2_Common.h:256
bool isCooking(bool include_ancestors) const
virtual void deleteCookedData()=0
COP2_OpColorType
Definition: COP2_Common.h:242
GLenum src
Definition: glcorearb.h:1792
bool isDiskCacheEnabled() const
Definition: COP2_Node.h:418