epoc32/include/icl/imagecodecdata.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
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     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
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // ImageCodecData.h - data used by standard codecs
    15 // 
    16 //
    17 
    18 /**
    19 @file
    20 @publishedAll
    21 @released
    22 */
    23 
    24 
    25 #ifndef __IMAGECODECDATA_H__
    26 #define __IMAGECODECDATA_H__
    27 
    28 #include <gdi.h>
    29 #include <ezcompressor.h>
    30 #include <icl/imagedata.h>
    31 
    32 class CFrameImageData;
    33 
    34 
    35 // Identification UIDs for TFrameDataBlock-derived classes
    36 
    37 /** GIF image descriptor.
    38 */
    39 const TUid KGIFImageDescriptorUid = { 0x101F45E4 };
    40 /** GIF colour table
    41 */
    42 const TUid KGIFColorTableUid = { 0x101F7C0A };
    43 /** GIF compression type LZW information.
    44 */
    45 const TUid KGIFLZWInfoUid = { 0x101F45E5 };
    46 /** GIF image controller.
    47 */
    48 const TUid KGIFImageControlUid = { 0x101F45E6 };
    49 /** GIF loop iterations.
    50 */
    51 const TUid KGIFLoopIterationsUid = { 0x102834A6 };
    52 /** MBM decode data.
    53 */
    54 const TUid KMBMDecodeDataUid = { 0x101F45E0 };
    55 /** MBM encode data.
    56 */
    57 const TUid KMBMEncodeDataUid = { 0x101F45E9 };
    58 /** PNG encode data.
    59 */
    60 const TUid KPNGEncodeDataUid = { 0x101F460A };
    61 /** TIFF image data.
    62 */
    63 const TUid KTIFFImageDataUid = { 0x101F45E8 };
    64 
    65 
    66 
    67 //Identification UIDs for TImageDataBlock-derived classes
    68 
    69 /** BMP image data.
    70 */
    71 const TUid KBMPImageDataUid = { 0x101F45BF };
    72 /** BMP compression.
    73 */
    74 const TUid KBMPCompressionUid = { 0x101F45E3 };
    75 /** JPG image data.
    76 */
    77 const TUid KJPGImageDataUid = { 0x101F45DA };
    78 /** JPG Q table.
    79 */
    80 const TUid KJPGQTableUid = { 0x101F45E1 };
    81 /** JPG comment.
    82 */
    83 const TUid KJPGCommentUid = { 0x101F45E2 };
    84 /** GIF background colour.
    85 */
    86 const TUid KGIFBackgroundColorUid = { 0x101F45DE };
    87 /** GIF comment.
    88 */
    89 const TUid KGIFCommentUid = { 0x101F45E7 };
    90 
    91 /** Max number of GIF palatte entries
    92 */
    93 const TInt KGifColorTableMaxEntries = 256;
    94 
    95 /**
    96 @publishedAll
    97 @released
    98 
    99 BMP specific image data variant which holds bits per pixel info.
   100 It is only used when configuring the BMP encoder.
   101 If the Symbian bitmap encoder (0x101F45AE) is supplied then encoder specific defaults 
   102 are used if this object is not presented to the conversion process.
   103 The default bitmap colour depth is 24-bit.
   104 @see CImageEncoder
   105 @see CFrameImageData
   106 */
   107 class TBmpImageData : public TImageDataBlock
   108 	{
   109 public:
   110 	IMPORT_C TBmpImageData();
   111 
   112 public:
   113 	/** The number of bits/pixel.
   114 	*/
   115 	TInt iBitsPerPixel;
   116 
   117 private:
   118 	TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   119 	};
   120 
   121 /**
   122 @publishedAll
   123 @released
   124 
   125 BMP specific image data variant which holds compression info.
   126 It is only used when extracting info from the BMP decoder.
   127 */
   128 class TBmpCompression : public TImageDataBlock
   129 	{
   130 public:
   131 	IMPORT_C TBmpCompression();
   132 
   133 public:
   134 	/**
   135 	Flag reflecting the compression type.
   136 	*/
   137 	enum TCompression
   138 	{
   139 	/** No compression used.
   140 	*/
   141 	ENone,
   142 
   143 	/** Eight bits per pixel run length encoding.
   144 	*/
   145 	EEightBppRLE,
   146 
   147 	/** Four bits per pixel run length encoding.
   148 	*/
   149 	EFourBppRLE,
   150 
   151 	/** Compression using bit fields.
   152 	*/
   153 	EBitFields
   154 	};
   155 
   156 public:
   157 	/**
   158 	@see enum TCompression
   159 
   160 	The type of compression used
   161 	*/
   162 	TCompression iCompression;
   163 
   164 private:
   165 	TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   166 	};
   167 
   168 
   169 /**
   170 @publishedAll
   171 @released
   172 
   173 JPEG specific image data variant which holds color sampling and quality
   174 factor information.
   175 
   176 It can be used with both the JPEG decoder and encoder.
   177 */
   178 class TJpegImageData : public TImageDataBlock
   179 	{
   180 public:
   181 	/**
   182 	Flag reflecting the color sampling type.
   183 	*/
   184 	enum TColorSampling
   185 		{
   186 		/** Monochrome.
   187 		*/
   188 		EMonochrome,
   189 
   190 		/** Horizontal and vertical chrominance decimation.
   191 		*/
   192 		EColor420,
   193 
   194 		/** Horizontal chrominance decimation.
   195 		*/
   196 		EColor422,
   197 
   198 		/** No chrominance decimation.
   199 		*/
   200 		EColor444
   201 		};
   202 public:
   203 	IMPORT_C TJpegImageData(); // Defaults to EColor420 and 75
   204 
   205 public:
   206 	/**
   207 	@see enum TColorSampling
   208 
   209 	The color sampling scheme to use.
   210 	*/
   211 	TColorSampling iSampleScheme;
   212 
   213 	/** The quality factor. 
   214 	
   215 	This represents the current allowable percentage level of degradation when compressing the image 
   216 	data.
   217 
   218 	The range is 0 to 100 inclusive.
   219 	*/
   220 	TInt iQualityFactor; 
   221 
   222 private:
   223 	TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   224 	};
   225 
   226 /** The number of JPEG Q table entries.
   227 
   228 @see class TJpegQTable
   229 */
   230 const TInt KJpgQTableEntries = 64;
   231 
   232 /**
   233 @publishedAll
   234 @released
   235 
   236 JPEG specific image data variant which holds QTable info.
   237 
   238 It can be used with both the JPEG decoder and encoder.
   239 */
   240 class TJpegQTable : public TImageDataBlock
   241 	{
   242 public:
   243 	/**
   244 	Flag reflecting the type of Q or quantization table.
   245 	*/
   246 	enum TQTableIndex
   247 		{
   248 		/** Luminance table.
   249 		*/
   250 		ELumaTable = 0,
   251 
   252 		/** Chrominance table.
   253 		*/
   254 		EChromaTable = 1
   255 		};
   256 public:
   257 	IMPORT_C TJpegQTable();
   258 
   259 public:
   260 	/** The type of Q table. */
   261 	TInt iTableIndex;
   262 
   263 	/** The number of entries in the Q table. */
   264 	TBuf8<KJpgQTableEntries> iEntries;
   265 
   266 private:
   267 	TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   268 	};
   269 
   270 /**
   271 @publishedAll
   272 @released
   273 
   274 JPEG specific image data variant which holds JPEG comment information.
   275 
   276 It can be used with both the JPEG decoder and encoder.
   277 */
   278 class TJpegComment : public TImageDataBlock
   279 	{
   280 public:
   281 	IMPORT_C TJpegComment();
   282 
   283 public:
   284 	/** The JPEG comment associated with the JPEG image.
   285 	*/
   286 	HBufC8* iComment;
   287 
   288 private:
   289 	TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   290 	};
   291 
   292 
   293 /**
   294 @publishedAll
   295 @released
   296 
   297 GIF specific image data variant which holds background color info.
   298 
   299 It can only be used with the GIF decoder (the encoder is not configurable).
   300 */
   301 class TGifBackgroundColor : public TImageDataBlock
   302 	{
   303 public:
   304 	IMPORT_C TGifBackgroundColor();
   305 
   306 public:
   307 	/** The background colour as an index.
   308 	*/
   309 	TInt iBackgroundColorIndex;
   310 
   311 	/** The background colour as an RGB value.
   312 	*/
   313 	TRgb iBackgroundColor;
   314 
   315 private:
   316 	TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   317 	};
   318 
   319 /**
   320 GIF specific frame data variant which holds image descriptor information.
   321 
   322 It can only be used with the GIF decoder (the encoder is not configurable).
   323 
   324 @publishedAll
   325 @released
   326 */
   327 class TGifImageDescriptor : public TFrameDataBlock
   328 	{
   329 public:
   330 	IMPORT_C TGifImageDescriptor();
   331 
   332 public:
   333 	/** A boolean indicating if the frame has its own local colour map. ETrue if it does, otherwise
   334     EFalse.
   335 	*/
   336 	TBool iLocalColorMap;
   337 
   338 	/** A boolean indicating if the frame's local colour map is sorted in priority order. ETrue if
   339     it is, otherwise EFalse.
   340 	*/
   341 	TBool iSortedLocalMap;
   342 
   343 	/** A boolean indicating if the image is interlaced. ETrue if the image is interlaced.
   344 	*/
   345 	TBool iInterlaced;
   346 
   347 private:
   348 	TFrameDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   349 	};
   350 
   351 /**
   352 @publishedAll
   353 @released
   354 
   355 GIF specific frame data for saving a frame local color map (palette).
   356 */
   357 class TGifColorTable : public TFrameDataBlock
   358 	{
   359 public:
   360 	IMPORT_C TGifColorTable();
   361    
   362 public:
   363     /** The palette */
   364 	TRgb iPalette[KGifColorTableMaxEntries];
   365 
   366 private:
   367 	TFrameDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   368 	};
   369 
   370 /**
   371 @publishedAll
   372 @released
   373 
   374 GIF specific frame data variant which holds LZW compression information.
   375 
   376 It can only be used with the GIF decoder (the encoder is not configurable).
   377 */
   378 class TGifLZWInfo : public TFrameDataBlock
   379 	{
   380 public:
   381 	IMPORT_C TGifLZWInfo();
   382 
   383 public:
   384 	/** The initial number of bits used in LZW compression. 
   385 	*/
   386 	TInt iInitialCodeLength;
   387 
   388 	/** The size of compressed frame.
   389 	*/
   390 	TInt iCompressedBytes;
   391 
   392 private:
   393 	TFrameDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   394 	};
   395 
   396 /**
   397 @publishedAll
   398 @released
   399 
   400 GIF specific frame data variant which holds GIF image control information.
   401 
   402 It can only be used with the GIF decoder (the encoder is not configurable).
   403 */
   404 class TGifImageControl : public TFrameDataBlock
   405 	{
   406 public:
   407 	/**
   408 	Flag reflecting how the previous frame is handled when the next frame is drawn.
   409 	*/
   410 	enum TDisposalMethod
   411 		{
   412 		/** No method set.
   413 		*/
   414 		ENone = 0,
   415 
   416 		/** Leave the previous frame in place.
   417 		*/
   418 		ELeaveInPlace = 1,
   419 
   420 		/** Restore to the backgound colour.
   421 		*/
   422 		ERestoreToBackground = 2,
   423 
   424 		/** Restore the previous frame.
   425 		*/
   426 		ERestoreToPrevious = 3
   427 		};
   428 
   429 public:
   430 	IMPORT_C TGifImageControl();
   431 
   432 public:
   433 	/** The interval between display of successive frames in units of 1/100 second.
   434 	*/
   435 	TInt iDelayTimeInCentiseconds;
   436 
   437 	/** The colour index to be used for transparency.
   438 	*/
   439 	TInt iTransparentColorIndex;
   440 
   441 	/** A flag indicating if user input is required before display of next frame.
   442 	*/
   443 	TBool iUserInputFlag;
   444 
   445 	/** The frame disposal method for multiframe images.
   446 	*/
   447 	TDisposalMethod iDisposalMethod;
   448 
   449 private:
   450 	TFrameDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   451 	};
   452 
   453 /**
   454 @publishedAll
   455 @released
   456 
   457 GIF specific image data variant which holds GIF comment info.
   458 
   459 It can only be used with the GIF decoder (the encoder is not configurable).
   460 */
   461 class TGifComment : public TImageDataBlock
   462 	{
   463 public:
   464 	IMPORT_C TGifComment();
   465 
   466 public:
   467 	/** The comment associated with the GIF image. 
   468 	*/
   469 	HBufC8* iComment;
   470 
   471 private:
   472 	TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   473 	};
   474 
   475 /**
   476 @publishedAll
   477 @released
   478 
   479 GIF specific image data variant which holds Netscape 2.0 Application Extension block loop iterations value
   480 
   481 It can only be used with the GIF decoder (the encoder is not configurable).
   482 */
   483 class TGifLoopIterations : public TImageDataBlock
   484     {
   485 public:
   486     IMPORT_C TGifLoopIterations();
   487 
   488 public:
   489     /** The number of times to loop an animated GIF
   490     */
   491     TInt iLoopIterations;
   492 
   493 private:
   494     TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   495     };
   496 
   497 // Mbm compression data. (Decoder only)
   498 /**
   499 @publishedAll
   500 @released
   501 
   502 MBM specific frame data variant which holds frame data information.
   503 
   504 It can only be used with the MBM decoder.
   505 */
   506 class TMbmDecodeData : public TFrameDataBlock
   507 	{
   508 public:
   509 	IMPORT_C TMbmDecodeData();
   510 
   511 public:
   512 	/** A flag indicating if RLE compression is used. 
   513 	*/
   514 	TBool iCompressed;
   515 
   516 	/** The uncompressed frame size in bytes.
   517 	*/
   518 	TInt iImageDataSizeInBytes;
   519 
   520 private:
   521 	TFrameDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   522 	};
   523 
   524 
   525 // Mbm display mode. (Encoder only)
   526 /**
   527 @publishedAll
   528 @released
   529 
   530 MBM specific image data variant which holds frame data information.
   531 
   532 It can only be used with the MBM encoder.
   533 */
   534 class TMbmEncodeData : public TFrameDataBlock
   535 	{
   536 public:
   537 	IMPORT_C TMbmEncodeData();
   538 
   539 public:
   540 	/** The display mode.
   541 	*/
   542 	TDisplayMode iDisplayMode;
   543 
   544 private:
   545 	TFrameDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   546 	};
   547 
   548 
   549 /**
   550 @publishedAll
   551 @released
   552 
   553 PNG specific frame data variant which holds PNG encoding information.
   554 
   555 It can only be used with the PNG encoder.
   556 */
   557 class TPngEncodeData : public TFrameDataBlock
   558 	{
   559 public:
   560 	// Same values as CEZCompressor
   561 	/**
   562 	A flag reflecting the level of compression used.
   563 	*/
   564 	enum TPngCompressLevel
   565 		{
   566 		/**
   567 		Default level of compression used.
   568 		*/
   569 		EDefaultCompression = Z_DEFAULT_COMPRESSION,
   570 
   571 		/** No compression used.
   572 		*/
   573 		ENoCompression = Z_NO_COMPRESSION,
   574 
   575 		/** Optimise compression for speed.
   576 		*/
   577 		EBestSpeed = Z_BEST_SPEED,
   578 
   579 		/** Optimise compression for size.
   580 		*/
   581 		EBestCompression = Z_BEST_COMPRESSION
   582 		};
   583 public:
   584 	IMPORT_C TPngEncodeData();
   585 
   586 public:
   587 	/** The number of bits per pixel.
   588 	*/
   589 	TInt iBitsPerPixel;
   590 
   591 	/** A flag indicating if the image is color or grayscale.
   592 	*/
   593 	TBool iColor;
   594 
   595 	/** A flag indicating use of a palette or RGB.
   596 	*/
   597 	TBool iPaletted;
   598 
   599 	/** The level of compression to apply.
   600 	*/
   601 	TPngCompressLevel iLevel;
   602 
   603 private:
   604 	TFrameDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   605 	};
   606 
   607 /**
   608 @publishedAll
   609 @released
   610 
   611 TIFF specific frame data variant. Holds colour sampling and quality factor information.
   612 
   613 It can only be used with the TIFF decoder.
   614 */
   615 class TTiffImageData : public TFrameDataBlock
   616 	{
   617 public:
   618 	IMPORT_C TTiffImageData();
   619 
   620 public:
   621 	/** The new subfile type.
   622 	*/
   623 	TUint32				iNewSubfileType;
   624 
   625 	/** The frame size in pixels.
   626 	*/
   627 	TSize				iSizeInPixels;
   628 
   629 	/** The number of bits per sample.
   630 	*/
   631 	TInt				iBitsPerSample;
   632 
   633 	/** The number of samples per pixel.
   634 	*/
   635 	TInt				iSamplesPerPixel;
   636 
   637 	/** The compression setting.
   638 	*/
   639 	TInt				iCompression;
   640 
   641 	/** T4 options as per the "Standardization of Group 3 facsimile apparatus for document 
   642 	transmission, Recommendation T.4, Volume VII, Fascicle VII.3".
   643 	*/
   644 	TInt				iT4Options;
   645 
   646 	/** T6 options as per the "Facsimile Coding Schemes and Coding Control Functions for Group 4 
   647 	Facsimile Apparatus, Recommendation T.6, Volume VII, Fascicle VII.3".
   648 	*/
   649 	TInt				iT6Options;
   650 
   651 	/** The photometric interpretation setting.
   652 	*/
   653 	TInt				iPhotometricInterpretation;
   654 
   655 	/** The fill order.
   656 	*/
   657 	TInt				iFillOrder;
   658 
   659 	/** The frame width in twips.
   660 	*/
   661 	TReal				iWidthInTwips;
   662 
   663 	/** The frame height in twips.
   664 	*/
   665 	TReal				iHeightInTwips;
   666 
   667 	/** The number of rows per strip.
   668 	*/
   669 	TInt				iRowsPerStrip;
   670 
   671 	/** The number of TTiffImageStrips.
   672 	*/
   673 	TInt				iNumStrips;
   674 
   675 	/** An array of TTiffImageStrips.
   676 	*/
   677 	HBufC8*				iStripInfo;
   678 
   679 private:
   680 	TFrameDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const;
   681 	};
   682 
   683 // Identification UIDs for image types.
   684 
   685 /** Image type BMP.
   686 */
   687 const TUid KImageTypeBMPUid = {0x101F45B0};
   688 /** Image type GIF.
   689 */
   690 const TUid KImageTypeGIFUid = {0x101F45B3};
   691 /** Image type WMF.
   692 */
   693 const TUid KImageTypeWMFUid = {0x101F45BA};
   694 /** Image type WMF subtype Std.
   695 */
   696 const TUid KImageTypeWMFSubTypeStdUid = {0x101F45BB};
   697 /** Image type WMF subtype Apm.
   698 */
   699 const TUid KImageTypeWMFSubTypeApmUid = {0x101F45BC};
   700 /** Image type WMF subtype Clp.
   701 */
   702 const TUid KImageTypeWMFSubTypeClpUid = {0x101F45BD};
   703 /** Image type TIFF.
   704 */
   705 const TUid KImageTypeTIFFUid = {0x101F45C4};
   706 /** Image type TIFF subtype LittleEndian.
   707 */
   708 const TUid KImageTypeTIFFSubTypeLittleEndianUid = {0x101F45C5};
   709 /** Image type TIFF subtype BigEndian.
   710 */
   711 const TUid KImageTypeTIFFSubTypeBigEndianUid = {0x101F45C6};
   712 /** Image type PNG.
   713 */
   714 const TUid KImageTypePNGUid = {0x101F45C9};
   715 /** Image type MBM.
   716 */
   717 const TUid KImageTypeMBMUid = {0x101F45CC};
   718 /** Image type WBMP.
   719 */
   720 const TUid KImageTypeWBMPUid = {0x101F45CF};
   721 /** Image type OTA.
   722 */
   723 const TUid KImageTypeOTAUid = {0x101F45D2};
   724 /** Image type ICO.
   725 */
   726 const TUid KImageTypeICOUid = {0x101F45D5};
   727 /** Image type JPG.
   728 */
   729 const TUid KImageTypeJPGUid = {0x101F45D8};
   730 
   731 #endif // __IMAGECODECDATA_H__