00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __TIL_DeepRaster__
00020 #define __TIL_DeepRaster__
00021
00022 #include "TIL_API.h"
00023
00024 #include <SYS/SYS_Types.h>
00025 #include <UT/UT_Rect.h>
00026 #include "TIL_Sequence.h"
00027 #include "TIL_Raster.h"
00028
00029 class TIL_API TIL_DeepRaster
00030 {
00031 public:
00032 TIL_DeepRaster();
00033 TIL_DeepRaster(const TIL_DeepRaster &);
00034 virtual ~TIL_DeepRaster();
00035
00036
00037
00038
00039 void copy(const TIL_DeepRaster &src,
00040 const char *scope = NULL,
00041 bool invert_scope = false);
00042
00043
00044 void append( const TIL_DeepRaster &src);
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 void create(const TIL_Sequence &sequence,
00056 bool change_vector2_to_vector3=true,
00057 bool allocate_raster_storage=true);
00058
00059 int getRasterCount() const
00060 { return mySequence.getNumPlanes(); }
00061 TIL_Sequence &getSequence() { return mySequence; }
00062 const TIL_Sequence &getSequence() const { return mySequence; }
00063 TIL_Raster &getRaster(int i) { return myRasters[i]; }
00064 const TIL_Raster &getRaster(int i) const { return myRasters[i]; }
00065
00066
00067 bool writeTile(int plane_index,
00068 int x0, int x1, int y0, int y1,
00069 const void *data);
00070
00071
00072
00073
00074
00075 bool clearOutside(int plane_index,
00076 int x0, int x1, int y0, int y1,
00077 fpreal value=0);
00078
00079
00080 const char *getName() { return myName; }
00081 void setName(const char *name);
00082 void setCropWindow(const UT_DimRect &rect)
00083 { myCropWindow = rect; }
00084 bool hasCropWindow() const
00085 { return !myCropWindow.isEmpty(); }
00086 const UT_DimRect & getCropWindow() const
00087 { return myCropWindow; }
00088 UT_DimRect & getCropWindow()
00089 { return myCropWindow; }
00090 bool hasDataWritten() const
00091 { return !myWriteBox.isEmpty(); }
00092 UT_DimRect & getWrittenWindow()
00093 { return myWriteBox; }
00094 const UT_DimRect & getWrittenWindow() const
00095 { return myWriteBox; }
00096
00097
00098 void setEdgeStreak(int plane,
00099 int ex0, int ex1, int ey0, int ey1);
00100 bool getEdgeStreak(int plane,
00101 int &ex0, int &ex1, int &ey0, int &ey1);
00102 void clearEdgeStreak(int plane);
00103
00104 void setBlackPoint(int plane, fpreal bpoint);
00105 void setWhitePoint(int plane, fpreal wpoint);
00106
00107 bool swapOut() { return writeToDisk(); }
00108 bool swapIn()
00109 {
00110 return mySwapped ? readFromDisk() : true;
00111 }
00112 void clearSwapFile()
00113 {
00114 if (mySwapped)
00115 {
00116 swapIn();
00117 removeDiskFile();
00118 }
00119 }
00120
00121 private:
00122
00123 void copyArrays( TIL_Raster *tmp_Rasters, int *tmp_BPP,
00124 bool *tmp_2Bit, bool *tmp_EdgeStreakFlag,
00125 int *tmp_EdgeStreak, const TIL_DeepRaster &src);
00126 void clear();
00127 void initialize();
00128
00129 bool writeToDisk();
00130 bool readFromDisk();
00131 void removeDiskFile();
00132
00133 TIL_Sequence mySequence;
00134 TIL_Raster *myRasters;
00135 int *myBPP;
00136 bool *my2Bit;
00137 bool *myEdgeStreakFlag;
00138 int *myEdgeStreak;
00139 char *mySwapFile;
00140
00141
00142 char *myName;
00143 UT_DimRect myCropWindow;
00144 UT_DimRect myWriteBox;
00145 bool mySwapped;
00146 };
00147
00148 #endif