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) 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.
31
class
COP2_API
COP2_CommonCookParms
32
{
33
public
:
34
COP2_CommonCookParms
()
35
{}
36
37
UT_Lock
myLock
;
38
int
myNumThreads
;
39
float
myBlackPoint
;
40
float
myWhitePoint
;
41
int
myIgnorePoints
;
42
bool
myCompleteFlag
;
43
44
// Parameters for the output device
45
float
myGamma
;
46
PXL_OCIO::PHandle
myOCIO
;
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.
57
class
COP2_API
COP2_PlaneCookParms
58
{
59
public
:
60
COP2_PlaneCookParms
()
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.
68
void
allocateTileWorkOrder
()
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.
79
void
deallocateTileWorkOrder
()
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:
94
COP2_CommonCookParms
*
myCommonParms
;
95
96
COP2_Node
*
myNode
;
97
UT_String
myTilePath
;
// path to the cop2 node -- TODO: rename
98
OP_Context
myContext
;
99
const
TIL_Plane
*
myPlane
;
100
int
myWriteProxy
;
101
int
myArrayIndex
;
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
114
int
myTileOffY
;
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.
120
int
myTileCount
;
121
int
*
myWorkOrder
;
// marks if a tile has been processed
122
123
UT_Lock
myTileListLock
;
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.
129
class
COP2_API
COP2_ThreadCookParms
130
{
131
public
:
132
COP2_ThreadCookParms
()
133
: myPlaneParms(0), myThread(0), myRaster(0), myDevice(0)
134
{}
135
136
void
setPlaneParms
(
COP2_PlaneCookParms
*plane_parms)
137
{ myPlaneParms = plane_parms; }
138
139
// Data:
140
COP2_PlaneCookParms
*
myPlaneParms
;
141
UT_Thread
*
myThread
;
142
int
myThreadIndex
;
143
int
myCompIndex
;
144
145
// Raster information:
146
TIL_Raster
*
myRaster
;
147
148
// Flipbook information:
149
bool
myTileOnlyFlag
;
150
TIL_TileMPlay
*
myDevice
;
151
};
152
153
#endif
COP2_CommonCookParms::myLock
UT_Lock myLock
Definition:
COP2_ThreadCookParms.h:37
COP2_CommonCookParms
Definition:
COP2_ThreadCookParms.h:31
COP2_PlaneCookParms::myNode
COP2_Node * myNode
Definition:
COP2_ThreadCookParms.h:96
COP2_PlaneCookParms::totalNumTiles
int totalNumTiles() const
Definition:
COP2_ThreadCookParms.h:88
COP2_CommonCookParms::COP2_CommonCookParms
COP2_CommonCookParms()
Definition:
COP2_ThreadCookParms.h:34
COP2_PlaneCookParms::myX2
int myX2
Definition:
COP2_ThreadCookParms.h:106
COP2_PlaneCookParms::myTileX2
int myTileX2
Definition:
COP2_ThreadCookParms.h:110
COP2_PlaneCookParms::myWriteProxy
int myWriteProxy
Definition:
COP2_ThreadCookParms.h:100
COP2_CommonCookParms::myIgnorePoints
int myIgnorePoints
Definition:
COP2_ThreadCookParms.h:41
COP2_PlaneCookParms::myY2
int myY2
Definition:
COP2_ThreadCookParms.h:108
COP2_PlaneCookParms::myY1
int myY1
Definition:
COP2_ThreadCookParms.h:107
COP2_PlaneCookParms::myArrayIndex
int myArrayIndex
Definition:
COP2_ThreadCookParms.h:101
COP2_PlaneCookParms::myTileCount
int myTileCount
Definition:
COP2_ThreadCookParms.h:120
COP2_PlaneCookParms::myWorkOrder
int * myWorkOrder
Definition:
COP2_ThreadCookParms.h:121
COP2_ThreadCookParms
Definition:
COP2_ThreadCookParms.h:129
UT_ValArray< TIL_Tile * >
UT_Assert.h
COP2_PlaneCookParms::myTileY1
int myTileY1
Definition:
COP2_ThreadCookParms.h:111
COP2_PlaneCookParms
Definition:
COP2_ThreadCookParms.h:57
COP2_CommonCookParms::myOCIO
PXL_OCIO::PHandle myOCIO
Definition:
COP2_ThreadCookParms.h:46
OP_Context
Definition:
OP_Context.h:44
COP2_ThreadCookParms::myTileOnlyFlag
bool myTileOnlyFlag
Definition:
COP2_ThreadCookParms.h:149
COP2_PlaneCookParms::myTileOffY
int myTileOffY
Definition:
COP2_ThreadCookParms.h:114
UT_SpinLockT< true, false >
UT_String.h
COP2_PlaneCookParms::myTileOffX
int myTileOffX
Definition:
COP2_ThreadCookParms.h:113
COP2_ThreadCookParms::myDevice
TIL_TileMPlay * myDevice
Definition:
COP2_ThreadCookParms.h:150
COP2_PlaneCookParms::myYShift
int myYShift
Definition:
COP2_ThreadCookParms.h:116
TIL_Plane
Definition:
TIL_Plane.h:24
COP2_CommonCookParms::myBlackPoint
float myBlackPoint
Definition:
COP2_ThreadCookParms.h:39
UT_ValArray.h
COP2_PlaneCookParms::myTilePath
UT_String myTilePath
Definition:
COP2_ThreadCookParms.h:97
COP2_CommonCookParms::myCompleteFlag
bool myCompleteFlag
Definition:
COP2_ThreadCookParms.h:42
COP2_ThreadCookParms::COP2_ThreadCookParms
COP2_ThreadCookParms()
Definition:
COP2_ThreadCookParms.h:132
COP2_CommonCookParms::myGamma
float myGamma
Definition:
COP2_ThreadCookParms.h:45
TIL_Raster
Definition:
TIL_Raster.h:29
TIL_Tile.h
COP2_Node
Definition:
COP2_Node.h:76
COP2_PlaneCookParms::myXShift
int myXShift
Definition:
COP2_ThreadCookParms.h:115
COP2_PlaneCookParms::allocateTileWorkOrder
void allocateTileWorkOrder()
Definition:
COP2_ThreadCookParms.h:68
COP2_ThreadCookParms::myCompIndex
int myCompIndex
Definition:
COP2_ThreadCookParms.h:143
COP2_PlaneCookParms::myTileListLock
UT_Lock myTileListLock
Definition:
COP2_ThreadCookParms.h:123
COP2_PlaneCookParms::myPlane
const TIL_Plane * myPlane
Definition:
COP2_ThreadCookParms.h:99
OP_Context.h
PXL_OCIO::PHandle
Definition:
PXL_OCIO.h:33
COP2_API
#define COP2_API
Definition:
COP2_API.h:10
COP2_CommonCookParms::myNumThreads
int myNumThreads
Definition:
COP2_ThreadCookParms.h:38
COP2_PlaneCookParms::myCompMap
const int * myCompMap
Definition:
COP2_ThreadCookParms.h:102
COP2_PlaneCookParms::myTileY2
int myTileY2
Definition:
COP2_ThreadCookParms.h:112
TIL_TileMPlay
Definition:
TIL_TileMPlay.h:35
COP2_PlaneCookParms::myTileList
UT_ValArray< TIL_Tile * > * myTileList
Definition:
COP2_ThreadCookParms.h:124
UT_String
Definition:
UT_String.h:73
COP2_PlaneCookParms::deallocateTileWorkOrder
void deallocateTileWorkOrder()
Definition:
COP2_ThreadCookParms.h:79
UT_ASSERT
#define UT_ASSERT(ZZ)
Definition:
UT_Assert.h:156
UT_Thread
Definition:
UT_Thread.h:58
COP2_PlaneCookParms::myX1
int myX1
Definition:
COP2_ThreadCookParms.h:105
COP2_ThreadCookParms::myThread
UT_Thread * myThread
Definition:
COP2_ThreadCookParms.h:141
COP2_API.h
PXL_OCIO.h
COP2_PlaneCookParms::myContext
OP_Context myContext
Definition:
COP2_ThreadCookParms.h:98
COP2_ThreadCookParms::myRaster
TIL_Raster * myRaster
Definition:
COP2_ThreadCookParms.h:146
COP2_PlaneCookParms::COP2_PlaneCookParms
COP2_PlaneCookParms()
Definition:
COP2_ThreadCookParms.h:60
UT_Lock.h
COP2_PlaneCookParms::myCommonParms
COP2_CommonCookParms * myCommonParms
Definition:
COP2_ThreadCookParms.h:94
COP2_ThreadCookParms::myPlaneParms
COP2_PlaneCookParms * myPlaneParms
Definition:
COP2_ThreadCookParms.h:140
COP2_PlaneCookParms::myTileX1
int myTileX1
Definition:
COP2_ThreadCookParms.h:109
COP2_ThreadCookParms::setPlaneParms
void setPlaneParms(COP2_PlaneCookParms *plane_parms)
Definition:
COP2_ThreadCookParms.h:136
COP2_ThreadCookParms::myThreadIndex
int myThreadIndex
Definition:
COP2_ThreadCookParms.h:142
COP2_CommonCookParms::myWhitePoint
float myWhitePoint
Definition:
COP2_ThreadCookParms.h:40
COP2
COP2_ThreadCookParms.h
Generated on Tue Dec 17 2024 03:39:37 for HDK by
1.8.6