epoc32/include/graphicsaccelerator.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __GRAPHICSACCELERATOR_H__
williamr@2
    17
#define __GRAPHICSACCELERATOR_H__
williamr@2
    18
williamr@2
    19
#include <e32std.h>
williamr@2
    20
#include <gdi.h>
williamr@2
    21
williamr@2
    22
//
williamr@2
    23
// Bitmaps
williamr@2
    24
//
williamr@2
    25
williamr@2
    26
// Forward references
williamr@2
    27
class CFbsBitmap;
williamr@2
    28
class TAcceleratedBitmapSpec;
williamr@2
    29
williamr@2
    30
/**
williamr@2
    31
A data structure that holds the information needed to directly access a bitmap.
williamr@2
    32
williamr@2
    33
The bitmap can be a hardware bitmap (RHardwareBitmap), or an ordinary bitmap 
williamr@2
    34
(CFbsBitmap). An object of this class is filled by calling TAcceleratedBitmapSpec::GetInfo().
williamr@2
    35
williamr@2
    36
@see RHardwareBitmap
williamr@2
    37
@see CFbsBitmap
williamr@2
    38
@see TAcceleratedBitmapSpec::GetInfo() 
williamr@2
    39
@publishedAll
williamr@2
    40
@released
williamr@2
    41
*/
williamr@2
    42
class TAcceleratedBitmapInfo
williamr@2
    43
	{
williamr@2
    44
public:
williamr@2
    45
williamr@2
    46
    /** The bitmap's display mode. */
williamr@2
    47
	TDisplayMode	iDisplayMode;
williamr@2
    48
williamr@2
    49
	/** The address of the start of the bitmap. */
williamr@2
    50
	TUint8*			iAddress;
williamr@2
    51
	
williamr@2
    52
	/** The width and height of the bitmap in pixels. */
williamr@2
    53
	TSize			iSize;
williamr@2
    54
	
williamr@2
    55
	/** The address offset (in bytes) between successive lines in a bitmap. */
williamr@2
    56
	TInt			iLinePitch;
williamr@2
    57
	
williamr@2
    58
	/** The shift required to obtain the number of bits needed to represent one pixel in the bitmap.
williamr@2
    59
	The number of bits per pixel is calculated as 1 << iPixelShift */
williamr@2
    60
	TInt			iPixelShift;
williamr@2
    61
	
williamr@2
    62
	/** The physical address of the start of the bitmap. This is the address which a 
williamr@2
    63
	hardware graphics accelerator will use and is zero if the bitmap is not accessible 
williamr@2
    64
	to hardware graphics accelerators. */
williamr@2
    65
	TUint8*			iPhysicalAddress;
williamr@2
    66
	};
williamr@2
    67
williamr@2
    68
/**
williamr@2
    69
The interface to a hardware bitmap.
williamr@2
    70
williamr@2
    71
This is a bitmap that can be drawn to by graphics acceleration hardware. It 
williamr@2
    72
is stored in a contiguous area of physical memory.
williamr@2
    73
williamr@2
    74
After creating the hardware bitmap, it can be passed to CHardwareGraphicsAccelerator::NewL().
williamr@2
    75
williamr@2
    76
@see CHardwareGraphicsAccelerator::NewL() 
williamr@2
    77
@publishedAll
williamr@2
    78
@released
williamr@2
    79
*/
williamr@2
    80
class RHardwareBitmap
williamr@2
    81
	{
williamr@2
    82
	friend class CBitwiseBitmap;
williamr@2
    83
	friend class CFbsScreenDevice;
williamr@2
    84
public:
williamr@2
    85
williamr@2
    86
    /** Default constructor. */
williamr@2
    87
	inline RHardwareBitmap();
williamr@2
    88
williamr@2
    89
    /** Constructor taking the handle of an existing RHardwareBitmap to duplicate it. */
williamr@2
    90
	inline RHardwareBitmap(TInt aHandle);
williamr@2
    91
	
williamr@2
    92
	/** 
williamr@2
    93
	Gets the information needed for accessing a bitmap directly into TAcceleratedBitmapInfo structure.
williamr@2
    94
williamr@2
    95
	@param aInfo On return, holds the information needed to directly access the	bitmap.
williamr@2
    96
	@return KErrNone if sucessful, otherwise one of the system error codes, including 
williamr@2
    97
	KErrUnknown if the object's type is ENoBitmap. 
williamr@2
    98
	*/
williamr@2
    99
	IMPORT_C TInt GetInfo(TAcceleratedBitmapInfo& aInfo) const;
williamr@2
   100
private:
williamr@2
   101
	IMPORT_C TInt SetAsScreenReference(TInt aScreen=-1);
williamr@2
   102
	IMPORT_C TInt Create(TDisplayMode aDisplayMode, TSize aSize, TUid aCreatorUid);
williamr@2
   103
	IMPORT_C void Destroy();
williamr@2
   104
public:
williamr@2
   105
	
williamr@2
   106
	/** The bitmap's handle; assigned during construction. This is used to identify 
williamr@2
   107
	the bitmap. */
williamr@2
   108
	TInt iHandle;	// Must be only member data
williamr@2
   109
	};
williamr@2
   110
williamr@2
   111
	/** Default constructor. Initialises the handle to zero. */
williamr@2
   112
inline RHardwareBitmap::RHardwareBitmap()
williamr@2
   113
	: iHandle(0)
williamr@2
   114
	{}
williamr@2
   115
williamr@2
   116
	/** Constructor taking the handle of an existing RHardwareBitmap to duplicate.
williamr@2
   117
	@param aHandle The RHardwareBitmap handle to duplicate. */
williamr@2
   118
inline RHardwareBitmap::RHardwareBitmap(TInt aHandle)
williamr@2
   119
	: iHandle(aHandle)
williamr@2
   120
	{}
williamr@2
   121
williamr@2
   122
/**
williamr@2
   123
Maintains a count of the number of locks made on a bitmap through a TAcceleratedBitmapSpec 
williamr@2
   124
object.
williamr@2
   125
williamr@2
   126
Passed as a parameter to TAcceleratedBitmapSpec::Lock() and TAcceleratedBitmapSpec::Unlock().
williamr@2
   127
williamr@2
   128
@see TAcceleratedBitmapSpec 
williamr@2
   129
@publishedAll
williamr@2
   130
@released
williamr@2
   131
*/
williamr@2
   132
class TBitmapLockCount
williamr@2
   133
	{
williamr@2
   134
	friend class TAcceleratedBitmapSpec;
williamr@2
   135
public:
williamr@2
   136
	
williamr@2
   137
	/** Default constructor. Initialises the lock count to zero. */
williamr@2
   138
	inline TBitmapLockCount() : iCount(0) {}
williamr@2
   139
private:
williamr@2
   140
	inline TInt Inc() { return iCount++; }
williamr@2
   141
	inline TInt Dec() { return --iCount; }
williamr@2
   142
private:
williamr@2
   143
	TInt iCount;
williamr@2
   144
	};
williamr@2
   145
williamr@2
   146
williamr@2
   147
/**
williamr@2
   148
A utility class that provides access to the contents of a bitmap.
williamr@2
   149
williamr@2
   150
The bitmap can be a hardware bitmap (RHardwareBitmap), or an ordinary bitmap 
williamr@2
   151
(CFbsBitmap). An object of this class is used as a parameter by several accelerated 
williamr@2
   152
graphics operations, e.g. TGopBitBlt, to specify the source bitmap for the 
williamr@2
   153
operation. 
williamr@2
   154
@publishedAll
williamr@2
   155
@released
williamr@2
   156
*/
williamr@2
   157
class TAcceleratedBitmapSpec
williamr@2
   158
	{
williamr@2
   159
public:
williamr@2
   160
	// Constructors
williamr@2
   161
	inline TAcceleratedBitmapSpec();
williamr@2
   162
	IMPORT_C TAcceleratedBitmapSpec(CFbsBitmap* aBitmap);
williamr@2
   163
	IMPORT_C TAcceleratedBitmapSpec(RHardwareBitmap aBitmap);
williamr@2
   164
	// Bitmap access (use with caution, see documentation)
williamr@2
   165
	
williamr@2
   166
	IMPORT_C TInt GetInfo(TAcceleratedBitmapInfo& aInfo) const;
williamr@2
   167
	inline void Lock(TBitmapLockCount& aCount);
williamr@2
   168
	inline void Lock(TBitmapLockCount& aCount,TAcceleratedBitmapInfo& aInfo);
williamr@2
   169
	inline void	Unlock(TBitmapLockCount& aCount);
williamr@2
   170
williamr@2
   171
	// enums
williamr@2
   172
	/** Identifies the type of the bitmap.
williamr@2
   173
williamr@2
   174
	Type() returns this value.
williamr@2
   175
williamr@2
   176
	@see CFbsBitmap */
williamr@2
   177
	enum TAcceleratedBitmapType
williamr@2
   178
		{
williamr@2
   179
	/** The object was created using the default constructor, and has no type. */
williamr@2
   180
		ENoBitmap,
williamr@2
   181
	
williamr@2
   182
	/** The bitmap is of type CFbsBitmap.
williamr@2
   183
	
williamr@2
   184
	@see CFbsBitmap */
williamr@2
   185
		EFbsBitmap,
williamr@2
   186
	
williamr@2
   187
	/** The bitmap is of type RHardwareBitmap.
williamr@2
   188
	
williamr@2
   189
	@see RHardwareBitmap */
williamr@2
   190
		EHardwareBitmap,
williamr@2
   191
		};
williamr@2
   192
	enum TAcceleratedBitmapLock
williamr@2
   193
		{
williamr@2
   194
		EBitmapIsStatic,
williamr@2
   195
		EBitmapNeedsLocking,
williamr@2
   196
		};
williamr@2
   197
	// Getters
williamr@2
   198
	inline TAcceleratedBitmapType	Type() const;
williamr@2
   199
	inline TInt						Handle() const;
williamr@2
   200
private:
williamr@2
   201
	IMPORT_C void DoLock(TBitmapLockCount& aCount);
williamr@2
   202
	IMPORT_C void DoLock(TBitmapLockCount& aCount,TAcceleratedBitmapInfo& aInfo);
williamr@2
   203
	IMPORT_C void DoUnlock(TBitmapLockCount& aCount);
williamr@2
   204
private:
williamr@2
   205
	TUint8	iType;			// TAcceleratedBitmapType
williamr@2
   206
	TUint8	iLockStatus;	// TAcceleratedBitmapLock
williamr@2
   207
	TUint8	iSpare1;
williamr@2
   208
	TUint8	iSpare2;
williamr@2
   209
	TInt	iHandle;
williamr@2
   210
	};
williamr@2
   211
williamr@2
   212
	/** Default constructor. 
williamr@2
   213
	Use one of the other constructor overloads instead. */
williamr@2
   214
inline TAcceleratedBitmapSpec::TAcceleratedBitmapSpec()
williamr@2
   215
	: iType(ENoBitmap), iLockStatus(EBitmapIsStatic)
williamr@2
   216
	{}
williamr@2
   217
williamr@2
   218
	/** Prevents a bitmap from moving in memory. Lock() should be called before accessing 
williamr@2
   219
	the bitmap and Unlock() immediately afterwards. Although it is not necessary 
williamr@2
   220
	to lock and unlock some types of bitmap, it is a small overhead, and it is 
williamr@2
   221
	recommended that you always do it.
williamr@2
   222
	
williamr@2
   223
	If a bitmap is already locked, all uses of the Lock() and Unlock() methods 
williamr@2
   224
	within the same thread must use the same TBitmapLockCount object, even if 
williamr@2
   225
	Lock() and Unlock() are called by different instances of TAcceleratedBitmapSpec.
williamr@2
   226
	
williamr@2
   227
	@param aCount Maintains a count of the number of locks made on the bitmap. */
williamr@2
   228
inline void TAcceleratedBitmapSpec::Lock(TBitmapLockCount& aCount)
williamr@2
   229
	{ if(iLockStatus==EBitmapNeedsLocking) DoLock(aCount); }
williamr@2
   230
williamr@2
   231
	/** Prevents a bitmap from moving in memory. Lock() should be called before accessing 
williamr@2
   232
	the bitmap and Unlock() immediately afterwards. Although it is not necessary 
williamr@2
   233
	to lock and unlock some types of bitmap, it is a small overhead, and it is 
williamr@2
   234
	recommended that you always do it. Also updates a TAcceleratedBitmapInfo structure 
williamr@2
   235
	with any information that may have changed, (typically the bitmap's memory 
williamr@2
   236
	address).
williamr@2
   237
	
williamr@2
   238
	If a bitmap is already locked, all uses of the Lock() and Unlock() methods 
williamr@2
   239
	within the same thread must use the same TBitmapLockCount object, even if 
williamr@2
   240
	Lock() and Unlock() are called by different instances of TAcceleratedBitmapSpec.
williamr@2
   241
	
williamr@2
   242
	@param aCount Maintains a count of the number of locks made on the bitmap.
williamr@2
   243
	@param aInfo On return, contains the new address of the start of the bitmap. */
