HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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) 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.
30
class
COP2_API
COP2_CommonCookParms
31
{
32
public
:
33
COP2_CommonCookParms
()
34
{}
35
36
UT_Lock
myLock
;
37
int
myNumThreads
;
38
float
myBlackPoint
;
39
float
myWhitePoint
;
40
int
myIgnorePoints
;
41
float
myGamma
;
42
bool
myCompleteFlag
;
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.
53
class
COP2_API
COP2_PlaneCookParms
54
{
55
public
:
56
COP2_PlaneCookParms
()
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.
64
void
allocateTileWorkOrder
()
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.
75
void
deallocateTileWorkOrder
()
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:
90
COP2_CommonCookParms
*
myCommonParms
;
91
92
COP2_Node
*
myNode
;
93
UT_String
myTilePath
;
// path to the cop node -- TODO: rename
94
OP_Context
myContext
;
95
const
TIL_Plane
*
myPlane
;
96
int
myWriteProxy
;
97
int
myArrayIndex
;
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
110
int
myTileOffY
;
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.
116
int
myTileCount
;
117
int
*
myWorkOrder
;
// marks if a tile has been processed
118
119
UT_Lock
myTileListLock
;
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.
125
class
COP2_API
COP2_ThreadCookParms
126
{
127
public
:
128
COP2_ThreadCookParms
()
129
: myPlaneParms(0), myThread(0), myRaster(0), myDevice(0)
130
{}
131
132
void
setPlaneParms
(
COP2_PlaneCookParms
*plane_parms)
133
{ myPlaneParms = plane_parms; }
134
135
// Data:
136
COP2_PlaneCookParms
*
myPlaneParms
;
137
UT_Thread
*
myThread
;
138
int
myThreadIndex
;
139
int
myCompIndex
;
140
141
// Raster information:
142
TIL_Raster
*
myRaster
;
143
144
// Flipbook information:
145
bool
myTileOnlyFlag
;
146
TIL_TileMPlay
*
myDevice
;
147
};
148
149
#endif
COP2_CommonCookParms::myLock
UT_Lock myLock
Definition:
COP2_ThreadCookParms.h:36
COP2_CommonCookParms
Definition:
COP2_ThreadCookParms.h:30
COP2_PlaneCookParms::myNode
COP2_Node * myNode
Definition:
COP2_ThreadCookParms.h:92
COP2_PlaneCookParms::totalNumTiles
int totalNumTiles() const
Definition:
COP2_ThreadCookParms.h:84
COP2_CommonCookParms::COP2_CommonCookParms
COP2_CommonCookParms()
Definition:
COP2_ThreadCookParms.h:33
COP2_PlaneCookParms::myX2
int myX2
Definition:
COP2_ThreadCookParms.h:102
COP2_PlaneCookParms::myTileX2
int myTileX2
Definition:
COP2_ThreadCookParms.h:106
COP2_PlaneCookParms::myWriteProxy
int myWriteProxy
Definition:
COP2_ThreadCookParms.h:96
COP2_CommonCookParms::myIgnorePoints
int myIgnorePoints
Definition:
COP2_ThreadCookParms.h:40
COP2_PlaneCookParms::myY2
int myY2
Definition:
COP2_ThreadCookParms.h:104
COP2_PlaneCookParms::myY1
int myY1
Definition:
COP2_ThreadCookParms.h:103
COP2_PlaneCookParms::myArrayIndex
int myArrayIndex
Definition:
COP2_ThreadCookParms.h:97
COP2_PlaneCookParms::myTileCount
int myTileCount
Definition:
COP2_ThreadCookParms.h:116
COP2_PlaneCookParms::myWorkOrder
int * myWorkOrder
Definition:
COP2_ThreadCookParms.h:117
COP2_ThreadCookParms
Definition:
COP2_ThreadCookParms.h:125
UT_ValArray< TIL_Tile * >
UT_Assert.h
COP2_PlaneCookParms::myTileY1
int myTileY1
Definition:
COP2_ThreadCookParms.h:107
COP2_PlaneCookParms
Definition:
COP2_ThreadCookParms.h:53
OP_Context
Definition:
OP_Context.h:44
COP2_ThreadCookParms::myTileOnlyFlag
bool myTileOnlyFlag
Definition:
COP2_ThreadCookParms.h:145
COP2_PlaneCookParms::myTileOffY
int myTileOffY
Definition:
COP2_ThreadCookParms.h:110
UT_SpinLockT< true, false >
UT_String.h
COP2_PlaneCookParms::myTileOffX
int myTileOffX
Definition:
COP2_ThreadCookParms.h:109
COP2_ThreadCookParms::myDevice
TIL_TileMPlay * myDevice
Definition:
COP2_ThreadCookParms.h:146
COP2_PlaneCookParms::myYShift
int myYShift
Definition:
COP2_ThreadCookParms.h:112
TIL_Plane
Definition:
TIL_Plane.h:22
COP2_CommonCookParms::myBlackPoint
float myBlackPoint
Definition:
COP2_ThreadCookParms.h:38
UT_ValArray.h
COP2_PlaneCookParms::myTilePath
UT_String myTilePath
Definition:
COP2_ThreadCookParms.h:93
COP2_CommonCookParms::myCompleteFlag
bool myCompleteFlag
Definition:
COP2_ThreadCookParms.h:42
COP2_ThreadCookParms::COP2_ThreadCookParms
COP2_ThreadCookParms()
Definition:
COP2_ThreadCookParms.h:128
COP2_CommonCookParms::myGamma
float myGamma
Definition:
COP2_ThreadCookParms.h:41
TIL_Raster
Definition:
TIL_Raster.h:29
TIL_Tile.h
COP2_Node
Definition:
COP2_Node.h:74
COP2_PlaneCookParms::myXShift
int myXShift
Definition:
COP2_ThreadCookParms.h:111
COP2_PlaneCookParms::allocateTileWorkOrder
void allocateTileWorkOrder()
Definition:
COP2_ThreadCookParms.h:64
COP2_ThreadCookParms::myCompIndex
int myCompIndex
Definition:
COP2_ThreadCookParms.h:139
COP2_PlaneCookParms::myTileListLock
UT_Lock myTileListLock
Definition:
COP2_ThreadCookParms.h:119
COP2_PlaneCookParms::myPlane
const TIL_Plane * myPlane
Definition:
COP2_ThreadCookParms.h:95
OP_Context.h
COP2_API
#define COP2_API
Definition:
COP2_API.h:10
COP2_CommonCookParms::myNumThreads
int myNumThreads
Definition:
COP2_ThreadCookParms.h:37
COP2_PlaneCookParms::myCompMap
const int * myCompMap
Definition:
COP2_ThreadCookParms.h:98
COP2_PlaneCookParms::myTileY2
int myTileY2
Definition:
COP2_ThreadCookParms.h:108
TIL_TileMPlay
Definition:
TIL_TileMPlay.h:35
COP2_PlaneCookParms::myTileList
UT_ValArray< TIL_Tile * > * myTileList
Definition:
COP2_ThreadCookParms.h:120
UT_String
Definition:
UT_String.h:72
COP2_PlaneCookParms::deallocateTileWorkOrder
void deallocateTileWorkOrder()
Definition:
COP2_ThreadCookParms.h:75
UT_ASSERT
#define UT_ASSERT(ZZ)
Definition:
UT_Assert.h:153
UT_Thread
Definition:
UT_Thread.h:59
COP2_PlaneCookParms::myX1
int myX1
Definition:
COP2_ThreadCookParms.h:101
COP2_ThreadCookParms::myThread
UT_Thread * myThread
Definition:
COP2_ThreadCookParms.h:137
COP2_API.h
COP2_PlaneCookParms::myContext
OP_Context myContext
Definition:
COP2_ThreadCookParms.h:94
COP2_ThreadCookParms::myRaster
TIL_Raster * myRaster
Definition:
COP2_ThreadCookParms.h:142
COP2_PlaneCookParms::COP2_PlaneCookParms
COP2_PlaneCookParms()
Definition:
COP2_ThreadCookParms.h:56
UT_Lock.h
COP2_PlaneCookParms::myCommonParms
COP2_CommonCookParms * myCommonParms
Definition:
COP2_ThreadCookParms.h:90
COP2_ThreadCookParms::myPlaneParms
COP2_PlaneCookParms * myPlaneParms
Definition:
COP2_ThreadCookParms.h:136
COP2_PlaneCookParms::myTileX1
int myTileX1
Definition:
COP2_ThreadCookParms.h:105
COP2_ThreadCookParms::setPlaneParms
void setPlaneParms(COP2_PlaneCookParms *plane_parms)
Definition:
COP2_ThreadCookParms.h:132
COP2_ThreadCookParms::myThreadIndex
int myThreadIndex
Definition:
COP2_ThreadCookParms.h:138
COP2_CommonCookParms::myWhitePoint
float myWhitePoint
Definition:
COP2_ThreadCookParms.h:39
COP2
COP2_ThreadCookParms.h
Generated on Sat Sep 23 2023 02:47:39 for HDK by
1.8.6