00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __COP2_ThreadCookParms_h__
00022 #define __COP2_ThreadCookParms_h__
00023
00024 #include "COP2_API.h"
00025 #include <UT/UT_Assert.h>
00026 #include <UT/UT_Lock.h>
00027 #include <UT/UT_String.h>
00028 #include <UT/UT_PtrArray.h>
00029 #include <TIL/TIL_Tile.h>
00030 #include <OP/OP_Context.h>
00031 class UT_Thread;
00032 class TIL_Plane;
00033 class TIL_TileMPlay;
00034 class TIL_Raster;
00035 class COP2_Node;
00036
00037
00038 class COP2_API COP2_CommonCookParms
00039 {
00040 public:
00041 COP2_CommonCookParms()
00042 {}
00043
00044 UT_Lock myLock;
00045 int myNumThreads;
00046 float myBlackPoint;
00047 float myWhitePoint;
00048 int myIgnorePoints;
00049 float myGamma;
00050 bool myCompleteFlag;
00051 };
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 class COP2_API COP2_PlaneCookParms
00062 {
00063 public:
00064 COP2_PlaneCookParms()
00065 : myCommonParms(0), myNode(0), myPlane(0), myWorkOrder(0), myTileList(0),
00066 myArrayIndex(0), myCompMap(0)
00067 {}
00068
00069
00070
00071
00072 void allocateTileWorkOrder()
00073 {
00074 UT_ASSERT(!myWorkOrder);
00075 int num_tiles = (myTileX2 - myTileX1 + 1) * (myTileY2 - myTileY1 + 1);
00076 myWorkOrder = new int[num_tiles];
00077 memset(myWorkOrder, 0, num_tiles * sizeof(int));
00078
00079 myTileCount = 0;
00080 }
00081
00082
00083 void deallocateTileWorkOrder()
00084 {
00085 UT_ASSERT(myWorkOrder);
00086 delete [] myWorkOrder;
00087 myWorkOrder = 0;
00088 }
00089
00090
00091
00092 int totalNumTiles() const
00093 {
00094 return (myTileX2 - myTileX1 + 1) * (myTileY2 - myTileY1 + 1);
00095 }
00096
00097
00098 COP2_CommonCookParms *myCommonParms;
00099
00100 COP2_Node *myNode;
00101 UT_String myTilePath;
00102 OP_Context myContext;
00103 const TIL_Plane *myPlane;
00104 int myWriteProxy;
00105 int myArrayIndex;
00106 const int *myCompMap;
00107
00108
00109 int myX1;
00110 int myX2;
00111 int myY1;
00112 int myY2;
00113 int myTileX1;
00114 int myTileX2;
00115 int myTileY1;
00116 int myTileY2;
00117 int myTileOffX;
00118 int myTileOffY;
00119 int myXShift;
00120 int myYShift;
00121
00122
00123
00124 int myTileCount;
00125 int *myWorkOrder;
00126
00127 UT_Lock myTileListLock;
00128 UT_PtrArray<TIL_Tile *> *myTileList;
00129 };
00130
00131
00132
00133 class COP2_API COP2_ThreadCookParms
00134 {
00135 public:
00136 COP2_ThreadCookParms()
00137 : myPlaneParms(0), myThread(0), myRaster(0), myDevice(0)
00138 {}
00139
00140 void setPlaneParms(COP2_PlaneCookParms *plane_parms)
00141 { myPlaneParms = plane_parms; }
00142
00143
00144 COP2_PlaneCookParms *myPlaneParms;
00145 UT_Thread *myThread;
00146 int myThreadIndex;
00147 int myCompIndex;
00148
00149
00150 TIL_Raster *myRaster;
00151
00152
00153 bool myTileOnlyFlag;
00154 TIL_TileMPlay *myDevice;
00155 };
00156
00157 #endif