williamr@2
   244
inline void TAcceleratedBitmapSpec::Lock(TBitmapLockCount& aCount,TAcceleratedBitmapInfo& aInfo)
williamr@2
   245
	{ if(iLockStatus==EBitmapNeedsLocking) DoLock(aCount,aInfo); }
williamr@2
   246
williamr@2
   247
	/** Frees a bitmap after a call to Lock().  A call to Unlock() must be made for each corresponding
williamr@2
   248
	call to Lock(). This function should be called as soon as any bitmap access has finished. If, after
williamr@2
   249
	the Unlock() operation, no more calls to Lock() are outstanding on the bitmap, the bitmap is free to
williamr@2
   250
	be moved in memory again.
williamr@2
   251
	
williamr@2
   252
	If a bitmap is already locked, all uses of the Lock() and Unlock() methods 
williamr@2
   253
	within the same thread must use the same TBitmapLockCount object, even if 
williamr@2
   254
	Lock() and Unlock() are called by different instances of TAcceleratedBitmapSpec.
williamr@2
   255
	
williamr@2
   256
	@param aCount Maintains a count of the number of locks made on the bitmap. */
williamr@2
   257
inline void	TAcceleratedBitmapSpec::Unlock(TBitmapLockCount& aCount)
williamr@2
   258
	{ if(iLockStatus==EBitmapNeedsLocking) DoUnlock(aCount); }
williamr@2
   259
williamr@2
   260
	/** Returns the type of the bitmap. The type is assigned during construction.
williamr@2
   261
	
williamr@2
   262
	@return The type of bitmap. */
williamr@2
   263
inline TAcceleratedBitmapSpec::TAcceleratedBitmapType TAcceleratedBitmapSpec::Type() const
williamr@2
   264
	{ return (TAcceleratedBitmapSpec::TAcceleratedBitmapType)iType; }
williamr@2
   265
williamr@2
   266
	/** Returns the handle to the bitmap.
williamr@2
   267
	
williamr@2
   268
	@return The handle to the bitmap. */
williamr@2
   269
inline TInt TAcceleratedBitmapSpec::Handle() const
williamr@2
   270
	{ return iHandle; }
williamr@2
   271
williamr@2
   272
//
williamr@2
   273
// Accelerator capabilities
williamr@2
   274
//
williamr@2
   275
williamr@2
   276
williamr@2
   277
/**
williamr@2
   278
Enumerates the four transparency types.
williamr@2
   279
williamr@2
   280
ETransparentPixel and ETransparentColor are used with a pixel value or a TRgb 
williamr@2
   281
respectively.
williamr@2
   282
williamr@2
   283
@see TGopTransparency
williamr@2
   284
@see TGraphicsAcceleratorCaps::iTransparency 
williamr@2
   285
@publishedAll
williamr@2
   286
@released
williamr@2
   287
*/
williamr@2
   288
enum TTransparencyType
williamr@2
   289
	{
williamr@2
   290
	
williamr@2
   291
	/** Any pixel that has all bits equal to zero is treated as transparent. */
williamr@2
   292
	ETransparentPixelZero,
williamr@2
   293
	
williamr@2
   294
	/** Any pixel that is equal to the pixel value passed to the TGopTransparency constructor 
williamr@2
   295
	is treated as transparent. */
williamr@2
   296
	ETransparentPixel,
williamr@2
   297
	
williamr@2
   298
	/** Any pixel that is equal to the TRgb value passed to the TGopTransparency constructor 
williamr@2
   299
	is treated as transparent. */
williamr@2
   300
	ETransparentColor,
williamr@2
   301
	
williamr@2
   302
	/** In 16 bits per pixel display mode, which uses 5 bits each for red, green and 
williamr@2
   303
	blue, the most significant bit is an Alpha value. Alpha=0 means the pixel 
williamr@2
   304
	is transparent, Alpha=1 means the pixel is fully opaque. */
williamr@2
   305
	ETransparent1555,
williamr@2
   306
	};
williamr@2
   307
williamr@2
   308
/** 
williamr@2
   309
Stores the capabilities of a graphics accelerator.
williamr@2
   310
williamr@2
   311
All of the member enums except TMaskBitmapCaps define flags that are stored 
williamr@2
   312
as public data of type TUint. Only TMaskBitmapCaps takes sequential values, 
williamr@2
   313
so its values are mutually exclusive.
williamr@2
   314
williamr@2
   315
An object of this class is returned by CGraphicsAccelerator::Capabilities() 
williamr@2
   316
or by GenericCapabilities(), which is implemented by CSoftwareGraphicsAccelerator 
williamr@2
   317
and CHardwareGraphicsAccelerator.
williamr@2
   318
williamr@2
   319
@see CGraphicsAccelerator::Capabilities() 
williamr@2
   320
@publishedAll
williamr@2
   321
@released
williamr@2
   322
*/
williamr@2
   323
class TGraphicsAcceleratorCaps
williamr@2
   324
	{
williamr@2
   325
public:
williamr@2
   326
    /** Clipping capabilities. Used by the iClipping member.
williamr@2
   327
williamr@2
   328
    @see CGraphicsAccelerator::Operation() */
williamr@2
   329
	enum TClipCaps	// Bit flags
williamr@2
   330
		{
williamr@2
   331
		EClipToBitmap = 1,	// Will always clip all operations to the bitmap
williamr@2
   332
	
williamr@2
   333
	    /** The accelerator supports the Operation() methods which take clipping rectangles 
williamr@2
   334
	    as parameters.
williamr@2
   335
	
williamr@2
   336
	    @see CGraphicsAccelerator::Operation() */
williamr@2
   337
		EClipping = 2		// Is able to clip operations to a region
williamr@2
   338
		};
williamr@2
   339
williamr@2
   340
/** Enumerates the capabilities relating to operations taking a bitmap mask parameter, 
williamr@2
   341
for instance TGopBitBltMasked. These are mutually exclusive values used by 
williamr@2
   342
the iMaskType member. */
williamr@2
   343
	enum TMaskBitmapCaps	// Enum
williamr@2
   344
		{
williamr@2
   345
	/** No masked operations are supported. */
williamr@2
   346
		EMaskBitmapNone = 0,
williamr@2
   347
	
williamr@2
   348
	/** The mask bitmap can be in any display mode at all. */
williamr@2
   349
		EMaskBitmapAnyDisplayMode,
williamr@2
   350
	
williamr@2
   351
	/** The mask bitmap must be in the same display mode as the destination bitmap. */
williamr@2
   352
		EMaskBitmapMatchingDisplayMode,
williamr@2
   353
	
williamr@2
   354
	/** The mask bitmap must be in EGray2 display mode. */
williamr@2
   355
		EMaskBitmapGray2,
williamr@2
   356
		};
williamr@2
   357
williamr@2
   358
/** Bit flags for the capabilities relating to operations that use an alpha channel 
williamr@2
   359
(TGopBitBltAlphaChannel and TGopScaledBitBltAlphaChannel). These flags are 
williamr@2
   360
used by the iAlphaChannel member. */
williamr@2
   361
	enum TAlphaChannelCaps	//Bit flags
williamr@2
   362
    	{
williamr@2
   363
	/** The accelerator can draw bitmaps with 4 bits each for the alpha value and the 
williamr@2
   364
	red, green and blue components. */
williamr@2
   365
		EAlpha4444 = 1,	// Bitmaps with 4 bits for Alpha value and Red, Green, Blue components
williamr@2
   366
	
williamr@2
   367
	/** The accelerator can draw bitmaps with 8 bits each for the alpha value and the 
williamr@2
   368
	red, green and blue components. */
williamr@2
   369
		EAlpha8888 = 2, // Bitmaps with 8 bits for Alpha value and Red, Green, Blue components
williamr@2
   370
	
williamr@2
   371
	/** The accelerator can draw bitmaps with 1 bit for the alpha value and and 5 bits 
williamr@2
   372
	for the red, green and blue components. */
williamr@2
   373
		EAlpha1555 = 4, // Bitmaps with 1 bit for Alpha value and 5 bits for Red, Green, and Blue
williamr@2
   374
		};
williamr@2
   375
williamr@2
   376
/** Bit flags for the capabilities relating to operations which take an alpha bitmap 
williamr@2
   377
parameter, for instance TGopBitBltAlphaBitmap. These flags are used by the 
williamr@2
   378
iAlphaBitmap member. */
williamr@2
   379
	enum TAlphaBitmapCaps	//Bit flags
williamr@2
   380
    	{
williamr@2
   381
	/** For 256 greyscale bitmaps, the value of each pixel in the alpha bitmap (from 
williamr@2
   382
	0 to 255) is used as the alpha value. */
williamr@2
   383
		EAlphaBitmapGray256 = 1,
williamr@2
   384
	
williamr@2
   385
	/** An EColor16M bitmap may be used as the alpha bitmap. The red, green and blue 
williamr@2
   386
	values for each pixel in this bitmap are used as the alpha values for the 
williamr@2
   387
	red, green and blue components of the corresponding pixel in the source bitmap. */
williamr@2
   388
		EAlphaBitmapColor16M = 2,
williamr@2
   389
	
williamr@2
   390
	/** The alpha bitmap must have the same display mode as the source bitmap. */
williamr@2
   391
		EAlphaBitmapMatchingMode = 4,	// Alpha bitmap must be same mode as source
williamr@2
   392
		};
williamr@2
   393
williamr@2
   394
/** Indicates whether there is a restriction on the sizes of bitmaps that can be 
williamr@2
   395
used in bitmap patterns.
williamr@2
   396
williamr@2
   397
This is one of the possible values for the iPatternSizes member.
williamr@2
   398
williamr@2
   399
@see TGopFillPattern */
williamr@2
   400
	enum TPatternSizeCaps	//Bit flags
williamr@2
   401
		{
williamr@2
   402
	/** There is no restriction on the dimensions of bitmap patterns. */
williamr@2
   403
		EPatternSizeAny = 0xFFFFFFFF,
williamr@2
   404
		};
williamr@2
   405
williamr@2
   406
/** Bit flags for the capabilities relating to operations that draw a fill pattern 
williamr@2
   407
using a bitmap, for instance TGopFilledRectWithPatern. They are used in the 
williamr@2
   408
iPattern member. */
williamr@2
   409
	enum TPatternCaps	//Bit flags
williamr@2
   410
		{
williamr@2
   411
	/** The pattern bitmap can be in any display mode. */
williamr@2
   412
		EPatternAnyDisplayMode = 1,			// Patterns can be in any supported display mode
williamr@2
   413
	
williamr@2
   414
	/** The pattern bitmap must be in the same display mode as the destination. */
williamr@2
   415
		EPatternMatchingDisplayMode = 2,	// Pattern must be in same displ mode as target
williamr@2
   416
	
williamr@2
   417
	/** The pattern bitmap must be square (width==height). */
williamr@2
   418
		EPatternMustBeSquare = 4,			// The pattern must be square (width==height)
williamr@2
   419
		};
williamr@2
   420
		
williamr@2
   421
/** Bit flags for how self-crossing polygons are filled.
williamr@2
   422
williamr@2
   423
@see CGraphicsContext::TFillRule */
williamr@2
   424
	enum TPolygonCaps	// Bit flags for fill rules (see CGraphicsContext::TFillRule)
williamr@2
   425
		{
williamr@2
   426
	/** Only areas with odd winding numbers are filled. */
williamr@2
   427
		EPolygonFillAlternate = 1,
williamr@2
   428
	
williamr@2
   429
	/** All areas with a winding number greater than zero are filled.
williamr@2
   430
	
williamr@2
   431
	@see CGraphicsContext::TFillRule */
williamr@2
   432
		EPolygonFillWinding = 2,
williamr@2
   433
		};
williamr@2
   434
		
williamr@2
   435
/** Bit flags for the specifying the supported rendering orientations. 
williamr@2
   436
@see  CFbsBitGc::TGraphicsOrientation */
williamr@2
   437
	enum TOrientationCaps
williamr@2
   438
		{
williamr@2
   439
		/** Normal orientation is supported. */
williamr@2
   440
		EOrientationCapNormal = 1,
williamr@2
   441
		/** A 90 degree rotation is supported. */
williamr@2
   442
		EOrientationCapRotated90 = 2,
williamr@2
   443
		/** A 180 degree rotation is supported. */
williamr@2
   444
		EOrientationCapRotated180 = 4,
williamr@2
   445
		/** A 270 degree rotation is supported. */
williamr@2
   446
		EOrientationCapRotated270 = 8,
williamr@2
   447
		/** All orientations are supported. */ 
williamr@2
   448
		EOrientationCapAll = EOrientationCapNormal|EOrientationCapRotated90|EOrientationCapRotated180|EOrientationCapRotated270,
williamr@2
   449
		};
williamr@2
   450
williamr@2
   451
	/** The size of this class in bytes. */
williamr@2
   452
	TInt			iStructureSize;	// The size of this class
williamr@2
   453
	
williamr@2
   454
	/** The version number of the API. */
williamr@2
   455
	TInt			iVersion;		// == 1 to specify current API
williamr@2
   456
	
williamr@2
   457
	/** Optional UID to identify the vendor of the graphics accelerator. This UID can 
williamr@2
   458
	be used to recognise a particular accelerator, enabling code to use any custom 
williamr@2
   459
	graphics operations and capabilities that it knows the accelerator provides. */
williamr@2
   460
	TUid			iVendorUid;		// Optional ID
williamr@2
   461
	
williamr@2
   462
	/** A bit mask of the supported display modes for the bitmap passed to the graphics 
williamr@2
   463
	accelerator's NewL(). Uses the least significant 11 bits as flags for each 
williamr@2
   464
	TDisplayMode supported. For instance, to check whether the EColor256 display 
williamr@2
   465
	mode is available, use the expression iDisplayModes & (1 << EColor256).
williamr@2
   466
	
williamr@2
   467
	@see TDisplayMode */
williamr@2
   468
	TUint			iDisplayModes;	// One bit for each TDisplayMode enumeration
williamr@2
   469
	
williamr@2
   470
	/** Indicates whether the Operation() methods which take clipping rectangles as 
williamr@2
   471
	parameters are supported.
williamr@2
   472
	
williamr@2
   473
	@see TClipCaps */
williamr@2
   474
	TUint			iClipping;		// TClipCaps bit flags
williamr@2
   475
	
williamr@2
   476
	/** Specifies the display mode restrictions for bitmap masks. These are mutually 
williamr@2
   477
	exclusive values.
williamr@2
   478
	
williamr@2
   479
	@see TMaskBitmapCaps */
williamr@2
   480
	TMaskBitmapCaps	iMaskType;		// Mask type used
williamr@2
   481
	
williamr@2
   482
	/** Specifies the transparency types supported. Uses a bit flag for each TTransparencyType 
williamr@2
   483
	supported.
williamr@2
   484
	
williamr@2
   485
	@see TTransparencyType */
williamr@2
   486
	TUint			iTransparency;	// Bit flag for each TTransparencyType supported
williamr@2
   487
	
williamr@2
   488
	/** Specifies the capabilities relating to operations that use an alpha channel. Uses a bit flag for
williamr@2
   489
	each TAlphaChannelCaps supported.
williamr@2
   490
	
williamr@2
   491
	@see TAlphaChannelCaps */
williamr@2
   492
	TUint			iAlphaChannel;	// TAlphaChannelCaps bit flags
williamr@2
   493
	
williamr@2
   494
	/** Specifies the supported alpha bitmap types. Uses a bit flag for each TAlphaBitmapCaps 
williamr@2
   495
	supported.
williamr@2
   496
	
williamr@2
   497
	@see TAlphaBitmapCaps */
williamr@2
   498
	TUint			iAlphaBitmap;	// TAlphaBitmapCaps bit flags
williamr@2
   499
	
williamr@2
   500
	/** Specifies the sizes of bitmaps that can be used in bitmap patterns.
williamr@2
   501
	
williamr@2
   502
	This is a bitmask for each power of 2, or EPatternSizeAny. For example, if 
williamr@2
   503
	bitmaps used in patterns can only have a width or height of 16 pixels then 
williamr@2
   504
	this value should be set to 16. If patterns can have dimensions of 16, 32, 
williamr@2
   505
	64, 128 or 256, then this value would equal the sum of these, (i.e. bits 4, 
williamr@2
   506
	5, 6, 7 and 8 would be set).  If this value is equal to EPatternSizeAny, there
williamr@2
   507
	are no restrictions on the size of patterns that can be used.
williamr@2
   508
	
williamr@2
   509
	@see TPatternSizeCaps */
williamr@2
   510
	TUint			iPatternSizes;	// a mask bit for each power of 2, or EPatternSizeAny
williamr@2
   511
	
williamr@2
   512
	/** Specifies the supported bitmap types for fill patterns. Uses a bit flag for 
williamr@2
   513
	each TPatternCaps supported.
williamr@2
   514
	
williamr@2
   515
	@see TPatternCaps */
williamr@2
   516
	TUint			iPattern;		// TPatternCaps bit flags
williamr@2
   517
	
williamr@2
   518
	/** Specifies the supported fill rules for self crossing polygons. Uses a bit flag 
williamr@2
   519
	for each TPolygonCaps supported.
williamr@2
   520
	
williamr@2
   521
	@see TPolygonCaps */
williamr@2
   522
	TUint			iPolygon;		// TPolygonCaps bit flags
williamr@2
   523
	
williamr@2
   524
	/** 
williamr@2
   525
	iReserved[0] specifies the supported rendering orientations.Uses a bit flags
williamr@2
   526
	for each TOrientationCaps supported.	
williamr@2
   527
	@see TOrientationCaps 
williamr@2
   528
	iReserved[1]-iReserved[3] are reserved for future use. All should be set to zero.
williamr@2
   529
	*/
williamr@2
   530
	TUint			iReserved[4];
williamr@2
   531
	};
