epoc32/include/icl/imageprocessor.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
//
williamr@4
    15
williamr@4
    16
#ifndef ___IMAGEPROCESSOR_H__
williamr@4
    17
#define ___IMAGEPROCESSOR_H__
williamr@4
    18
williamr@4
    19
#include <gdi.h>
williamr@4
    20
#include <fbs.h>
williamr@4
    21
williamr@4
    22
/**
williamr@4
    23
@publishedAll
williamr@4
    24
*/
williamr@4
    25
enum TImageBitmapUtilPanic
williamr@4
    26
	{
williamr@4
    27
	ECorrupt
williamr@4
    28
	};
williamr@4
    29
williamr@4
    30
/**
williamr@4
    31
@publishedAll
williamr@4
    32
@released
williamr@4
    33
williamr@4
    34
Interface to colour conversion classes for various display modes.
williamr@4
    35
Manages the mapping between RGB/Greyscale values and the index
williamr@4
    36
into the color palette for the given display mode.
williamr@4
    37
*/
williamr@4
    38
class TColorConvertor
williamr@4
    39
	{
williamr@4
    40
public:
williamr@4
    41
	IMPORT_C static	TColorConvertor* NewL(TDisplayMode aDisplayMode);
williamr@4
    42
williamr@4
    43
	/**
williamr@4
    44
	Returns the colour index corresponding to the supplied RGB value.
williamr@4
    45
	Operates in the context of the current display mode.
williamr@4
    46
williamr@4
    47
	This is a virtual function that each derived class must implement.
williamr@4
    48
williamr@4
    49
	@param  aColor
williamr@4
    50
	        The colour in RGB format.
williamr@4
    51
	
williamr@4
    52
	@return The colour index.
williamr@4
    53
	*/
williamr@4
    54
	virtual TInt ColorIndex(TRgb aColor) const = 0;
williamr@4
    55
williamr@4
    56
	/**
williamr@4
    57
	Returns the RGB value corresponding to the supplied colour index.
williamr@4
    58
	Operates in the context of the current display mode.
williamr@4
    59
williamr@4
    60
	This is a virtual function that each derived class must implement.
williamr@4
    61
williamr@4
    62
	@param  aColorIndex
williamr@4
    63
	        The colour in RGB format.
williamr@4
    64
williamr@4
    65
	@return The RGB value.
williamr@4
    66
	*/
williamr@4
    67
	virtual TRgb Color(TInt aColorIndex) const = 0;
williamr@4
    68
williamr@4
    69
	/**
williamr@4
    70
	Gets an array of colour indices from a corresponding array of RGB values.
williamr@4
    71
	Operates in the context of the current display mode.
williamr@4
    72
williamr@4
    73
	This is a virtual function that each derived class must implement.
williamr@4
    74
williamr@4
    75
	@param  aIndexBuffer
williamr@4
    76
	        A pointer to the first element in destination array.
williamr@4
    77
	@param  aColorBuffer
williamr@4
    78
	        A pointer to the first element in the source array.
williamr@4
    79
	@param  aCount
williamr@4
    80
	        The number of elements to get.
williamr@4
    81
	*/
williamr@4
    82
	virtual void ColorToIndex(TInt* aIndexBuffer,TRgb* aColorBuffer,TInt aCount) const = 0;
williamr@4
    83
williamr@4
    84
	inline static TInt RgbToMonochrome(TRgb aRgb);
williamr@4
    85
	};
williamr@4
    86
williamr@4
    87
williamr@4
    88
/**
williamr@4
    89
@publishedAll
williamr@4
    90
@released
williamr@4
    91
williamr@4
    92
Bitmap utility class.
williamr@4
    93
*/
williamr@4
    94
