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