williamr@2
   532
williamr@2
   533
williamr@2
   534
//
williamr@2
   535
// TGraphicsOperation
williamr@2
   536
//
williamr@2
   537
williamr@2
   538
/**
williamr@2
   539
Abstract base class for all graphics operations.
williamr@2
   540
williamr@2
   541
Derived classes encapsulate all the arguments needed by a given graphics operation. 
williamr@2
   542
An object of one of the derived classes is passed as a parameter to CGraphicsAccelerator::Operation(). 
williamr@2
   543
The member functions and enum defined in this class are not used directly 
williamr@2
   544
in third party code.
williamr@2
   545
williamr@2
   546
@see CGraphicsAccelerator::Operation() 
williamr@2
   547
@publishedAll
williamr@2
   548
@released
williamr@2
   549
*/
williamr@2
   550
class TGraphicsOperation
williamr@2
   551
	{
williamr@2
   552
public:
williamr@2
   553
	enum TGopFunction
williamr@2
   554
		{								// Require arguments commented below here
williamr@2
   555
williamr@2
   556
		EFilledRect,					// (TRect,TRgb)
williamr@2
   557
		EFilledRectUsingDrawMode,		// (TRect,TRgb,CGraphicsContext:TDrawMode)
williamr@2
   558
		EFilledRectWithPattern,			// (TRect,TGopFillPattern)
williamr@2
   559
		EInvertRect,					// (TRect)
williamr@2
   560
		EFadeRect,						// (TRect,TGopFadeParams)
williamr@2
   561
williamr@2
   562
		EBitBlt,						// (TPoint,TAcceleratedBitmapSpec,TRect&)
williamr@2
   563
		EBitBltMasked,					// (TPoint,TAcceleratedBitmapSpec,TRect&,TAcceleratedBitmapSpec aMask)
williamr@2
   564
		EBitBltTransparent,				// (TPoint,TAcceleratedBitmapSpec,TRect&,TGopTransparency)
williamr@2
   565
		EBitBltAlphaChannel,			// (TPoint,TAcceleratedBitmapSpec,TRect&)
williamr@2
   566
		EBitBltAlphaBitmap,				// (TPoint,TAcceleratedBitmapSpec,TRect&,TAcceleratedBitmapSpec aAlpha)
williamr@2
   567
williamr@2
   568
		EScaledBitBlt,					// (TRect,TAcceleratedBitmapSpec,TRect&)
williamr@2
   569
		EScaledBitBltMasked,			// (TRect,TAcceleratedBitmapSpec,TRect&,TAcceleratedBitmapSpec aMask)
williamr@2
   570
		EScaledBitBltTransparent,		// (TRect,TAcceleratedBitmapSpec,TRect&,TGopTransparency)
williamr@2
   571
		EScaledBitBltAlphaChannel,		// (TRect,TAcceleratedBitmapSpec,TRect&)
williamr@2
   572
		EScaledBitBltAlphaBitmap,		// (TRect,TAcceleratedBitmapSpec,TRect&,TAcceleratedBitmapSpec aAlpha)
williamr@2
   573
williamr@2
   574
		EFilledPolygon,					// (TRGb aColor,CGraphicsContext::TFillRule aFillRule,TInt aNumPoints,TPoint[])
williamr@2
   575
		EFilledPolygonWithPattern,		// (TGopFillPattern,CGraphicsContext::TFillRule aFillRule,TInt aNumPoints,TPoint[])
williamr@2
   576
		EAlphaBlendTwoBitmaps,			// (TPoint,TAcceleratedBitmapSpec aSrce1,TAcceleratedBitmapSpec aSrce2,TRect&,TAcceleratedBitmapSpec aAlpha)
williamr@2
   577
		EAlphaBlendOneBitmap,			// (TPoint,TAcceleratedBitmapSpec aSrce,TRect&,TAcceleratedBitmapSpec aAlpha)
williamr@2
   578
		EChunkTest,
williamr@2
   579
		EVirtualAddressTest,
williamr@2
   580
		};
williamr@2
   581
public:
williamr@2
   582
	// Getters
williamr@2
   583
	inline TGopFunction Function() const	{ return iFunction; }
williamr@2
   584
	inline TInt Size() const				{ return iSize; }
williamr@2
   585
	// Utility functions 
williamr@2
   586
	inline TGraphicsOperation* Next() const;
williamr@2
   587
	inline void Append(TInt aNumBytes,TAny* aData);
williamr@2
   588
protected:
williamr@2
   589
	inline TGraphicsOperation(TGopFunction aFunction, TInt aArgSize);
williamr@2
   590
	inline TGraphicsOperation() {}
williamr@2
   591
protected:
williamr@2
   592
	TGopFunction iFunction;
williamr@2
   593
	TInt iSize;  // Total size of derived class
williamr@2
   594
	};
williamr@2
   595
williamr@2
   596
inline TGraphicsOperation::TGraphicsOperation(TGopFunction aFunction, TInt aSize)
williamr@2
   597
	: iFunction(aFunction) , iSize(aSize) {}
williamr@2
   598
williamr@2
   599
inline TGraphicsOperation* TGraphicsOperation::Next() const
williamr@2
   600
	{ return (TGraphicsOperation*)((TUint8*)this+iSize); }
williamr@2
   601
williamr@2
   602
inline void TGraphicsOperation::Append(TInt aNumBytes,TAny* aData)
williamr@2
   603
	{
williamr@2
   604
	Mem::Copy(Next(),aData,aNumBytes);
williamr@2
   605
	iSize += aNumBytes;
williamr@2
   606
	}
williamr@2
   607
williamr@2
   608
williamr@2
   609
//
williamr@2
   610
// Graphics accelerator
williamr@2
   611
//
williamr@2
   612
williamr@2
   613
/**
williamr@2
   614
Abstract base class for 2D graphics accelerators.
williamr@2
   615
williamr@2
   616
This class can be derived from to provide accelerated implementations of some 
williamr@2
   617
common 2D graphics algorithms. Support for accelerated 2D graphics has been 
williamr@2
   618
integrated into existing classes in the Graphics API for instance CFbsBitGc, 
williamr@2
   619
so that existing code does not need to be altered, but a graphics accelerator 
williamr@2
   620
can be used directly by applications. The accelerated 2D graphics operations 
williamr@2
   621
may be implemented in software, hardware, or both. 
williamr@2
   622
@publishedAll
williamr@2
   623
@released
williamr@2
   624
*/
williamr@2
   625