class TImageBitmapUtil
williamr@4
    95
	{
williamr@4
    96
public:
williamr@4
    97
	IMPORT_C TImageBitmapUtil();
williamr@4
    98
	IMPORT_C void Begin();
williamr@4
    99
	IMPORT_C TBool Begin(const TPoint& aPosition);
williamr@4
   100
	IMPORT_C void End();
williamr@4
   101
	IMPORT_C void SetBitmapL(CFbsBitmap* aBitmap);
williamr@4
   102
	IMPORT_C void SetPixel(TUint32 aPixelIndex);
williamr@4
   103
	IMPORT_C void SetPixels(TUint32* aPixelIndex,TInt aNumberOfPixels);
williamr@4
   104
	IMPORT_C TBool SetPos(const TPoint& aPosition);
williamr@4
   105
	
williamr@4
   106
private:
williamr@4
   107
	union TDataPointer
williamr@4
   108
		{
williamr@4
   109
		TUint32* iWordPos;
williamr@4
   110
		TUint8* iBytePos;
williamr@4
   111
		};
williamr@4
   112
private:
williamr@4
   113
	CFbsBitmap* iBitmap;
williamr@4
   114
	TSize iSize;
williamr@4
   115
	TPoint iPosition;
williamr@4
   116
	TDataPointer iData;
williamr@4
   117
	TDataPointer iBase;
williamr@4
   118
	TInt iBpp;
williamr@4
   119
	TInt iBppShift;
williamr@4
   120
	TInt iPixelShift;
williamr@4
   121
	TInt iPixelsPerWord;
williamr@4
   122
	TInt iBitShift;
williamr@4
   123
	TInt iScanlineWordLength;
williamr@4
   124
	TUint32 iMask;
williamr@4
   125
	TBool iWordAccess;
williamr@4
   126
	};
williamr@4
   127
williamr@4
   128
williamr@4
   129
class CImageProcessor;
williamr@4
   130
class CImageProcessorExtension;
williamr@4
   131
williamr@4
   132
/**
williamr@4
   133
@publishedAll
williamr@4
   134
@released
williamr@4
   135
williamr@4
   136
Utility class providing static factory functions for creating instances of
williamr@4
   137
CImageProcessor derived classes.
williamr@4
   138
*/
williamr@4
   139
class ImageProcessorUtility
williamr@4
   140
	{
williamr@4
   141
public:
williamr@4
   142
	IMPORT_C static TInt ReductionFactor(const TSize& aOriginalSize,const TSize& aReducedSize);
williamr@4
   143
	IMPORT_C static CImageProcessor* NewImageProcessorL(const CFbsBitmap& aBitmap,const TSize& aImageSize,TDisplayMode aImageDisplayMode, TBool aDisableErrorDiffusion);
williamr@4
   144
	IMPORT_C static CImageProcessor* NewImageProcessorL(const CFbsBitmap& aBitmap,TInt aReductionFactor,TDisplayMode aImageDisplayMode, TBool aDisableErrorDiffusion);
williamr@4
   145
	IMPORT_C static CImageProcessorExtension* NewImageProcessorExtensionL(const CFbsBitmap& aBitmap,TInt aReductionFactor,TDisplayMode aImageDisplayMode, TBool aDisableErrorDiffusion);
williamr@4
   146
	
williamr@4
   147
private:
williamr@4
   148
	TBool static UseErrorDiffuser(const TDisplayMode& aBitmapDisplayMode, const TDisplayMode& aImageDisplayMode);
williamr@4
   149
	TBool static IsMonochrome(const TDisplayMode& aBitmapDisplayMode, const TDisplayMode& aImageDisplayMode);
williamr@4
   150
	};
williamr@4
   151
williamr@4
   152
williamr@4
   153
williamr@4
   154
/**
williamr@4
   155
@publishedAll
williamr@4
   156
@released
williamr@4
   157
williamr@4
   158
Interface to image processing classes used by CImageDecoder plugins. This is not a application client API.
williamr@4
   159
*/
williamr@4
   160
