HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP2_ThreadCookParms.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_ThreadCookParms.h
7  *
8  * COMMENTS:
9  * This class contains parameters used by threads to cook a
10  * (plane of a) cop2.
11  */
12 
13 #ifndef __COP2_ThreadCookParms_h__
14 #define __COP2_ThreadCookParms_h__
15 
16 #include "COP2_API.h"
17 #include <UT/UT_Assert.h>
18 #include <UT/UT_Lock.h>
19 #include <UT/UT_String.h>
20 #include <UT/UT_ValArray.h>
21 #include <TIL/TIL_Tile.h>
22 #include <OP/OP_Context.h>
23 #include <PXL/PXL_OCIO.h>
24 class UT_Thread;
25 class TIL_Plane;
26 class TIL_TileMPlay;
27 class TIL_Raster;
28 class COP2_Node;
29 
30 // The class contains data common between all planes that are being cooked.
32 {
33 public:
35  {}
36 
39  float myBlackPoint;
40  float myWhitePoint;
43 
44  // Parameters for the output device
45  float myGamma;
47 };
48 
49 // This class contains data shared by all threads cooking the same plane in
50 // a node. The number of objects of this class that are active at once is
51 // the number of planes that are being cooked simultaneously by different
52 // threads.
53 //
54 // Note that the common parm data stays the same regardless of which planes of
55 // which nodes are being cooked. myCmomonParms will be set shortly after the
56 // object is constructed.
58 {
59 public:
61  : myCommonParms(0), myNode(0), myPlane(0), myWorkOrder(0), myTileList(0),
62  myArrayIndex(0), myCompMap(0)
63  {}
64 
65  // This method is called when cooking is started on a plane. If multiple
66  // threads are cooking the same plane, this method is called only when the
67  // first thread starts cooking the plane.
69  {
70  UT_ASSERT(!myWorkOrder);
71  int num_tiles = (myTileX2 - myTileX1 + 1) * (myTileY2 - myTileY1 + 1);
72  myWorkOrder = new int[num_tiles];
73  memset(myWorkOrder, 0, num_tiles * sizeof(int));
74 
75  myTileCount = 0;
76  }
77 
78  // This method is called when cooking is finished on a plane.
80  {
81  UT_ASSERT(myWorkOrder);
82  delete [] myWorkOrder;
83  myWorkOrder = 0;
84  }
85 
86  // This convenience method returns the number of tiles to be cooked in
87  // this plane.
88  int totalNumTiles() const
89  {
90  return (myTileX2 - myTileX1 + 1) * (myTileY2 - myTileY1 + 1);
91  }
92 
93  // Data:
95 
97  UT_String myTilePath; // path to the cop2 node -- TODO: rename
102  const int *myCompMap;
103 
104  // Bounds information:
105  int myX1; // Raster co-ords...
106  int myX2;
107  int myY1;
108  int myY2;
109  int myTileX1; // Tile bounds needed to contain
110  int myTileX2; // the raster coords.
111  int myTileY1;
112  int myTileY2;
113  int myTileOffX; // 0,0 Tile offset from raster 0,0
115  int myXShift; // Tile shift relative to raster.
116  int myYShift;
117 
118  // Shared data that is updated/modified by the threads that are cooking
119  // this node.
121  int *myWorkOrder; // marks if a tile has been processed
122 
124  UT_ValArray<TIL_Tile *> *myTileList; // tiles cooked for this plane
125 };
126 
127 // This class contains information specific to this thread that's not shared
128 // with other threads cooking the same plane of a node.
130 {
131 public:
133  : myPlaneParms(0), myThread(0), myRaster(0), myDevice(0)
134  {}
135 
137  { myPlaneParms = plane_parms; }
138 
139  // Data:
144 
145  // Raster information:
147 
148  // Flipbook information:
151 };
152 
153 #endif
PXL_OCIO::PHandle myOCIO
const TIL_Plane * myPlane
#define COP2_API
Definition: COP2_API.h:10
UT_ValArray< TIL_Tile * > * myTileList
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
COP2_CommonCookParms * myCommonParms
COP2_PlaneCookParms * myPlaneParms
void setPlaneParms(COP2_PlaneCookParms *plane_parms)