class CGraphicsAccelerator : public CBase
williamr@2
   626
	{
williamr@2
   627
public:
williamr@2
   628
	// Return the capabilities of this accelerator
williamr@2
   629
	
williamr@2
   630
	/** Returns the capabilities of the graphics accelerator.
williamr@2
   631
	
williamr@2
   632
	@return The capabilities of the accelerator. */
williamr@2
   633
	virtual const TGraphicsAcceleratorCaps* Capabilities() = 0;
williamr@2
   634
williamr@2
   635
	// Perform a graphics operation
williamr@2
   636
	
williamr@2
   637
	/** Requests the graphics accelerator to perform a single graphics operation.
williamr@2
   638
	
williamr@2
   639
	@param aOperation An instance of a TGraphicsOperation-derived class that identifies 
williamr@2
   640
	the graphics operation to be performed.
williamr@2
   641
	@return KErrNone if successful, otherwise one of the system error codes. The 
williamr@2
   642
	function should return KErrNotSupported if the accelerator does not support 
williamr@2
   643
	the requested operation. */
williamr@2
   644
	virtual TInt Operation(const TGraphicsOperation& aOperation) = 0;
williamr@2
   645
	
williamr@2
   646
	/** Requests the graphics accelerator perform a single graphics operation within 
williamr@2
   647
	a clipping region.  This version is of Operation() is only usable if the 
williamr@2
   648
	accelerator capabilities returned by Capabilities() indicate that clipping to a region
williamr@2
   649
	is supported.
williamr@2
   650
	
williamr@2
   651
	@param aOperation An instance of a TGraphicsOperation-derived class that identifies 
williamr@2
   652
	the graphics operation to be performed.
williamr@2
   653
	@param aNumClipRects The number of rectangles in the clipping region.
williamr@2
   654
	@param aClipRects A pointer to the first rectangle in the clipping region.
williamr@2
   655
	@return KErrNone if successful, otherwise one of the system error codes. The 
williamr@2
   656
	function should return KErrNotSupported if the accelerator does not support 
williamr@2
   657
	the requested operation.
williamr@2
   658
	@see TGraphicsAcceleratorCaps::iClipping */
williamr@2
   659
	virtual TInt Operation(const TGraphicsOperation& aOperation,TInt aNumClipRects,TRect* aClipRects) = 0;
williamr@2
   660
	
williamr@2
   661
	// Process a buffer of TGraphicsOperation. (Each operation immediately follows the
williamr@2
   662
	// one preceding it in the buffer)
williamr@2
   663
	
williamr@2
   664
	/** Requests the graphics accelerator perform one or more graphics operations contained 
williamr@2
   665
	in a buffer.
williamr@2
   666
	
williamr@2
   667
	The underlying implementation may be able to process a group of graphics operations 
williamr@2
   668
	more efficiently than if Operation() was called for each individually.
williamr@2
   669
	
williamr@2
   670
	This function should be implemented as if Operation() was called in turn for 
williamr@2
   671
	each operation contained in the buffer. Each operation should be carried out 
williamr@2
   672
	immediately after the one preceding it. If a method returns an error, the 
williamr@2
   673
	length of aBuffer should be set to indicate the number of operations that 
williamr@2
   674
	have been successfully processed. In this case, the operation in which the 
williamr@2
   675
	error occurred will be indicated by the memory address &aBuffer[aBuffer.Length()].
williamr@2
   676
	
williamr@2
   677
	@param aBuffer A descriptor which holds a concatenation of graphics operations 
williamr@2
   678
	(TGraphicsOperation-derived objects).
williamr@2
   679
	@return KErrNone if successful, otherwise one of the system error codes. The 
williamr@2
   680
	function should return KErrNotSupported if the accelerator does not support 
williamr@2
   681
	any of the requested operations. */
williamr@2
   682
	virtual TInt Operation(TDes8& aBuffer) = 0;
williamr@2
   683
	
williamr@2
   684
	/** Requests the graphics accelerator perform one or more graphics operations within 
williamr@2
   685
	a clipping region.  This version is of Operation() is only usable if the 
williamr@2
   686
	accelerator capabilities returned by Capabilities() indicate that clipping to a region
williamr@2
   687
	is supported.
williamr@2
   688
	
williamr@2
   689
	The underlying implementation may be able to process a group of graphics operations 
williamr@2
   690
	more efficiently than if Operation() was called for each individually.
williamr@2
   691
	
williamr@2
   692
	This function should be implemented as if Operation() was called in turn for 
williamr@2
   693
	each operation contained in the buffer. Each operation should be carried out 
williamr@2
   694
	immediately after the one preceding it. If a method returns an error, the 
williamr@2
   695
	length of aBuffer should be set to indicate the number of operations that 
williamr@2
   696
	have been successfully processed. In this case, the operation in which the 
williamr@2
   697
	error occurred will be indicated by the memory address &aBuffer[aBuffer.Length()].
williamr@2
   698
	
williamr@2
   699
	@param aBuffer A descriptor which holds a concatenation of graphics operations 
williamr@2
   700
	(TGraphicsOperation objects).
williamr@2
   701
	@param aNumClipRects The number of rectangles in the clipping region.
williamr@2
   702
	@param aClipRects A pointer to the first rectangle in the clipping region.
williamr@2
   703
	@return KErrNone if successful, otherwise one of the system error codes. The 
williamr@2
   704
	function should return KErrNotSupported if the accelerator does not support 
williamr@2
   705
	any of the requested operations.
williamr@2
   706
	@see TGraphicsAcceleratorCaps::iClipping */
williamr@2
   707
	virtual TInt Operation(TDes8& aBuffer,TInt aNumClipRects,TRect* aClipRects) = 0;
williamr@2
   708
public:
williamr@2
   709
	// Reserved virtual functions for future use
williamr@2
   710
	virtual void Reserved_1() = 0;
williamr@2
   711
	virtual void Reserved_2() = 0;
williamr@2
   712
	virtual void Reserved_3() = 0;
williamr@2
   713
	virtual void Reserved_4() = 0;
williamr@2
   714
	};
williamr@2
   715
williamr@2
   716
williamr@2
   717
williamr@2
   718
/**
williamr@2
   719
A factory for creating 2D graphics accelerator objects whose graphics operations 
williamr@2
   720
are implemented in software.
williamr@2
   721
williamr@2
   722
Objects of derived classes can write to all types of bitmap, not just hardware 
williamr@2
   723
bitmaps. Note that graphics accelerators may support only a subset of all 
williamr@2
   724
graphics operations. 
williamr@2
   725
@publishedAll
williamr@2
   726
@released
williamr@2
   727
*/
williamr@2
   728
class CSoftwareGraphicsAccelerator : public CGraphicsAccelerator
williamr@2
   729
	{
williamr@2
   730
public:
williamr@2
   731
	// Create a new CSoftwareGraphicsAccelerator for use with a given bitmap
williamr@2
   732
	IMPORT_C static CSoftwareGraphicsAccelerator* NewL(CFbsBitmap* aBitmap);
williamr@2
   733
williamr@2
   734
	// Get the non-bitmap-specific capabilities of the hardware accelerator.
williamr@2
   735
	IMPORT_C static const TGraphicsAcceleratorCaps* GenericCapabilities();
williamr@2
   736
public:
williamr@2
   737
	// From CGraphicsAccelerator
williamr@2
   738
	virtual const TGraphicsAcceleratorCaps* Capabilities() = 0;
williamr@2
   739
	virtual TInt Operation(const TGraphicsOperation& aOperation) = 0;
williamr@2
   740
	virtual TInt Operation(const TGraphicsOperation& aOperation,TInt aNumClipRects,TRect* aClipRects) = 0;
williamr@2
   741
	virtual TInt Operation(TDes8& aBuffer) = 0;
williamr@2
   742
	virtual TInt Operation(TDes8& aBuffer,TInt aNumClipRects,TRect* aClipRects) = 0;
williamr@2
   743
	// From CGraphicsAccelerator
williamr@2
   744
	virtual void Reserved_1() = 0;
williamr@2
   745
	virtual void Reserved_2() = 0;
williamr@2
   746
	virtual void Reserved_3() = 0;
williamr@2
   747
	virtual void Reserved_4() = 0;
williamr@2
   748
	};
williamr@2
   749
williamr@2
   750
williamr@2
   751
/**
williamr@2
   752
A factory for creating 2D graphics accelerator objects whose graphics operations 
williamr@2
   753
are implemented in hardware, software or a mixture of both.
williamr@2
   754
williamr@2
   755
Objects of derived classes can only write to hardware bitmaps (RHardwareBitmap). 
williamr@2
   756
Note that graphics accelerators may support only a subset of all graphics 
williamr@2
   757
operations.
williamr@2
   758
williamr@2
   759
@see RHardwareBitmap 
williamr@2
   760
@publishedAll
williamr@2
   761
@released
williamr@2
   762
*/
williamr@2
   763
class CHardwareGraphicsAccelerator : public CGraphicsAccelerator
williamr@2
   764
	{
williamr@2
   765
public:
williamr@2
   766
	/**
williamr@2
   767
	Create a new CHardwareGraphicsAccelerator for use with a given hardware bitmap.
williamr@2
   768
	
williamr@2
   769
	Do not use, link against scdv.lib.
williamr@2
   770
	
williamr@2
   771
	@param aBitmap A bitmap that can be drawn by graphics acceleration hardware. 
williamr@2
   772
	               It can be any bitmap.
williamr@2
   773
	@return Reference to hardware graphics accelerator object.
williamr@2
   774
	*/
williamr@2
   775
	IMPORT_C static CHardwareGraphicsAccelerator* NewL(RHardwareBitmap aBitmap);
williamr@2
   776
	
williamr@2
   777
	/**
williamr@2
   778
	Gets the generic capabilities of the accelerator, including the supported display modes 
williamr@2
   779
	for the bitmap passed to NewL().
williamr@2
   780
	
williamr@2
   781
	Do not use, link against scdv.lib.
williamr@2
   782
	
williamr@2
   783
	@return Generic capabilities for software graphics accelerators.	
williamr@2
   784
	*/
williamr@2
   785
	IMPORT_C static const TGraphicsAcceleratorCaps* GenericCapabilities();
williamr@2
   786
public:
williamr@2
   787
	// From CGraphicsAccelerator
williamr@2
   788
	virtual const TGraphicsAcceleratorCaps* Capabilities() = 0;
williamr@2
   789
	virtual TInt Operation(const TGraphicsOperation& aOperation) = 0;
williamr@2
   790
	virtual TInt Operation(const TGraphicsOperation& aOperation,TInt aNumClipRects,TRect* aClipRects) = 0;
williamr@2
   791
	virtual TInt Operation(TDes8& aBuffer) = 0;
williamr@2
   792
	virtual TInt Operation(TDes8& aBuffer,TInt aNumClipRects,TRect* aClipRects) = 0;
williamr@2
   793
	// From CGraphicsAccelerator
williamr@2
   794
	virtual void Reserved_1() = 0;
williamr@2
   795
	virtual void Reserved_2() = 0;
williamr@2
   796
	virtual void Reserved_3() = 0;
williamr@2
   797
	virtual void Reserved_4() = 0;
williamr@2
   798
	};
williamr@2
   799
williamr@2
   800
//
williamr@2
   801
// Classes used as arguments to graphics operations
williamr@2
   802
//
williamr@2
   803
williamr@2
   804
/**
williamr@2
   805
A pattern represented by a bitmap that is used by a graphics accelerator to 
williamr@2
   806
fill a rectangle or polygon.
williamr@2
   807
williamr@2
   808
An object of this class is specified when constructing a TGopFilledRectWithPattern 
williamr@2
   809
or TGopFilledPolygonWithPattern. The types and sizes of fill pattern bitmaps 
williamr@2
   810
supported by the accelerator are given by TGraphicsAcceleratorCaps::iPattern 
williamr@2
   811
and TGraphicsAcceleratorCaps::iPatternSizes respectively.
williamr@2
   812
williamr@2
   813
@see TGopFilledRectWithPattern
williamr@2
   814
@see TGopFilledPolygonWithPattern
williamr@2
   815
@see TGraphicsAcceleratorCaps::iPatternSizes
williamr@2
   816
@see TGraphicsAcceleratorCaps::iPattern 
williamr@2
   817
@publishedAll
williamr@2
   818
@released
williamr@2
   819
*/
williamr@2
   820
class TGopFillPattern
williamr@2
   821
	{
williamr@2
   822
public:
williamr@2
   823
	
williamr@2
   824
	/** Provides a handle to the bitmap, and other information needed to draw it. */
williamr@2
   825
	TAcceleratedBitmapSpec	iBitmap;
williamr@2
   826
	
williamr@2
   827
	/** The origin of the pattern. This is the position at which to draw the pixel at 
williamr@2
   828
	the top left hand corner of the bitmap around which copies of the bitmap are 
williamr@2
   829
	"tiled" to form the pattern. It is relative to the top left hand corner of 
williamr@2
   830
	the rectangle being filled, so specify 0,0 if you want the bitmaps drawn flush 
williamr@2
   831
	with the top and left hand sides of the rectangle. */
williamr@2
   832
	TPoint					iOrigin;
williamr@2
   833
	};
williamr@2
   834
williamr@2
   835
/**
williamr@2
   836
Specifies the amount of fading for all the pixels in a rectangular area.
williamr@2
   837
williamr@2
   838
Fading changes colours so that they are closer to white or closer to black. 
williamr@2
   839
To make colours whiter, increase iOffset; to use a smaller range of colours, 
williamr@2
   840
reduce iScale. Fading uses the following formula (where C is a red, green 
williamr@2
   841
or blue value in a TRgb):
williamr@2
   842
williamr@2
   843
colour component C = ( ( iScale * C ) / 256 )+iOffset;
williamr@2
   844
williamr@2
   845
For example:
williamr@2
   846
- to fade to white, specify iScale=128, iOffset=128
williamr@2
   847
- to fade to black, specify iScale=128, iOffset=0
williamr@2
   848
- for no change, specify iScale=256, iOffset=0
williamr@2
   849
williamr@2
   850
An object of this class is specified when constructing a TGopFadeRect.
williamr@2
   851
williamr@2
   852
@see TGopFadeRect
williamr@2
   853
@publishedAll
williamr@2
   854
@released
williamr@2
   855
*/
williamr@2
   856
class TGopFadeParams	// color component C = ( ( iScale * C ) >> 8 )+iOffset;
williamr@2
   857
	{
williamr@2
   858
public:
williamr@2
   859
	
williamr@2
   860
	/** Specifies the degree of fading, maximum=256. */
williamr@2
   861
	TInt iScale;
williamr@2
   862
	
williamr@2
   863
	/** The fading offset. Specifies whether to fade to black or to white. */
williamr@2
   864
	TInt iOffset;
williamr@2
   865
	};