class CImageProcessor : public CBase
williamr@4
   161
	{
williamr@4
   162
public:
williamr@4
   163
	// Setup
williamr@4
   164
williamr@4
   165
	/**
williamr@4
   166
	Initialises internal data structures prior to conversion.
williamr@4
   167
williamr@4
   168
	This is a virtual function that each derived class must implement.
williamr@4
   169
williamr@4
   170
	@param  aBitmap
williamr@4
   171
	        A reference to a fully constucted bitmap with the required
williamr@4
   172
	        display mode and size.
williamr@4
   173
	@param  aImageRect
williamr@4
   174
	        The region of the image to convert.
williamr@4
   175
	*/
williamr@4
   176
	virtual void PrepareL(CFbsBitmap& aBitmap,const TRect& aImageRect) = 0;
williamr@4
   177
williamr@4
   178
	/**
williamr@4
   179
	Initialises internal data structures prior to the manipulation of the specified pixel block.
williamr@4
   180
williamr@4
   181
	This overloaded version allows specification of a block size
williamr@4
   182
	for those formats which support blocked pixel data eg. JPEG
williamr@4
   183
williamr@4
   184
	This is a virtual function that each derived class must implement.
williamr@4
   185
williamr@4
   186
	@param  aBitmap
williamr@4
   187
	        A reference to a fully constucted bitmap with the required
williamr@4
   188
	        display mode and size.
williamr@4
   189
	@param  aImageRect
williamr@4
   190
	        The region of the image to convert.
williamr@4
   191
	@param  aRgbBlockSize
williamr@4
   192
	        The size of the block to use.
williamr@4
   193
	*/
williamr@4
   194
	virtual void PrepareL(CFbsBitmap& aBitmap,const TRect& aImageRect,const TSize& aRgbBlockSize) = 0;
williamr@4
   195
williamr@4
   196
	/**
williamr@4
   197
	Sets the number of pixels by which to increment the current position in
williamr@4
   198
	the Y-axis. This is used when rendering images supporting interlacing.
williamr@4
   199
	eg GIF
williamr@4
   200
williamr@4
   201
	This is a virtual function that each derived class must implement.
williamr@4
   202
williamr@4
   203
	@param  aYInc
williamr@4
   204
	        The number of pixels.
williamr@4
   205
	*/
williamr@4
   206
	virtual void SetYPosIncrement(TInt aYInc) = 0;
williamr@4
   207
williamr@4
   208
	/**
williamr@4
   209
	Sets the number times the current line should be repeated. The lines
williamr@4
   210
	are repeated in the same direction as set by SetYPosIncrement(). This
williamr@4
   211
	is used to fill blank lines when rendering interlaced images. eg GIF.
williamr@4
   212
	@param aLineRepeat The number of times the current line should be repeated
williamr@4
   213
	*/
williamr@4
   214
	virtual void SetLineRepeat(TInt aLineRepeat) = 0;
williamr@4
   215
williamr@4
   216
	/**
williamr@4
   217
	Sets the pixel padding to the value specified by aNumberOfPixels.
williamr@4
   218
williamr@4
   219
	This is a virtual function that each derived class must implement.
williamr@4
   220
williamr@4
   221
	@param  aNumberOfPixels
williamr@4
   222
	        The number of pixels to use for padding.
williamr@4
   223
	*/
williamr@4
   224
	virtual void SetPixelPadding(TInt aNumberOfPixels) = 0;
williamr@4
   225
williamr@4
   226
	// Color pixel writing
williamr@4
   227
williamr@4
   228
	/**
williamr@4
   229
	Sets the pixel at the current position to aColor.
williamr@4
   230
williamr@4
   231
	This is a virtual function that each derived class must implement.
williamr@4
   232
	
williamr@4
   233
	@post    
williamr@4
   234
	The current position is updated.
williamr@4
   235
williamr@4
   236
	@param  aColor
williamr@4
   237
	        The RGB value to set the current pixel to.
williamr@4
   238
williamr@4
   239
	@return A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   240
            otherwise EFalse.
williamr@4
   241
    */
williamr@4
   242
	virtual TBool SetPixel(TRgb aColor) = 0;
williamr@4
   243
williamr@4
   244
	/**
williamr@4
   245
	Sets aCount number of pixels to the value given by aColor, starting at
williamr@4
   246
	the current position.
williamr@4
   247
williamr@4
   248
	This is a virtual function that each derived class must implement.
williamr@4
   249
williamr@4
   250
	@post    
williamr@4
   251
	On success, the current position is updated.
williamr@4
   252
williamr@4
   253
	@param  aColor
williamr@4
   254
	        The RGB value to set the pixels to.
williamr@4
   255
	@param  aCount
williamr@4
   256
	        The number of pixels to set.
williamr@4
   257
williamr@4
   258
	@return A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   259
	        otherwise EFalse.
williamr@4
   260
	*/
williamr@4
   261
	virtual TBool SetPixelRun(TRgb aColor,TInt aCount) = 0;
williamr@4
   262
williamr@4
   263
	/**
williamr@4
   264
	Updates the bitmap with colour information from the array of colour values.
williamr@4
   265
williamr@4
   266
	Uses the array of colour values supplied by aColorBuffer, whose length
williamr@4
   267
	is specified by aBufferLength, to update successive pixels with values in the
williamr@4
   268
	buffer, starting at the current	position.
williamr@4
   269
williamr@4
   270
	This is a virtual function that each derived class must implement.
williamr@4
   271
	
williamr@4
   272
	@post   
williamr@4
   273
	The current position is updated.
williamr@4
   274
williamr@4
   275
	@param  aColorBuffer
williamr@4
   276
	        A pointer to the first element in the array.
williamr@4
   277
	@param  aBufferLength
williamr@4
   278
	        The number of elements in the array.
williamr@4
   279
williamr@4
   280
	@return A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   281
	        otherwise EFalse.
williamr@4
   282
	*/
williamr@4
   283
	virtual TBool SetPixels(TRgb* aColorBuffer,TInt aBufferLength) = 0;
williamr@4
   284
williamr@4
   285
    /**
williamr@4
   286
    Sets the current pixel block using the data supplied in aColorBuffer.
williamr@4
   287
williamr@4
   288
	Note:
williamr@4
   289
	For use with image types that support blocking of pixels eg JPEG.
williamr@4
   290
williamr@4
   291
	This is a virtual function that each derived class must implement.
williamr@4
   292
williamr@4
   293
	@param  aColorBuffer
williamr@4
   294
	        A pointer to a buffer representing a block of pixel color values.
williamr@4
   295
williamr@4
   296
	@return A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   297
	        otherwise EFalse.
williamr@4
   298
	*/
williamr@4
   299
	virtual TBool SetPixelBlock(TRgb* aColorBuffer) = 0;
williamr@4
   300
williamr@4
   301
	// Monochrome pixel writing
williamr@4
   302
williamr@4
   303
	/**
williamr@4
   304
	Sets the pixel at the current position to aGray256.
williamr@4
   305
williamr@4
   306
	This is a virtual function that each derived class must implement.
williamr@4
   307
williamr@4
   308
    @post   
williamr@4
   309
	The current position is updated.
williamr@4
   310
williamr@4
   311
	@param  aGray256
williamr@4
   312
	        The greyscale value to set the current pixel to.
williamr@4
   313
williamr@4
   314
	@return A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   315
	        otherwise EFalse.
williamr@4
   316
	*/
williamr@4
   317
	virtual TBool SetMonoPixel(TInt aGray256) = 0;
williamr@4
   318
williamr@4
   319
	/**
williamr@4
   320
	Sets the number of pixels specified by aCount to the value given by aGray256, starting at
williamr@4
   321
	the current position.
williamr@4
   322
williamr@4
   323
	This is a virtual function that each derived class must implement.
williamr@4
   324
	
williamr@4
   325
	@post   
williamr@4
   326
	The current position is updated.
williamr@4
   327
williamr@4
   328
	@param  aGray256
williamr@4
   329
	        The greyscale value to set the pixels to.
williamr@4
   330
	@param  aCount
williamr@4
   331
	        The number of pixels to set.
williamr@4
   332
williamr@4
   333
	@return A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   334
	        otherwise EFalse.
williamr@4
   335
	*/
williamr@4
   336
	virtual TBool SetMonoPixelRun(TInt aGray256,TInt aCount) = 0;
williamr@4
   337
williamr@4
   338
	/**
williamr@4
   339
	Updates the bitmap with greyscale information from the array of greyscale values.
williamr@4
   340
williamr@4
   341
	The array of values supplied by aGray256Buffer, whose length
williamr@4
   342
	is specified in aBufferLength, is used to update successive pixels with the
williamr@4
   343
	greyscales values.
williamr@4
   344
williamr@4
   345
	This is a virtual function that each derived class must implement.
williamr@4
   346
williamr@4
   347
	@post
williamr@4
   348
	The current position is updated.
williamr@4
   349
williamr@4
   350
	@param  aGray256Buffer
williamr@4
   351
	        A pointer to the first element in the array of greyscale values.
williamr@4
   352
	@param  aBufferLength
williamr@4
   353
	        The number of elements in the array.
williamr@4
   354
williamr@4
   355
	@return A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   356
	        otherwise EFalse.
williamr@4
   357
	*/
williamr@4
   358
	virtual TBool SetMonoPixels(TUint32* aGray256Buffer,TInt aBufferLength) = 0;
williamr@4
   359
williamr@4
   360
    /**
williamr@4
   361
    Sets a specified number of pixels to the specified greyscale value.
williamr@4
   362
williamr@4
   363
	For image types which support blocking of pixels eg JPEG, the current
williamr@4
   364
	pixel block is set using the data supplied in aGray256Buffer.
williamr@4
   365
williamr@4
   366
	This is a virtual function that each derived class must implement.
williamr@4
   367
williamr@4
   368
	@param  aGray256Buffer
williamr@4
   369
	        A pointer to a buffer representing a block of pixel color values.
williamr@4
   370
williamr@4
   371
	@return A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   372
	        otherwise EFalse.
williamr@4
   373
	*/
williamr@4
   374
	virtual TBool SetMonoPixelBlock(TUint32* aGray256Buffer) = 0;
williamr@4
   375
williamr@4
   376
	// Processor flow control
williamr@4
   377
williamr@4
   378
	/**
williamr@4
   379
	Sets the current position in the bitmap to aPosition.
williamr@4
   380
williamr@4
   381
	This is a virtual function that each derived class must implement.
williamr@4
   382
williamr@4
   383
	@param  aPosition
williamr@4
   384
	        A reference to TPoint object defining the position to move to.
williamr@4
   385
williamr@4
   386
	@return	A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   387
	        otherwise EFalse.
williamr@4
   388
	*/
williamr@4
   389
	virtual TBool SetPos(const TPoint& aPosition) = 0;
williamr@4
   390
williamr@4
   391
	/**
williamr@4
   392
	Commits the changes made to the current bitmap by flushing the buffer.
williamr@4
   393
williamr@4
   394
	This is a virtual function that each derived class must implement.
williamr@4
   395
williamr@4
   396
	@post
williamr@4
   397
	The current position is updated.
williamr@4
   398
williamr@4
   399
	@return	A boolean indicating if the operation was successful. ETrue if the operation succeeded, 
williamr@4
   400
	        otherwise EFalse.
williamr@4
   401
    */
williamr@4
   402
	virtual TBool FlushPixels() = 0;
williamr@4
   403
	
williamr@4
   404
private:
williamr@4
   405
	// Future proofing
williamr@4
   406
	IMPORT_C virtual void ReservedVirtual1();
williamr@4
   407
	IMPORT_C virtual void ReservedVirtual2();
williamr@4
   408
	IMPORT_C virtual void ReservedVirtual3();
williamr@4
   409
	IMPORT_C virtual void ReservedVirtual4();
williamr@4
   410
	};
