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