williamr@2
   866
williamr@2
   867
/**
williamr@2
   868
Specifies which pixels should be treated as transparent in a bitblt operation 
williamr@2
   869
that supports transparency.
williamr@2
   870
williamr@2
   871
This is used by the TGopBitBltTransparent and TGopScaledBitBltTransparent 
williamr@2
   872
graphics operations.
williamr@2
   873
williamr@2
   874
For the possible transparency types, see the TTransparencyType enumeration.
williamr@2
   875
williamr@2
   876
An object of this class is specified when constructing a TGopBitBltTransparent or
williamr@2
   877
TGopScaledBitBltTransparent.
williamr@2
   878
williamr@2
   879
@see TTransparencyType
williamr@2
   880
@see TGopBitBltTransparent
williamr@2
   881
@see TGopScaledBitBltTransparent 
williamr@2
   882
@publishedAll
williamr@2
   883
@released
williamr@2
   884
*/
williamr@2
   885
class TGopTransparency
williamr@2
   886
	{
williamr@2
   887
public:
williamr@2
   888
	
williamr@2
   889
	/** Constructor with a transparency type. iParam is initialised to zero.
williamr@2
   890
	
williamr@2
   891
	@param aType The transparency type. */
williamr@2
   892
	inline TGopTransparency(TTransparencyType aType)	: iType(aType), iParam(0) {}
williamr@2
   893
	
williamr@2
   894
	/** Constructor with a pixel value. The type is initialised to ETransparentPixel. 
williamr@2
   895
	Any pixel that has a value equal to aPixelValue is treated as transparent. 
williamr@2
   896
	aPixelValue is the bit pattern of the pixel as stored in the bitmap.
williamr@2
   897
	
williamr@2
   898
	@param aPixelValue The pixel value. */
williamr@2
   899
	inline TGopTransparency(TInt aPixelValue)			: iType(ETransparentPixel), iParam(aPixelValue) {}
williamr@2
   900
	
williamr@2
   901
	/** Constructor with a TRgb value. The type is initialised to ETransparentColor. 
williamr@2
   902
	Any pixel that has a color of aRgb is treated as transparent.
williamr@2
   903
	
williamr@2
   904
	@param aRgb The TRgb value. */
williamr@2
   905
	inline TGopTransparency(TRgb aRgb)					: iType(ETransparentColor), iParam(aRgb.Value()) {}
williamr@2
   906
	
williamr@2
   907
	/** Gets the colour that is treated as transparent. This is the value of iParam 
williamr@2
   908
	as a TRgb.
williamr@2
   909
	
williamr@2
   910
	@return The colour that is treated as transparent. */
williamr@2
   911
	inline TRgb Color()	const							{ return TRgb(iParam); }
williamr@2
   912
	
williamr@2
   913
	/** Gets the value of the colour as a TInt that is treated as transparent. This 
williamr@2
   914
	is the value of iParam.
williamr@2
   915
	
williamr@2
   916
	@return The colour that is treated as transparent. This is the bit pattern 
williamr@2
   917
	of the colour as stored in the bitmap. */
williamr@2
   918
	inline TInt Pixel()	const							{ return iParam; }
williamr@2
   919
public:
williamr@2
   920
	
williamr@2
   921
	/** The transparency type. */
williamr@2
   922
	TTransparencyType	iType;
williamr@2
   923
	
williamr@2
   924
	/** Holds the value of the colour/pixel that is treated as transparent. */
williamr@2
   925
	TUint32				iParam;
williamr@2
   926
	};
williamr@2
   927
williamr@2
   928
williamr@2
   929
//
williamr@2
   930
// Wrapper classes for graphics operation arguments
williamr@2
   931
//
williamr@2
   932
williamr@2
   933
#ifdef __WINS__
williamr@2
   934
#pragma warning(disable : 4355) // Disable warning - 'this' : used in base member initializer list
williamr@2
   935
#endif
williamr@2
   936
williamr@2
   937
/**
williamr@2
   938
An accelerated graphics operation that fills a rectangular area with a colour.
williamr@2
   939
williamr@2
   940
The data members are all initialised on construction. Objects of this class 
williamr@2
   941
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
   942
or in a buffer. 
williamr@2
   943
@publishedAll
williamr@2
   944
@released
williamr@2
   945
*/
williamr@2
   946
class TGopFilledRect : public TGraphicsOperation
williamr@2
   947
	{
williamr@2
   948
public:
williamr@2
   949
	/** Constructor with a rectangle and a colour.
williamr@2
   950
	@param aRect The rectangle to fill.
williamr@2
   951
	@param aColor The fill colour. */
williamr@2
   952
	inline TGopFilledRect(const TRect& aRect,TRgb aColor)
williamr@2
   953
			: TGraphicsOperation(EFilledRect,sizeof(*this)), iRect(aRect) , iColor(aColor) {}
williamr@2
   954
public:
williamr@2
   955
	
williamr@2
   956
	/** The rectangle to fill. */
williamr@2
   957
	TRect	iRect;
williamr@2
   958
	
williamr@2
   959
	/** The fill colour. */
williamr@2
   960
	TRgb	iColor;
williamr@2
   961
	};
williamr@2
   962
williamr@2
   963
/**
williamr@2
   964
An accelerated graphics operation that fills a rectangular area with a colour, 
williamr@2
   965
whilst performing a bitwise logical operation with the pixels in the region, 
williamr@2
   966
for instance AND, OR, Exclusive OR.
williamr@2
   967
williamr@2
   968
The bitwise logical operation is specified in the draw mode. The data members 
williamr@2
   969
are all initialised on construction. Objects of this class can be passed to 
williamr@2
   970
a graphics accelerator's Operation() function either individually, or in a 
williamr@2
   971
buffer.
williamr@2
   972
@publishedAll
williamr@2
   973
@released
williamr@2
   974
*/
williamr@2
   975
class TGopFilledRectUsingDrawMode : public TGraphicsOperation
williamr@2
   976
	{
williamr@2
   977
public:
williamr@2
   978
	/** Constructor with a rectangle, a colour and a draw mode.
williamr@2
   979
	@param aRect The rectangle to fill.
williamr@2
   980
	@param aColor The fill colour.
williamr@2
   981
	@param aDrawMode The draw mode. */
williamr@2
   982
	inline TGopFilledRectUsingDrawMode(const TRect& aRect,TRgb aColor,CGraphicsContext::TDrawMode aDrawMode)
williamr@2
   983
		: TGraphicsOperation(EFilledRectUsingDrawMode,sizeof(*this)), iRect(aRect) , iColor(aColor) , iDrawMode(aDrawMode) {}
williamr@2
   984
public:
williamr@2
   985
	
williamr@2
   986
	/** The rectangle to fill. */
williamr@2
   987
	TRect						iRect;
williamr@2
   988
	
williamr@2
   989
	/** The fill colour. */
williamr@2
   990
	TRgb						iColor;
williamr@2
   991
	
williamr@2
   992
	/** The draw mode. */
williamr@2
   993
	CGraphicsContext::TDrawMode	iDrawMode;
williamr@2
   994
	};
williamr@2
   995
williamr@2
   996
/**
williamr@2
   997
An accelerated graphics operation that fills a rectangular area with a pattern.
williamr@2
   998
williamr@2
   999
The pattern consists of multiple copies of a bitmap, drawn tiled around an 
williamr@2
  1000
origin. Objects of this class can be passed to a graphics accelerator's Operation() 
williamr@2
  1001
function either individually, or in a buffer. 
williamr@2
  1002
williamr@2
  1003
@see TGopFillPattern
williamr@2
  1004
@publishedAll
williamr@2
  1005
@released
williamr@2
  1006
*/
williamr@2
  1007
class TGopFilledRectWithPattern : public TGraphicsOperation
williamr@2
  1008
	{
williamr@2
  1009
public:
williamr@2
  1010
	/** Constructor with a rectangle and a pattern.
williamr@2
  1011
	@param aRect The rectangle to fill.
williamr@2
  1012
	@param aPattern Specifies the handle to the bitmap to use for the pattern, 
williamr@2
  1013
	and the origin for the pattern. */
williamr@2
  1014
	inline TGopFilledRectWithPattern(const TRect& aRect,TGopFillPattern aPattern)
williamr@2
  1015
		: TGraphicsOperation(EFilledRectWithPattern,sizeof(*this)), iRect(aRect) , iPattern(aPattern) {}
williamr@2
  1016
public:
williamr@2
  1017
	
williamr@2
  1018
	/** The rectangle to fill. */
williamr@2
  1019
	TRect			iRect;
williamr@2
  1020
	
williamr@2
  1021
	/** Specifies the handle to the bitmap to use for the pattern and the origin for 
williamr@2
  1022
	the pattern. */
williamr@2
  1023
	TGopFillPattern iPattern;
williamr@2
  1024
	};
williamr@2
  1025
williamr@2
  1026
/**
williamr@2
  1027
An accelerated graphics operation that inverts the colour of all pixels in 
williamr@2
  1028
a rectangular area.
williamr@2
  1029
williamr@2
  1030
Objects of this class can be passed to a graphics accelerator's Operation() 
williamr@2
  1031
function either individually, or in a buffer. 
williamr@2
  1032
@publishedAll
williamr@2
  1033
@released
williamr@2
  1034
*/
williamr@2
  1035
class TGopInvertRect : public TGraphicsOperation
williamr@2
  1036
	{
williamr@2
  1037
public:
williamr@2
  1038
	/** Constructor with a rectangle.
williamr@2
  1039
	@param aRect The rectangle in which to invert the colours. */
williamr@2
  1040
	inline TGopInvertRect(const TRect& aRect)
williamr@2
  1041
		: TGraphicsOperation(EInvertRect,sizeof(*this)), iRect(aRect) {}
williamr@2
  1042
public:
williamr@2
  1043
	
williamr@2
  1044
	/** The rectangle in which to invert the colours. */
williamr@2
  1045
	TRect	iRect;
williamr@2
  1046
	};
williamr@2
  1047
williamr@2
  1048
/**
williamr@2
  1049
An accelerated graphics operation that fades the pixels in a rectangular area.
williamr@2
  1050
williamr@2
  1051
Objects of this class can be passed to a graphics accelerator's Operation() 
williamr@2
  1052
function either individually, or in a buffer. 
williamr@2
  1053
@publishedAll
williamr@2
  1054
@released
williamr@2
  1055
*/
williamr@2
  1056
class TGopFadeRect : public TGraphicsOperation
williamr@2
  1057
	{
williamr@2
  1058
public:
williamr@2
  1059
	/** Constructor with a rectangle and fade parameters.
williamr@2
  1060
	@param aRect The rectangle to fade.
williamr@2
  1061
	@param aFade The fade parameters. */
williamr@2
  1062
	inline TGopFadeRect(const TRect& aRect, const TGopFadeParams aFade)
williamr@2
  1063
		: TGraphicsOperation(EFadeRect,sizeof(*this)), iRect(aRect), iFade(aFade) {}
williamr@2
  1064
public:
williamr@2
  1065
	
williamr@2
  1066
	/** The rectangle to fade. */
williamr@2
  1067
	TRect			iRect;
williamr@2
  1068
	
williamr@2
  1069
	/** The fade parameters. */
williamr@2
  1070
	TGopFadeParams	iFade;
williamr@2
  1071
	};
williamr@2
  1072
williamr@2
  1073
/**
williamr@2
  1074
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1075
into another.
williamr@2
  1076
williamr@2
  1077
The data members are all initialised on construction. Objects of this class 
williamr@2
  1078
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1079
or in a buffer. 
williamr@2
  1080
@publishedAll
williamr@2
  1081
@released
williamr@2
  1082
*/
williamr@2
  1083
class TGopBitBlt : public TGraphicsOperation
williamr@2
  1084
	{
williamr@2
  1085
public:
williamr@2
  1086
	/** Constructor with a position, a source bitmap handle and a rectangle.
williamr@2
  1087
	@param aDestination The destination for the top left hand corner of the portion 
williamr@2
  1088
	of the source bitmap.
williamr@2
  1089
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1090
	to draw it.
williamr@2
  1091
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1092
	to the top left of the source bitmap. Defines the part of the source bitmap to be copied. */
williamr@2
  1093
	inline TGopBitBlt(const TPoint& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect)
williamr@2
  1094
		: TGraphicsOperation(EBitBlt,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect) {}
williamr@2
  1095
public:
williamr@2
  1096
	
williamr@2
  1097
	/** The destination for the top left hand corner of the portion of the source bitmap. */
williamr@2
  1098
	TPoint					iDestination;
williamr@2
  1099
	
williamr@2
  1100
	/** A handle to the source bitmap, and other information needed to draw it. */
williamr@2
  1101
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1102
	
williamr@2
  1103
	/** A rectangle defining all or a part of the bitmap to be copied. */
williamr@2
  1104
	TRect					iSourceRect;
williamr@2
  1105
	};
williamr@2
  1106
williamr@2
  1107