williamr@4
   411
williamr@4
   412
/**
williamr@4
   413
@publishedAll
williamr@4
   414
@released
williamr@4
   415
williamr@4
   416
Flag used to determine the type of transformation which is the result of 
williamr@4
   417
single or multiple transformation operations requested via calls to
williamr@4
   418
COperationExtension::AddOperationL.
williamr@4
   419
williamr@4
   420
8 unique orientations:
williamr@4
   421
williamr@4
   422
@code
williamr@4
   423
normal  90      180     270
williamr@4
   424
00 10   01 00   11 01   10 11
williamr@4
   425
01 11   11 10   10 00   00 01
williamr@4
   426
williamr@4
   427
V flip  90      180     270
williamr@4
   428
10 00   11 10   =Hflip  =Hflip+90
williamr@4
   429
11 01   01 00
williamr@4
   430
williamr@4
   431
H flip  90      180     270
williamr@4
   432
01 11   00 01   =Vflip  =Vflip+90
williamr@4
   433
00 10   10 11
williamr@4
   434
@endcode
williamr@4
   435
williamr@4
   436
@see COperationExtension::AddOperationL
williamr@4
   437
*/
williamr@4
   438
enum TTransformOptions
williamr@4
   439
	{
williamr@4
   440
	/** Normal Decode
williamr@4
   441
	*/
williamr@4
   442
	EDecodeNormal = 0x11011000,
williamr@4
   443
williamr@4
   444
	/** Rotate 90 degrees.
williamr@4
   445
	*/
williamr@4
   446
	EDecodeRotate90	= 0x10110001,
williamr@4
   447
williamr@4
   448
	/** Rotate 180 degrees.
williamr@4
   449
	*/
williamr@4
   450
	EDecodeRotate180 = 0x00100111,
williamr@4
   451
williamr@4
   452
	/** Rotate 270 degrees.
williamr@4
   453
	*/
williamr@4
   454
	EDecodeRotate270 = 0x01001110,
williamr@4
   455
	
williamr@4
   456
	/** Horizontal flip.
williamr@4
   457
	*/
williamr@4
   458
	EDecodeHorizontalFlip = 0x10001101,
williamr@4
   459
	
williamr@4
   460
	/** Horizontal flip and rotate 90 degrees.
williamr@4
   461
	*/
williamr@4
   462
	EDecodeHorizontalFlipRotate90 = 0x11100100,
williamr@4
   463
williamr@4
   464
	/** Vertical flip.
williamr@4
   465
	*/
williamr@4
   466
	EDecodeVerticalFlip	= 0x01110010,
williamr@4
   467
williamr@4
   468
	/** Vertical flip and rotate 90 degrees.
williamr@4
   469
	*/
williamr@4
   470
	EDecodeVerticalFlipRotate90 = 0x00011011
williamr@4
   471
	};
