HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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) cop.
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 class UT_Thread;
24 class TIL_Plane;
25 class TIL_TileMPlay;
26 class TIL_Raster;
27 class COP2_Node;
28 
29 // The class contains data common between all planes that are being cooked.
31 {
32 public:
34  {}
35 
38  float myBlackPoint;
39  float myWhitePoint;
41  float myGamma;
43 };
44 
45 // This class contains data shared by all threads cooking the same plane in
46 // a node. The number of objects of this class that are active at once is
47 // the number of planes that are being cooked simultaneously by different
48 // threads.
49 //
50 // Note that the common parm data stays the same regardless of which planes of
51 // which nodes are being cooked. myCmomonParms will be set shortly after the
52 // object is constructed.
54 {
55 public:
57  : myCommonParms(0), myNode(0), myPlane(0), myWorkOrder(0), myTileList(0),
58  myArrayIndex(0), myCompMap(0)
59  {}
60 
61  // This method is called when cooking is started on a plane. If multiple
62  // threads are cooking the same plane, this method is called only when the
63  // first thread starts cooking the plane.
65  {
66  UT_ASSERT(!myWorkOrder);
67  int num_tiles = (myTileX2 - myTileX1 + 1) * (myTileY2 - myTileY1 + 1);
68  myWorkOrder = new int[num_tiles];
69  memset(myWorkOrder, 0, num_tiles * sizeof(int));
70 
71  myTileCount = 0;
72  }
73 
74  // This method is called when cooking is finished on a plane.
76  {
77  UT_ASSERT(myWorkOrder);
78  delete [] myWorkOrder;
79  myWorkOrder = 0;
80  }
81 
82  // This convenience method returns the number of tiles to be cooked in
83  // this plane.
84  int totalNumTiles() const
85  {
86  return (myTileX2 - myTileX1 + 1) * (myTileY2 - myTileY1 + 1);
87  }
88 
89  // Data:
91 
93  UT_String myTilePath; // path to the cop node -- TODO: rename
98  const int *myCompMap;
99 
100  // Bounds information:
101  int myX1; // Raster co-ords...
102  int myX2;
103  int myY1;
104  int myY2;
105  int myTileX1; // Tile bounds needed to contain
106  int myTileX2; // the raster coords.
107  int myTileY1;
108  int myTileY2;
109  int myTileOffX; // 0,0 Tile offset from raster 0,0
111  int myXShift; // Tile shift relative to raster.
112  int myYShift;
113 
114  // Shared data that is updated/modified by the threads that are cooking
115  // this node.
117  int *myWorkOrder; // marks if a tile has been processed
118 
120  UT_ValArray<TIL_Tile *> *myTileList; // tiles cooked for this plane
121 };
122 
123 // This class contains information specific to this thread that's not shared
124 // with other threads cooking the same plane of a node.
126 {
127 public:
129  : myPlaneParms(0), myThread(0), myRaster(0), myDevice(0)
130  {}
131 
133  { myPlaneParms = plane_parms; }
134 
135  // Data:
140 
141  // Raster information:
143 
144  // Flipbook information:
147 };
148 
149 #endif
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
const TIL_Plane * myPlane
#define COP2_API
Definition: COP2_API.h:10
UT_ValArray< TIL_Tile * > * myTileList
COP2_CommonCookParms * myCommonParms
COP2_PlaneCookParms * myPlaneParms
void setPlaneParms(COP2_PlaneCookParms *plane_parms)