/**
williamr@2
  1108
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1109
into another, using a third bitmap as a mask.
williamr@2
  1110
williamr@2
  1111
The mask must be the same size as the source bitmap. The parts of the source 
williamr@2
  1112
bitmap that are drawn are the areas that are black in the mask.
williamr@2
  1113
williamr@2
  1114
The data members are all initialised on construction. Objects of this class 
williamr@2
  1115
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1116
or in a buffer.
williamr@2
  1117
williamr@2
  1118
@see TGraphicsAcceleratorCaps::iMaskType 
williamr@2
  1119
@publishedAll
williamr@2
  1120
@released
williamr@2
  1121
*/
williamr@2
  1122
class TGopBitBltMasked : public TGraphicsOperation
williamr@2
  1123
	{
williamr@2
  1124
public:
williamr@2
  1125
	/** Constructor with a position, a source bitmap handle, a rectangle and a mask bitmap handle.
williamr@2
  1126
	@param aDestination The destination for the top left hand corner of the portion 
williamr@2
  1127
	of the source bitmap.
williamr@2
  1128
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1129
	to draw it.
williamr@2
  1130
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1131
	to the top left of the bitmap. Defines the part of the source bitmap to be copied.
williamr@2
  1132
	@param aMask A handle to the mask bitmap. The parts of the source bitmap 
williamr@2
  1133
	that are drawn are the areas that are black in the mask bitmap. */
williamr@2
  1134
	inline TGopBitBltMasked(const TPoint& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect, TAcceleratedBitmapSpec aMask)
williamr@2
  1135
		: TGraphicsOperation(EBitBltMasked,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect), iMask(aMask) {}
williamr@2
  1136
public:
williamr@2
  1137
	
williamr@2
  1138
	/** The destination for the top left hand corner of the portion of the bitmap. */
williamr@2
  1139
	TPoint					iDestination;
williamr@2
  1140
	
williamr@2
  1141
	/** A handle to the source bitmap, and other information needed to draw it. */
williamr@2
  1142
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1143
	
williamr@2
  1144
	/** A rectangle defining all or a part of the bitmap to be copied. */
williamr@2
  1145
	TRect					iSourceRect;
williamr@2
  1146
	
williamr@2
  1147
	/** A handle to the source bitmap mask. */
williamr@2
  1148
	TAcceleratedBitmapSpec	iMask;
williamr@2
  1149
	};
williamr@2
  1150
williamr@2
  1151
/**
williamr@2
  1152
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1153
into another, with some transparent pixels in the bitmap.
williamr@2
  1154
williamr@2
  1155
The data members are all initialised on construction. Objects of this class 
williamr@2
  1156
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1157
or in a buffer.
williamr@2
  1158
williamr@2
  1159
@see TGraphicsAcceleratorCaps::iTransparency 
williamr@2
  1160
@see TGopTransparency
williamr@2
  1161
@publishedAll
williamr@2
  1162
@released
williamr@2
  1163
*/
williamr@2
  1164
class TGopBitBltTransparent : public TGraphicsOperation
williamr@2
  1165
	{
williamr@2
  1166
public:
williamr@2
  1167
	/** Constructor with a destination, a handle to the source bitmap, a rectangle 
williamr@2
  1168
	and a specification for which pixels should be treated as transparent.
williamr@2
  1169
	
williamr@2
  1170
	@param aDestination The destination for the top left hand corner of the portion 
williamr@2
  1171
	of the source bitmap.
williamr@2
  1172
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1173
	to draw it.
williamr@2
  1174
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are 
williamr@2
  1175
	relative to the top left of the bitmap. Defines the part of the source bitmap to 
williamr@2
  1176
	be copied.
williamr@2
  1177
	@param aTransparency A specification for which pixels in the source bitmap should
williamr@2
  1178
	be treated as transparent. */
williamr@2
  1179
	inline TGopBitBltTransparent(const TPoint& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect, TGopTransparency aTransparency)
williamr@2
  1180
		: TGraphicsOperation(EBitBltTransparent,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect), iTransparency(aTransparency) {}
williamr@2
  1181
public:
williamr@2
  1182
	
williamr@2
  1183
	/** The destination for the top left hand corner of the portion of the bitmap. */
williamr@2
  1184
	TPoint					iDestination;
williamr@2
  1185
	
williamr@2
  1186
	/** A handle to the source bitmap, and other information needed to draw it. */
williamr@2
  1187
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1188
	
williamr@2
  1189
	/** A rectangle defining all or a part of the bitmap to be copied. */
williamr@2
  1190
	TRect					iSourceRect;
williamr@2
  1191
	
williamr@2
  1192
	/** A specification for which pixels should be treated as transparent. */
williamr@2
  1193
	TGopTransparency		iTransparency;
williamr@2
  1194
	};
williamr@2
  1195
williamr@2
  1196
/**
williamr@2
  1197
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1198
into another, using alpha blending. 
williamr@2
  1199
williamr@2
  1200
The alpha value is part of each pixel in the source bitmap. For instance, 
williamr@2
  1201
a 32 bits per pixel bitmap may have 8 bits for each of the alpha, red, green 
williamr@2
  1202
and blue values.
williamr@2
  1203
williamr@2
  1204
Supported bitmap formats with an alpha-channel are given in by
williamr@2
  1205
TGraphicsAcceleratorCaps::iAlphaChannel.
williamr@2
  1206
williamr@2
  1207
The data members are all initialised on construction. Objects of this class 
williamr@2
  1208
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1209
or in a buffer.
williamr@2
  1210
williamr@2
  1211
@see TGraphicsAcceleratorCaps::iAlphaChannel 
williamr@2
  1212
@publishedAll
williamr@2
  1213
@released
williamr@2
  1214
*/
williamr@2
  1215
class TGopBitBltAlphaChannel : public TGraphicsOperation
williamr@2
  1216
	{
williamr@2
  1217
public:
williamr@2
  1218
	/** Constructor with a position, a bitmap handle and a rectangle.
williamr@2
  1219
	@param aDestination The destination for the top left hand corner of the portion 
williamr@2
  1220
	of the source bitmap.
williamr@2
  1221
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1222
	to draw it.
williamr@2
  1223
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1224
	to the top left of the source bitmap. Defines the part of the source bitmap to be copied. */
williamr@2
  1225
	inline TGopBitBltAlphaChannel(const TPoint& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect)
williamr@2
  1226
		: TGraphicsOperation(EBitBltAlphaChannel,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect) {}
williamr@2
  1227
public:
williamr@2
  1228
	
williamr@2
  1229
	/** The destination for the top left hand corner of the portion of the bitmap. */
williamr@2
  1230
	TPoint					iDestination;
williamr@2
  1231
	
williamr@2
  1232
	/** A handle to the source bitmap, and other information needed to access it. */
williamr@2
  1233
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1234
	
williamr@2
  1235
	/** A rectangle defining all or a part of the bitmap to be copied. */
williamr@2
  1236
	TRect					iSourceRect;
williamr@2
  1237
	};
williamr@2
  1238
williamr@2
  1239
/**
williamr@2
  1240
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1241
into another using alpha blending values provided in a third bitmap.
williamr@2
  1242
williamr@2
  1243
The way alpha blending works is as follows: if the alpha value is the maximum, 
williamr@2
  1244
the source pixel is opaque, in other words, the full colour of the pixel is 
williamr@2
  1245
written to the destination. If the alpha value is zero, the source pixel is 
williamr@2
  1246
fully transparent, and the destination is left unaltered. Values in-between 
williamr@2
  1247
cause blending with the following formula:
williamr@2
  1248
williamr@2
  1249
Destination = Source*Alpha/max_Alpha + Destination*(max_Alpha-Alpha)/max_Alpha
williamr@2
  1250
williamr@2
  1251
Colour alpha-bitmaps specify red, green and blue alpha values for each pixel, 
williamr@2
  1252
greyscale bitmaps specify a single alpha value for each pixel. The maximum 
williamr@2
  1253
alpha value depends on the bitmap's display mode. For example, 255 is the 
williamr@2
  1254
maximum for an EGray256 or EColor16M bitmap. The maximum is less for bitmaps 
williamr@2
  1255
which use fewer bits per colour component.
williamr@2
  1256
williamr@2
  1257
Supported bitmap formats than can be used as alpha bitmaps are given in 
williamr@2
  1258
TGraphicsAcceleratorCaps::iAlphaBitmap.
williamr@2
  1259
williamr@2
  1260
Objects of this class can be passed to a graphics accelerator's Operation() 
williamr@2
  1261
function either individually, or in a buffer.
williamr@2
  1262
williamr@2
  1263
@see TGraphicsAcceleratorCaps::iAlphaBitmap 
williamr@2
  1264
@publishedAll
williamr@2
  1265
@released
williamr@2
  1266
*/
williamr@2
  1267
class TGopBitBltAlphaBitmap : public TGraphicsOperation
williamr@2
  1268
	{
williamr@2
  1269
public:
williamr@2
  1270
	/** Constructor with a position, two bitmap specs and a rectangle.
williamr@2
  1271
	@param aDestination The destination for the top left hand corner of the portion 
williamr@2
  1272
	of the source bitmap.
williamr@2
  1273
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1274
	to draw it.
williamr@2
  1275
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1276
	to the top left of the source bitmap. Defines the part of the source bitmap to be copied.
williamr@2
  1277
	@param aAlphaBitmap A handle to the alpha bitmap, the bitmap that contains 
williamr@2
  1278
	alpha blending values. */
williamr@2
  1279
	inline TGopBitBltAlphaBitmap(const TPoint& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect, TAcceleratedBitmapSpec aAlphaBitmap)
williamr@2
  1280
		: TGraphicsOperation(EBitBltAlphaBitmap,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect), iAlphaBitmap(aAlphaBitmap) {}
williamr@2
  1281
public:
williamr@2
  1282
	
williamr@2
  1283
	/** The destination for the top left hand corner of the portion of the source bitmap. */
williamr@2
  1284
	TPoint					iDestination;
williamr@2
  1285
	
williamr@2
  1286
	/** A handle to the source bitmap, and other information needed to access it. */
williamr@2
  1287
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1288
	
williamr@2
  1289
	/** A rectangle defining the part of the source bitmap to be copied. */
williamr@2
  1290
	TRect					iSourceRect;
williamr@2
  1291
	
williamr@2
  1292
	/** A handle to the alpha bitmap, the bitmap that contains alpha blending values. */
williamr@2
  1293
	TAcceleratedBitmapSpec	iAlphaBitmap;
williamr@2
  1294
	};
williamr@2
  1295
williamr@2
  1296
/**
williamr@2
  1297
An accelerated graphics operation that copies a rectangular region of two bitmaps 
williamr@2
  1298
to a destination, using alpha blending values provided in a third bitmap to blend the 
williamr@2
  1299
corresponding entries in the first and second bitmaps.
williamr@2
  1300
williamr@2
  1301
The way alpha blending works is as follows: if the alpha value is the maximum, 
williamr@2
  1302
the pixel from the first source is opaque, in other words, the full colour of 
williamr@2
  1303
the pixel is written to the destination. If the alpha value is zero, the pixel 
williamr@2
  1304
from the first source is fully transparent, in other words, the full colour of
williamr@2
  1305
the pixel in the second source is used. Values in-between cause blending with 
williamr@2
  1306
the following formula:
williamr@2
  1307
williamr@2
  1308
Destination = Source1*Alpha/max_Alpha + Source2*(max_Alpha-Alpha)/max_Alpha
williamr@2
  1309
williamr@2
  1310
Colour alpha bitmaps specify red, green and blue alpha values for each pixel, 
williamr@2
  1311
greyscale bitmaps specify a single alpha value for each pixel. The maximum 
williamr@2
  1312
alpha value depends on the bitmap's display mode. For example, 255 is the 
williamr@2
  1313
maximum for an EGray256 or EColor16M bitmap. The maximum is less for bitmaps 
williamr@2
  1314
which use fewer bits per colour component.
williamr@2
  1315
williamr@2
  1316
Supported bitmap formats than can be used as alpha bitmaps are given in 
williamr@2
  1317
TGraphicsAcceleratorCaps::iAlphaBitmap.
williamr@2
  1318
williamr@2
  1319
Objects of this class can be passed to a graphics accelerator's Operation() 
williamr@2
  1320
function either individually, or in a buffer.
williamr@2
  1321
williamr@2
  1322
@see TGraphicsAcceleratorCaps::iAlphaBitmap 
williamr@2
  1323
@publishedAll
williamr@2
  1324
@released
williamr@2
  1325
*/
williamr@2
  1326