williamr@4
   472
williamr@4
   473
williamr@4
   474
/**
williamr@4
   475
@publishedAll
williamr@4
   476
@released
williamr@4
   477
williamr@4
   478
Class that provides support for Framework Extensions.
williamr@4
   479
williamr@4
   480
@see CImageProcessor
williamr@4
   481
@see CImageReadCodec
williamr@4
   482
@see CImageDecoderPlugin
williamr@4
   483
*/
williamr@4
   484
class CImageProcessorExtension : public CImageProcessor
williamr@4
   485
	{
williamr@4
   486
public:
williamr@4
   487
	IMPORT_C virtual ~CImageProcessorExtension();
williamr@4
   488
	IMPORT_C void SetClippingRect(const TRect& aRect);
williamr@4
   489
	IMPORT_C void SetScaling(TInt aScalingCoeff);
williamr@4
   490
	IMPORT_C void SetScaling(const TSize& aDesiredSize);
williamr@4
   491
	IMPORT_C void SetOperation(TTransformOptions aOperation);
williamr@4
   492
	IMPORT_C void SetInitialScanlineSkipPadding(TInt aNumberOfScanlines);
williamr@4
   493
williamr@4
   494
protected:
williamr@4
   495
	IMPORT_C CImageProcessorExtension();
williamr@4
   496
williamr@4
   497
protected:
williamr@4
   498
	/** Clipping rectangle */
williamr@4
   499
	TRect iClippingRect;
williamr@4
   500
	/** Scaling coefficient */
williamr@4
   501
	TInt iScalingCoeff;
williamr@4
   502
	/** Desired size after scaling */
williamr@4
   503
	TSize iDesiredSize;
williamr@4
   504
	/** Operations to apply to image */
williamr@4
   505
	TTransformOptions iOperation;
williamr@4
   506
	/** Position in destination at which start rendering */
williamr@4
   507
	TPoint iStartPosition;
williamr@4
   508
	/** Position in destination at which rendering is complete */
williamr@4
   509
	TPoint iEndPosition;
williamr@4
   510
	/** An initial one-off number of scanlines to be skipped */
williamr@4
   511
	TInt iNumberOfScanlinesToSkip;
williamr@4
   512
	};
williamr@4
   513
   
williamr@4
   514
inline TInt TColorConvertor::RgbToMonochrome(TRgb aRgb)
williamr@4
   515
	{
williamr@4
   516
	TInt value = aRgb.Internal();
williamr@4
   517
	TInt r = value&0xFF0000;
williamr@4
   518
	TInt g = value&0xFF00;
williamr@4
   519
	value  = (value&0xFF)<<16;	// blue<<16
williamr@4
   520
	value += r<<1;     		// + (red<<16)*2
williamr@4
   521
	value += g<<(16+2-8);	// + (green<<16)*4
williamr@4
   522
	value += g<<(16+0-8);	// + (green<<16)
williamr@4
   523
	return value>>(16+3);	// total/8
williamr@4
   524
	}
williamr@4
   525
williamr@4
   526
#endif //___IMAGEPROCESSOR_H__
williamr@4
   527