00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 #ifndef INC_GDRAWCON
00102 #define INC_GDRAWCON
00103
00104
00105 class TranspGradTable;
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128 class GDrawContext : public SimpleCCObject
00129 {
00130 public:
00131
00132 GDrawContext();
00133 virtual ~GDrawContext();
00134
00135 virtual BOOL Init() = 0;
00136
00137 virtual eError GetLastError() = 0;
00138
00139 virtual INT32 GetGraduationTableSize() = 0;
00140 virtual INT32 GetGraduationTableLength() = 0;
00141 virtual INT32 GetLongGraduationTableSize() = 0;
00142 virtual INT32 GetLongGraduationTableLength() = 0;
00143 virtual INT32 GetTransparentGraduationTableSize() = 0;
00144 virtual INT32 GetTransparentGraduationTableLength() = 0;
00145 virtual INT32 GetLongTransparentGraduationTableSize() = 0;
00146 virtual INT32 GetLongTransparentGraduationTableLength() = 0;
00147
00148 virtual void SetStackLimit( LPVOID ) = 0;
00149 virtual void SetStackSize( DWORD ) = 0;
00150
00151 virtual BOOL SetupBitmap( INT32 Width, INT32 Height, INT32 Depth, LPBYTE Bits, DWORD Format = 2, BOOL DoBiCompression = FALSE ) = 0;
00152 virtual BOOL SetBitmap( CONST LPBITMAPINFOHEADER BitmapInfo, CONST LPBYTE Bitmap, DWORD BitmapFormat = 2) = 0;
00153
00154 virtual BOOL SetMatrix( GMATRIX* ) = 0;
00155 virtual void SetAntialiasFlag( BOOL ) = 0;
00156 virtual void SetAntialiasQualityFlag( BOOL ) = 0;
00157 virtual void SetTileSmoothingFlag( BOOL ) = 0;
00158 virtual void SetTileFilteringFlag( BOOL ) = 0;
00159 virtual void SetMaxFilterSize( UINT32 ) = 0;
00160 virtual BOOL Sharpen( INT32 ) = 0;
00161 virtual BOOL Blur( INT32 ) = 0;
00162 virtual void SetHintingFlag( BOOL ) = 0;
00163 virtual void SetFlatness( DWORD ) = 0;
00164
00165 virtual BOOL SetMiterLimit( DWORD ) = 0;
00166 virtual BOOL SetMatrixIntFlag( BOOL ) = 0;
00167 virtual BOOL SetDashAdjustmentFlag( BOOL ) = 0;
00168
00169 virtual void TransformPath( LPPOINT, LPPOINT, DWORD, GMATRIX* ) = 0;
00170
00171 virtual INT32 MaxScale( CONST GMATRIX *Matrix, CONST RECT *BBox ) = 0;
00172
00173
00174 virtual void SetHalftoneOrigin( DWORD, DWORD ) = 0;
00175 virtual BOOL SetDitherStyle(DitherStyle Style = DITHER_GREY_ORDERED) = 0;
00176 virtual BOOL AddToGraduationTable( COLORREF, BOOL, GraduationTable*, DWORD ) = 0;
00177 virtual BOOL BuildGraduationTable( COLORREF, COLORREF, DWORD, GraduationTable* ) = 0;
00178 virtual BOOL BuildTransparencyTable( DWORD, DWORD, TransparentGradTable* ) = 0;
00179 virtual BOOL SetColour( COLORREF ) = 0;
00180 virtual BOOL SetSolidColour( COLORREF, DWORD BPP = 0, DWORD Format = 2 ) = 0;
00181 virtual BOOL SetWordColour( DWORD ) = 0;
00182 virtual BOOL SetTransparency( COLORREF, TransparencyEnum ) = 0;
00183 virtual BOOL ConvertBitmap( LPBITMAPINFOHEADER, LPBYTE, LPBITMAPINFOHEADER, LPBYTE, INT32 ) = 0;
00184 virtual const LOGPALETTE* SelectPalette( INT32 ) = 0;
00185
00186 virtual BOOL SetInvert( DWORD ) = 0;
00187 virtual BOOL InitialiseWithPalette( const LOGPALETTE* ) = 0;
00188 virtual CONST BYTE* ReturnBrush() = 0;
00189 virtual CONST BYTE* ReturnBrushRGB() = 0;
00190
00191 virtual BOOL SetSeparationTables(const BGR *CyanSepTable = NULL,
00192 const BGR *MagentaSepTable = NULL,
00193 const BGR *YellowSepTable = NULL,
00194 const BGR *BlackSepTable = NULL,
00195 const BYTE *UnderColourRemovalTable = NULL,
00196 const BYTE *BlackGenerationTable = NULL) = 0;
00197
00198 virtual BOOL SetBitmapConversionTable( const BGR* BitmapConversionTable = NULL ) = 0;
00199
00200 virtual BOOL SetGraduation(
00201 DWORD Style,
00202 CONST GraduationTable *Table,
00203 CONST POINT *PointA,
00204 CONST POINT *PointB,
00205 CONST POINT *PointC
00206 ) = 0;
00207 virtual BOOL SetTransparentGraduation(
00208 DWORD Style,
00209 CONST TranspGradTable *Table,
00210 CONST POINT *PointA,
00211 CONST POINT *PointB,
00212 CONST POINT *PointC
00213 ) = 0;
00214
00215 virtual BOOL SetGraduation4(
00216 DWORD Style,
00217 CONST GraduationTable *Table,
00218 CONST POINT *PointA,
00219 CONST POINT *PointB,
00220 CONST POINT *PointC,
00221 CONST POINT *PointD
00222 ) = 0;
00223 virtual BOOL SetTransparentGraduation4(
00224 DWORD Style,
00225 CONST TranspGradTable *Table,
00226 CONST POINT *PointA,
00227 CONST POINT *PointB,
00228 CONST POINT *PointC,
00229 CONST POINT *PointD
00230 ) = 0;
00231
00232 virtual BOOL SetBias(UINT32,double) = 0;
00233 virtual BOOL SetGain(UINT32,double) = 0;
00234 virtual BOOL SetBrightness(double) = 0;
00235 virtual BOOL SetContrast(double) = 0;
00236 virtual BOOL SetGamma(double) = 0;
00237 virtual BOOL SetPostGamma(double) = 0;
00238 virtual BOOL SetSaturation(double) = 0;
00239 virtual BOOL SetContone( UINT32, COLORREF=0x000000, COLORREF=0xFFFFFF ) = 0;
00240 virtual BOOL SetInputRange( UINT32,BYTE=0x00,BYTE=0xFF ) = 0;
00241 virtual BOOL SetOutputRange( UINT32,BYTE=0x00,BYTE=0xFF ) = 0;
00242
00243 virtual BOOL SetBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, LPRGBQUAD,
00244 LPBYTE, LPBYTE, LPBYTE, LPBYTE, DWORD = 0) = 0;
00245
00246 virtual BOOL SetTransparentBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, BYTE* = NULL, DWORD = 0) = 0;
00247
00248 virtual BOOL SetPerspectiveBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, LPRGBQUAD,
00249 LPBYTE, LPBYTE, LPBYTE, LPBYTE, DWORD ) = 0;
00250
00251 virtual BOOL SetPerspectiveTransparentBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, BYTE*, DWORD) = 0;
00252
00253 virtual BOOL SetTransparencyLookupTable(CONST BYTE * Table)=0;
00254
00255
00256 virtual BOOL PlotBitmap( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, LPRGBQUAD,
00257 LPBYTE, LPBYTE, LPBYTE, LPBYTE) = 0;
00258
00259 virtual BOOL PlotPerspectiveBitmap( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, LPRGBQUAD,
00260 LPBYTE, LPBYTE, LPBYTE, LPBYTE) = 0;
00261
00262 virtual BOOL StrokePath( LPPOINT, const BYTE *, UINT32, BOOL, DWORD, CapStyles, JoinStyles, const DashType* ) = 0;
00263 virtual BOOL FillPath( LPPOINT, const BYTE *, UINT32, DWORD ) = 0;
00264 virtual BOOL FillRectangle( LPRECT ) = 0;
00265 virtual BOOL FillPoint( LPPOINT ) = 0;
00266 virtual INT32 StrokePathToPath(
00267 CONST POINT *IPoints,
00268 CONST BYTE *ITypes,
00269 DWORD ILength,
00270 POINT *OPoints,
00271 BYTE *OTypes,
00272 DWORD OLength,
00273 BOOL Close,
00274 DWORD LineWidth,
00275 CapStyles LineCaps,
00276 JoinStyles LineJoin,
00277 CONST DashType *Dash) = 0;
00278
00279 virtual INT32 CalcStrokeBBox(
00280 CONST POINT *IPoints,
00281 CONST BYTE *ITypes,
00282 DWORD ILength,
00283 LPRECT Rect,
00284 BOOL Close,
00285 DWORD LineWidth,
00286 CapStyles LineCaps,
00287 JoinStyles LineJoin,
00288 CONST DashType *Dash) = 0;
00289
00290 virtual BOOL HintPath(
00291 CONST POINT *Points,
00292 CONST BYTE *Types,
00293 UINT32 Length,
00294 BOOL Close,
00295 DWORD LineWidth) = 0;
00296
00297 virtual INT32 MakeUnclippedRegion(
00298 CONST POINT *Points,
00299 CONST BYTE *Types,
00300 UINT32 Length,
00301 DWORD Winding,
00302 REGION *ORegion,
00303 UINT32 OLength) = 0;
00304
00305 virtual BOOL FillRegion( CONST REGION *Region, CONST POINT *Offset ) = 0;
00306
00307 virtual INT32 SetBevelContrast(UINT32 nContrast) = 0;
00308 virtual INT32 SetBevelLightness(UINT32 nContrast) = 0;
00309 virtual INT32 SetBevelDarkness(UINT32 nContrast) = 0;
00310 virtual INT32 TranslateBevelValue(BYTE nIndex, BYTE Colour) = 0;
00311
00312
00313 virtual BOOL IsOverlap( LPPOINT, const BYTE *, UINT32, DWORD) = 0;
00314 virtual BOOL GetStatistics( LPPOINT, const BYTE *, UINT32, DWORD, STATISTICS *) = 0;
00315 virtual BOOL CalcBBox( LPPOINT, const BYTE *, DWORD, LPRECT, BOOL) = 0;
00316
00317 virtual INT32 MakeRegion( LPPOINT, const BYTE *, UINT32, DWORD, REGION *, UINT32) = 0;
00318
00319 virtual BOOL ClipRectangle( LPRECT ) = 0;
00320 virtual BOOL DeviceClipRectangle( LPRECT ) = 0;
00321 virtual BOOL GetDeviceClipRectangle( LPRECT ) = 0;
00322 virtual BOOL ClipRegion( const REGION* ) = 0;
00323 virtual const REGION* GetClipRegion() = 0;
00324
00325 virtual void ClearChangedBBox() = 0;
00326 virtual BOOL GetChangedBBox( LPRECT ) = 0;
00327 virtual BOOL SetChangedBBox( LPRECT ) = 0;
00328
00329 virtual BOOL SetConversionPalette( PLOGPALETTE ) = 0;
00330
00331 virtual COLORREF ConvertHSVtoRGB(COLORREF) = 0;
00332 virtual COLORREF ConvertRGBtoHSV(COLORREF) = 0;
00333
00334 virtual DWORD GetMaxBitmapWidth(void) = 0;
00335 virtual DWORD GetMaxBitmapDepth(void) = 0;
00336
00337
00338 virtual BOOL Set3WayGraduation(DWORD Style,
00339 COLORREF ColourA, COLORREF ColourB, COLORREF ColourD,
00340 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD) = 0;
00341
00342 virtual BOOL Set3WayGraduation4(DWORD Style,
00343 COLORREF ColourA, COLORREF ColourB, COLORREF ColourD,
00344 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD) = 0;
00345
00346 virtual BOOL Set4WayGraduation(DWORD Style,
00347 COLORREF ColourA, COLORREF ColourB, COLORREF ColourC, COLORREF ColourD,
00348 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD) = 0;
00349
00350 virtual BOOL Set4WayGraduation4(DWORD Style,
00351 COLORREF ColourA, COLORREF ColourB, COLORREF ColourC, COLORREF ColourD,
00352 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD) = 0;
00353
00354 virtual BOOL SetTransparent3WayGraduation(DWORD Style,
00355 BYTE ValueA, BYTE ValueB, BYTE ValueD,
00356 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD) = 0;
00357
00358 virtual BOOL SetTransparent3WayGraduation4(DWORD Style,
00359 BYTE ValueA, BYTE ValueB, BYTE ValueD,
00360 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD) = 0;
00361
00362 virtual BOOL SetTransparent4WayGraduation(DWORD Style,
00363 BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
00364 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD) = 0;
00365
00366 virtual BOOL SetTransparent4WayGraduation4(DWORD Style,
00367 BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
00368 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD) = 0;
00369
00370 virtual BOOL SaveContext(GCONTEXT* Context) = 0;
00371 virtual BOOL RestoreContext(CONST GCONTEXT* Context) = 0;
00372
00373 virtual BOOL SetDefaultBitmapParameters();
00374 };
00375
00376
00377 #endif