class TGopAlphaBlendTwoBitmaps : public TGraphicsOperation
williamr@2
  1327
	{
williamr@2
  1328
public:
williamr@2
  1329
	/** 
williamr@2
  1330
	Constructor with a position, three bitmap specs and a rectangle.
williamr@2
  1331
	@param aDestination The destination for the top left hand corner of the portion 
williamr@2
  1332
	of the source bitmaps.
williamr@2
  1333
	@param aSourceBmp1 A handle to the first of the source bitmaps, and other information 
williamr@2
  1334
	needed to draw it.
williamr@2
  1335
	@param aSourceBmp2 A handle to the second of the source bitmaps, and other information 
williamr@2
  1336
	needed to draw it.
williamr@2
  1337
	@param aSourceRect A rectangle within the source bitmaps. Its coordinates are relative 
williamr@2
  1338
	to the top left of the bitmap. Defines the part of the bitmap to be copied.
williamr@2
  1339
	@param aSourcePt2 The point in the second source bitmap from which we take pixels to blend
williamr@2
  1340
	@param aAlphaBitmap A handle to the alpha bitmap, the bitmap that contains 
williamr@2
  1341
	alpha blending values.
williamr@2
  1342
	@param aAlphaPt The point in the alpha bitmap from which we take pixels to blend
williamr@2
  1343
	 */	
williamr@2
  1344
	inline TGopAlphaBlendTwoBitmaps(const TPoint& aDestination,TAcceleratedBitmapSpec aSourceBmp1,TAcceleratedBitmapSpec aSourceBmp2,TRect& aSourceRect,const TPoint& aSrcPt2,TAcceleratedBitmapSpec aAlphaBmp, const TPoint& aAlphaPt)
williamr@2
  1345
		: TGraphicsOperation(EAlphaBlendTwoBitmaps,sizeof(*this)), iDestination(aDestination), iSourceBmp1(aSourceBmp1), iSourceBmp2(aSourceBmp2), iSourceRect(aSourceRect), iSrcPt2(aSrcPt2), iAlphaBmp(aAlphaBmp), iAlphaPt(aAlphaPt) {}
williamr@2
  1346
public:
williamr@2
  1347
	
williamr@2
  1348
	/** The destination for the top left hand corner of the portion of the source bitmaps. */
williamr@2
  1349
	TPoint					iDestination;
williamr@2
  1350
	
williamr@2
  1351
	/** A handle to the first source bitmap, and other information needed to access it. */
williamr@2
  1352
	TAcceleratedBitmapSpec	iSourceBmp1;
williamr@2
  1353
	
williamr@2
  1354
	/** A handle to the second source bitmap, and other information needed to access it. */
williamr@2
  1355
	TAcceleratedBitmapSpec	iSourceBmp2;
williamr@2
  1356
	
williamr@2
  1357
	/** A rectangle defining the part of the source bitmaps to be copied. */
williamr@2
  1358
	TRect					iSourceRect;
williamr@2
  1359
	
williamr@2
  1360
	/** The point in the second source bitmap from which we take pixels to blend. */ 
williamr@2
  1361
	TPoint					iSrcPt2;
williamr@2
  1362
	
williamr@2
  1363
	/** A handle to the alpha bitmap, the bitmap that contains alpha blending values. */
williamr@2
  1364
	TAcceleratedBitmapSpec	iAlphaBmp;
williamr@2
  1365
	
williamr@2
  1366
	/** The point in the alpha bitmap from which we take pixels to blend. */ 
williamr@2
  1367
	TPoint					iAlphaPt;
williamr@2
  1368
	};
williamr@2
  1369
	
williamr@2
  1370
/**
williamr@2
  1371
An accelerated graphics operation that copies a rectangular region of a bitmap blended
williamr@2
  1372
with the screen image to the screen, using alpha blending values provided in an alpha bitmap 
williamr@2
  1373
to blend the corresponding entries in the bitmap and on the screen.
williamr@2
  1374
williamr@2
  1375
The way alpha blending works is as follows: if the alpha value is the maximum, 
williamr@2
  1376
the pixel from the source bitmap is opaque, in other words, the full colour of 
williamr@2
  1377
the pixel is written to the destination. If the alpha value is zero, the pixel 
williamr@2
  1378
from the source bitmap is fully transparent, in other words, the full colour of
williamr@2
  1379
the pixel on the screen is used. Values in-between cause blending with the 
williamr@2
  1380
following formula:
williamr@2
  1381
williamr@2
  1382
Destination = Source*Alpha/max_Alpha + Screen*(max_Alpha-Alpha)/max_Alpha
williamr@2
  1383
williamr@2
  1384
Colour alpha bitmaps specify red, green and blue alpha values for each pixel, 
williamr@2
  1385
greyscale bitmaps specify a single alpha value for each pixel. The maximum 
williamr@2
  1386
alpha value depends on the bitmap's display mode. For example, 255 is the 
williamr@2
  1387
maximum for an EGray256 or EColor16M bitmap. The maximum is less for bitmaps 
williamr@2
  1388
which use fewer bits per colour component.
williamr@2
  1389
williamr@2
  1390
Supported bitmap formats than can be used as alpha bitmaps are given in 
williamr@2
  1391
TGraphicsAcceleratorCaps::iAlphaBitmap.
williamr@2
  1392
williamr@2
  1393
Objects of this class can be passed to a graphics accelerator's Operation() 
williamr@2
  1394
function either individually, or in a buffer.
williamr@2
  1395
williamr@2
  1396
@see TGraphicsAcceleratorCaps::iAlphaBitmap 
williamr@2
  1397
@publishedAll
williamr@2
  1398
@released
williamr@2
  1399
*/
williamr@2
  1400
class TGopAlphaBlendOneBitmap : public TGraphicsOperation
williamr@2
  1401
	{
williamr@2
  1402
public:
williamr@2
  1403
	/** 
williamr@2
  1404
	Constructor with a position, two bitmap specs and a rectangle.
williamr@2
  1405
	@param aDestination The destination for the top left hand corner of the portion 
williamr@2
  1406
	of the source bitmap.
williamr@2
  1407
	@param aSourceBmp A handle to the source bitmap, and other information needed 
williamr@2
  1408
	to draw it.
williamr@2
  1409
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1410
	to the top left of the source bitmap. Defines the part of the source bitmap to be copied.
williamr@2
  1411
	@param aAlphaBitmap A handle to the alpha bitmap, the bitmap that contains 
williamr@2
  1412
	alpha blending values.
williamr@2
  1413
	@param aAlphaPt The point in the alpha bitmap from which we take pixels to blend
williamr@2
  1414
	 */
williamr@2
  1415
	
williamr@2
  1416
	
williamr@2
  1417
	inline TGopAlphaBlendOneBitmap(const TPoint& aDestination,TAcceleratedBitmapSpec aSourceBmp,TRect& aSourceRect,TAcceleratedBitmapSpec aAlphaBmp, const TPoint& aAlphaPt)
williamr@2
  1418
		: TGraphicsOperation(EAlphaBlendOneBitmap,sizeof(*this)), iDestination(aDestination), iSourceBmp(aSourceBmp), iSourceRect(aSourceRect), iAlphaBmp(aAlphaBmp), iAlphaPt(aAlphaPt) {}
williamr@2
  1419
public:
williamr@2
  1420
	
williamr@2
  1421
	/** The destination for the top left hand corner of the portion of the source bitmap. */
williamr@2
  1422
	TPoint					iDestination;
williamr@2
  1423
	
williamr@2
  1424
	/** A handle to the source bitmap, and other information needed to access it. */
williamr@2
  1425
	TAcceleratedBitmapSpec	iSourceBmp;
williamr@2
  1426
	
williamr@2
  1427
	/** A rectangle defining the part of the bitmap to be copied. */
williamr@2
  1428
	TRect					iSourceRect;
williamr@2
  1429
	
williamr@2
  1430
	/** A handle to the alpha bitmap, the bitmap that contains alpha blending values. */
williamr@2
  1431
	TAcceleratedBitmapSpec	iAlphaBmp;
williamr@2
  1432
	
williamr@2
  1433
	/** Position of the first pixel in the alpha bitmap to be used for alpha blending. */ 
williamr@2
  1434
	TPoint					iAlphaPt;
williamr@2
  1435
	};
williamr@2
  1436
williamr@2
  1437
/**
williamr@2
  1438
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1439
into a different sized region of another.
williamr@2
  1440
williamr@2
  1441
The data members are all initialised on construction. Objects of this class 
williamr@2
  1442
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1443
or in a buffer. 
williamr@2
  1444
@publishedAll
williamr@2
  1445
@released
williamr@2
  1446
*/
williamr@2
  1447
class TGopScaledBitBlt : public TGraphicsOperation
williamr@2
  1448
	{
williamr@2
  1449
public:
williamr@2
  1450
	/** Constructor with a destination rectangle, a handle to the source bitmap and 
williamr@2
  1451
	a source rectangle.
williamr@2
  1452
	@param aDestination The destination for the portion of the source bitmap. If necessary, 
williamr@2
  1453
	the source bitmap portion is resized to fit into this rectangle.
williamr@2
  1454
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1455
	to draw it.
williamr@2
  1456
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1457
	to the top left of the source bitmap. Defines the part of the source bitmap to be copied. */
williamr@2
  1458
	inline TGopScaledBitBlt(const TRect& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect)
williamr@2
  1459
		: TGraphicsOperation(EScaledBitBlt,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect) {}
williamr@2
  1460
public:
williamr@2
  1461
williamr@2
  1462
	/** The destination rectangle for the portion of the source bitmap. */
williamr@2
  1463
	TRect					iDestination;
williamr@2
  1464
	
williamr@2
  1465
	/** A handle to the source bitmap. */
williamr@2
  1466
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1467
	
williamr@2
  1468
	/** A rectangle defining all or a part of the source bitmap to be copied. */
williamr@2
  1469
	TRect					iSourceRect;
williamr@2
  1470
	};
williamr@2
  1471
williamr@2
  1472
/**
williamr@2
  1473
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1474
into a different sized region of another, using a third bitmap as a mask. 
williamr@2
  1475
williamr@2
  1476
The mask must be the same size as the source bitmap. The parts of the source 
williamr@2
  1477
bitmap that are drawn are the areas that are black in the mask.
williamr@2
  1478
williamr@2
  1479
The data members are all initialised on construction. Objects of this class 
williamr@2
  1480
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1481
or in a buffer.
williamr@2
  1482
williamr@2
  1483
@see TGraphicsAcceleratorCaps::iMaskType 
williamr@2
  1484
@publishedAll
williamr@2
  1485
@released
williamr@2
  1486
*/
williamr@2
  1487
class TGopScaledBitBltMasked : public TGraphicsOperation
williamr@2
  1488
	{
williamr@2
  1489
public:
williamr@2
  1490
	/** Constructor with a source and destination rectangle, and handles to the source 
williamr@2
  1491
	and mask bitmaps.
williamr@2
  1492
	
williamr@2
  1493
	@param aDestination The destination for the portion of the source bitmap. If necessary, 
williamr@2
  1494
	the source bitmap portion is resized to fit into this rectangle.
williamr@2
  1495
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1496
	to draw it.
williamr@2
  1497
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1498
	to the top left of the source bitmap. Defines the part of the source bitmap to be copied.
williamr@2
  1499
	@param aMask A handle to the mask bitmap. */
williamr@2
  1500
	inline TGopScaledBitBltMasked(const TRect& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect, TAcceleratedBitmapSpec aMask)
williamr@2
  1501
		: TGraphicsOperation(EScaledBitBltMasked,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect), iMask(aMask) {}
williamr@2
  1502
public:
williamr@2
  1503
	
williamr@2
  1504
	/** The destination rectangle for the portion of the bitmap. */
williamr@2
  1505
	TRect					iDestination;
williamr@2
  1506
	
williamr@2
  1507
	/** A handle to the source bitmap. */
williamr@2
  1508
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1509
	
williamr@2
  1510
	/** A rectangle defining all or a part of the source bitmap to be copied. */
williamr@2
  1511
	TRect					iSourceRect;
williamr@2
  1512
	
williamr@2
  1513
	/** A handle to the source bitmap mask. */
williamr@2
  1514
	TAcceleratedBitmapSpec	iMask;
williamr@2
  1515
	};
williamr@2
  1516
williamr@2
  1517
/**
williamr@2
  1518
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1519
into a different sized region of another, with some transparent pixels in 
williamr@2
  1520
the source bitmap.
williamr@2
  1521
williamr@2
  1522
The data members are all initialised on construction. Objects of this class 
williamr@2
  1523
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1524
or in a buffer.
williamr@2
  1525
williamr@2
  1526
@see TGraphicsAcceleratorCaps::iTransparency 
williamr@2
  1527
@see TGopTransparency 
williamr@2
  1528
@publishedAll
williamr@2
  1529
@released
williamr@2
  1530
*/
williamr@2
  1531
class TGopScaledBitBltTransparent : public TGraphicsOperation
williamr@2
  1532
	{
williamr@2
  1533
public:
williamr@2
  1534
	/** Constructor with destination and source rectangles, a handle to the source 
williamr@2
  1535
	bitmap and a specification for which pixels should be treated as transparent.
williamr@2
  1536
	
williamr@2
  1537
	@param aDestination The destination for the portion of the source bitmap. If necessary, 
williamr@2
  1538
	the source bitmap portion is resized to fit into this rectangle.
williamr@2
  1539
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1540
	to draw it.
williamr@2
  1541
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are 
williamr@2
  1542
	relative to the top left of the source bitmap. Defines the part of the source bitmap to 
williamr@2
  1543
	be copied.
williamr@2
  1544
	@param aTransparency A specification for which pixels in the source bitmap should be treated as 
williamr@2
  1545
	transparent. */
williamr@2
  1546
	inline TGopScaledBitBltTransparent(const TRect& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect, TGopTransparency aTransparency)
williamr@2
  1547
		: TGraphicsOperation(EScaledBitBltTransparent,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect), iTransparency(aTransparency) {}
williamr@2
  1548
public:
williamr@2
  1549
	
williamr@2
  1550
	/** The destination rectangle for the portion of the source bitmap. */
williamr@2
  1551
	TRect					iDestination;
williamr@2
  1552
	
williamr@2
  1553
	/** A handle to the source bitmap. */
williamr@2
  1554
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1555
	
williamr@2
  1556
	/** A rectangle defining all or a part of the source bitmap to be copied. */
williamr@2
  1557
	TRect					iSourceRect;
williamr@2
  1558
	
williamr@2
  1559
	/** A specification for which pixels in the source bitmap should be treated as transparent. */
williamr@2
  1560
	TGopTransparency		iTransparency;
williamr@2
  1561
	};
williamr@2
  1562
williamr@2
  1563
/**
williamr@2
  1564
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1565
into a different sized region of another using alpha blending. The alpha value 
williamr@2
  1566
is part of each pixel in the source bitmap.
williamr@2
  1567
williamr@2
  1568
Supported bitmap formats with an alpha-channel are given in by
williamr@2
  1569
TGraphicsAcceleratorCaps::iAlphaChannel.
williamr@2
  1570
williamr@2
  1571
The data members are all initialised on construction. Objects of this class 
williamr@2
  1572
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1573
or in a buffer.
williamr@2
  1574
williamr@2
  1575
@see TGraphicsAcceleratorCaps::iAlphaChannel 
williamr@2
  1576
@publishedAll
williamr@2
  1577
@released
williamr@2
  1578
*/
williamr@2
  1579
class TGopScaledBitBltAlphaChannel : public TGraphicsOperation
williamr@2
  1580
	{
williamr@2
  1581
public:
williamr@2
  1582
	/** Constructor with a destination rectangle, a handle to the source bitmap and 
williamr@2
  1583
	a source rectangle.
williamr@2
  1584
	
williamr@2
  1585
	@param aDestination The destination for the portion of the source bitmap. If necessary, 
williamr@2
  1586
	the source bitmap portion is resized to fit into this rectangle.
williamr@2
  1587
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1588
	to draw it.
williamr@2
  1589
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1590
	to the top left of the source bitmap. Defines the part of the source bitmap to be copied. */
williamr@2
  1591
	inline TGopScaledBitBltAlphaChannel(const TRect& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect)
williamr@2
  1592
		: TGraphicsOperation(EScaledBitBltAlphaChannel,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect) {}
williamr@2
  1593
public:
williamr@2
  1594
	
williamr@2
  1595
	/** The destination for the portion of the source bitmap. */
williamr@2
  1596
	TRect					iDestination;
williamr@2
  1597
	
williamr@2
  1598
	/** A handle to the source bitmap, and other information needed to draw it. */
williamr@2
  1599
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1600
	
williamr@2
  1601
	/** A rectangle defining the part of the source bitmap to be copied. */
williamr@2
  1602
	TRect					iSourceRect;
williamr@2
  1603
	};
williamr@2
  1604
williamr@2
  1605
/**
williamr@2
  1606
An accelerated graphics operation that copies a rectangular region of one bitmap 
williamr@2
  1607
into a different sized region of another using alpha blending values provided 
williamr@2
  1608
in a third bitmap.
williamr@2
  1609
williamr@2
  1610
The data members are all initialised on construction. Objects of this class 
williamr@2
  1611
can be passed to a graphics accelerator's Operation() function either individually, 
williamr@2
  1612
or in a buffer.
williamr@2
  1613
williamr@2
  1614
@see TGraphicsAcceleratorCaps::iAlphaBitmap 
williamr@2
  1615
@publishedAll
williamr@2
  1616
@released
williamr@2
  1617
*/
williamr@2
  1618
class TGopScaledBitBltAlphaBitmap : public TGraphicsOperation
williamr@2
  1619
	{
williamr@2
  1620
public:
williamr@2
  1621
	/** Constructor with a source and destination rectangle and two bitmap handles.
williamr@2
  1622
	
williamr@2
  1623
	@param aDestination The destination for the portion of the source bitmap. If necessary, 
williamr@2
  1624
	the source bitmap portion is resized to fit into this rectangle.
williamr@2
  1625
	@param aSourceBitmap A handle to the source bitmap, and other information needed 
williamr@2
  1626
	to draw it.
williamr@2
  1627
	@param aSourceRect A rectangle within the source bitmap. Its coordinates are relative 
williamr@2
  1628
	to the top left of the source bitmap. Defines the part of the source bitmap to be copied.
williamr@2
  1629
	@param aAlphaBitmap A handle to the bitmap that contains alpha blending values. */
williamr@2
  1630
	inline TGopScaledBitBltAlphaBitmap(const TRect& aDestination, TAcceleratedBitmapSpec aSourceBitmap, TRect& aSourceRect, TAcceleratedBitmapSpec aAlphaBitmap)
williamr@2
  1631
		: TGraphicsOperation(EScaledBitBltAlphaBitmap,sizeof(*this)), iDestination(aDestination), iSourceBitmap(aSourceBitmap), iSourceRect(aSourceRect), iAlphaBitmap(aAlphaBitmap) {}
williamr@2
  1632
public:
williamr@2
  1633
	
williamr@2
  1634
	/** The destination for the portion of the bitmap. */
williamr@2
  1635
	TRect					iDestination;
williamr@2
  1636
	
williamr@2
  1637
	/** A handle to the source bitmap, and other information needed to draw it. */
williamr@2
  1638
	TAcceleratedBitmapSpec	iSourceBitmap;
williamr@2
  1639
	
williamr@2
  1640
	/** A rectangle defining the part of the source bitmap to be copied. */
williamr@2
  1641
	TRect					iSourceRect;
williamr@2
  1642
	
williamr@2
  1643
	/** A handle to the bitmap that contains alpha blending values. */
williamr@2
  1644
	TAcceleratedBitmapSpec	iAlphaBitmap;
williamr@2
  1645
	};
williamr@2
  1646
williamr@2
  1647
/**
williamr@2
  1648
An accelerated graphics operation that fills a polygon with a colour.
williamr@2
  1649
williamr@2
  1650
AddPoints() must be called to specify the polygon to be filled. Objects of 
williamr@2
  1651
this class can be passed to a graphics accelerator's Operation() function 
williamr@2
  1652
either individually, or in a buffer.
williamr@2
  1653
williamr@2
  1654
How a graphics accelerator can fill polygons is given by TGraphicsAcceleratorCaps::iPolygon.
williamr@2
  1655
williamr@2
  1656
@see TGraphicsAcceleratorCaps::iPolygon 
williamr@2
  1657
@publishedAll
williamr@2
  1658
@released
williamr@2
  1659
*/
williamr@2
  1660
class TGopFilledPolygon : public TGraphicsOperation
williamr@2
  1661
	{
williamr@2
  1662
public:
williamr@2
  1663
	/** Constructor with a fill rule and a fill colour. The number of points is initialised 
williamr@2
  1664
	to zero.
williamr@2
  1665
 	
williamr@2
  1666
	@param aColor The fill colour.
williamr@2
  1667
	@param aFillRule Bit flags for how self-crossing polygons are filled. */
williamr@2
  1668
	inline TGopFilledPolygon(TRgb aColor, CGraphicsContext::TFillRule aFillRule)
williamr@2
  1669
		: TGraphicsOperation(EFilledPolygon,sizeof(*this)), iColor(aColor), iFillRule(aFillRule), iNumPoints(0) {}
williamr@2
  1670
	inline void AddPoints(TInt aNumPoints, TPoint* aPoints);
williamr@2
  1671
public:
williamr@2
  1672
	
williamr@2
  1673
	/** The fill colour. */
williamr@2
  1674
	TRgb						iColor;
williamr@2
  1675
	
williamr@2
  1676
	/** Bit flags for how self-crossing polygons are filled.
williamr@2
  1677
	
williamr@2
  1678
	@see CGraphicsContext::TFillRule */
williamr@2
  1679
	CGraphicsContext::TFillRule iFillRule;
williamr@2
  1680
	
williamr@2
  1681
	/** The number of points in the polygon. */
williamr@2
  1682
	TInt						iNumPoints;
williamr@2
  1683
	};
williamr@2
  1684
williamr@2
  1685
/** Specifies the polygon to be filled as a number of 2D point coordinates.
williamr@2
  1686
williamr@2
  1687
AddPoints() should only be called once the TGopFilledPolygon object has been stored
williamr@2
  1688
into a buffer.  There must be enough room in the buffer after the TGopFilledPolygon
williamr@2
  1689
object to hold aNumPoints TPoint sized structures.  This is because the points are
williamr@2
  1690
copied into the memory space directly following the TGopFilledPolygon object.
williamr@2
  1691
williamr@2
  1692
@param aNumPoints The number of points in the polygon.
williamr@2
  1693
@param aPoints Pointer to the first point in the polygon. */
williamr@2
  1694
inline void TGopFilledPolygon::AddPoints(TInt aNumPoints, TPoint* aPoints)
williamr@2
  1695
	{ Append(aNumPoints*sizeof(TPoint),aPoints); iNumPoints += aNumPoints; }
williamr@2
  1696
williamr@2
  1697
/** 
williamr@2
  1698
An accelerated graphics operation that fills a polygon with a pattern held 
williamr@2
  1699
in another bitmap.
williamr@2
  1700
williamr@2
  1701
AddPoints() must be called to specify the polygon to be filled. Objects of 
williamr@2
  1702
this class can be passed to a graphics accelerator's Operation() function 
williamr@2
  1703
either individually, or in a buffer.
williamr@2
  1704
williamr@2
  1705
@see TGraphicsAcceleratorCaps::iPolygon 
williamr@2
  1706
@see TGopFillPattern
williamr@2
  1707
@publishedAll
williamr@2
  1708
@released
williamr@2
  1709
*/
williamr@2
  1710
class TGopFilledPolygonWithPattern : public TGraphicsOperation
williamr@2
  1711
	{
williamr@2
  1712
public:
williamr@2
  1713
	/** Constructor with a fill pattern and a fill rule. The number of points is initialised 
williamr@2
  1714
	to zero.
williamr@2
  1715
 	
williamr@2
  1716
	@param aPattern The fill pattern.
williamr@2
  1717
	@param aFillRule Bit flags for how self-crossing polygons are filled. */
williamr@2
  1718
	inline TGopFilledPolygonWithPattern(TGopFillPattern aPattern, CGraphicsContext::TFillRule aFillRule)
williamr@2
  1719
		: TGraphicsOperation(EFilledPolygonWithPattern,sizeof(*this)), iPattern(aPattern), iFillRule(aFillRule), iNumPoints(0) {}
williamr@2
  1720
	inline void AddPoints(TInt aNumPoints, TPoint* aPoints);
williamr@2
  1721
public:
williamr@2
  1722
	
williamr@2
  1723
	/** The pattern of bitmaps that is used to fill the polygon. */
williamr@2
  1724
	TGopFillPattern				iPattern;
williamr@2
  1725
	
williamr@2
  1726
	/** Bit flags for how self-crossing polygons are filled.
williamr@2
  1727
	
williamr@2
  1728
	@see CGraphicsContext::TFillRule */
williamr@2
  1729
	CGraphicsContext::TFillRule iFillRule;
williamr@2
  1730
	
williamr@2
  1731
	/** The number of points in the polygon. */
williamr@2
  1732
	TInt						iNumPoints;
williamr@2
  1733
	};
williamr@2
  1734
williamr@2
  1735
/** Specifies the polygon to be filled as a number of 2D point coordinates.
williamr@2
  1736
williamr@2
  1737
AddPoints() should only be called once the TGopFilledPolygonWithPattern object has been stored
williamr@2
  1738
into a buffer.  There must be enough room in the buffer after the TGopFilledPolygonWithPattern
williamr@2
  1739
object to hold aNumPoints TPoint sized structures.  This is because the points are
williamr@2
  1740
copied into the memory space directly following the TGopFilledPolygonWithPattern object.
williamr@2
  1741
williamr@2
  1742
@param aNumPoints The number of points in the polygon.
williamr@2
  1743
@param aPoints Pointer to the first point in the polygon. */
williamr@2
  1744
inline void TGopFilledPolygonWithPattern::AddPoints(TInt aNumPoints, TPoint* aPoints)
williamr@2
  1745
	{ Append(aNumPoints*sizeof(TPoint),aPoints); iNumPoints += aNumPoints; }
williamr@2
  1746
williamr@2
  1747
williamr@2
  1748
williamr@2
  1749
#endif