00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #ifndef __ICLEXAMPLE_H__
00024 #define __ICLEXAMPLE_H__
00025
00026
00027 #include <bitmaptransforms.h>
00028 #include <iclexifimageframe.h>
00029 #include <exifutility.h>
00030 #include <e32cons.h>
00031
00032
00033
00034 const TInt KFirstFrame = 0;
00035
00036
00037 _LIT(KBitmapFile,"\\ICLExample\\smiley.bmp");
00038 _LIT(KThumbFile,"\\ICLExample\\thumbimage.jpg");
00039 _LIT(KYuvBitmap,"\\ICLExample\\yuvimage.jpg");
00040 _LIT(KYuvDestBitmap,"\\ICLExample\\yuvdestimage.jpg");
00041 _LIT(KDestStreamFile,"\\ICLExample\\encodedstreamimage.jpg");
00042 _LIT(KDestRotateFile,"\\ICLExample\\encodedrotateimage.jpg");
00043 _LIT(KMultiFrameClock,"\\ICLExample\\clock.gif");
00044 _LIT(KBitmapComment,"\\ICLExample\\am475.gif");
00045 _LIT(KBitmapFrameComment,"\\ICLExample\\comment.jpg");
00046 _LIT(KBitmapExif,"\\ICLExample\\exifencode.jpg");
00047 _LIT(KSourceBitmap,"\\ICLExample\\source.mbm");
00048 _LIT(KBitmapRotateWhileEncodeToJpeg,"\\ICLExample\\sourcerotate.mbm");
00049 _LIT(KTestFileName1, "\\ICLExample\\harbourbridge1.jpg");
00050 _LIT(KTestFileName2, "\\ICLExample\\harbourbridge2.jpg");
00051 _LIT(KTestFileName3, "\\ICLExample\\harbourbridge3.jpg");
00052 _LIT(KTestFileName4, "\\ICLExample\\harbourbridge4.jpg");
00053 _LIT(KTestBSOutputFileName, "\\ICLExample\\harbourbridgepanorama.jpg");
00054 _LIT(KTestVFTOutputFileName, "\\ICLExample\\harbourbridgepanoramavt.jpg");
00055 _LIT(KVFTTestFileName1, "\\ICLExample\\office1.jpg");
00056 _LIT(KVFTTestFileName2, "\\ICLExample\\office2.jpg");
00057 _LIT(KVFTTestFileName3, "\\ICLExample\\office3.jpg");
00058 _LIT(KVFTTestFileName4, "\\ICLExample\\office4.jpg");
00059 _LIT(KVFTTestFileName5, "\\ICLExample\\office5.jpg");
00060 _LIT(KVFTTestFileName6, "\\ICLExample\\office6.jpg");
00061 _LIT(KVFTTestRefFileName, "\\ICLExample\\office.mbm");
00062 _LIT(KInputFileName,"c:\\ICLExample\\input_image.jpg");
00063 _LIT(KInputFileName01,"c:\\ICLExample\\input_image01.jpg");
00064 _LIT(KInputFileName02,"c:\\ICLExample\\input_image02.jpg");
00065 _LIT(KInputFileName03,"c:\\ICLExample\\input_image03.jpg");
00066 _LIT(KInputFileName04,"c:\\ICLExample\\input_image04.jpg");
00067 _LIT(KInputOverlayFileName,"c:\\ICLExample\\overlay.png");
00068 _LIT(KInputWithSpmoFileName,"c:\\ICLExample\\input_image_with_spmo.jpg");
00069 _LIT(KOutputFileName, "c:\\ICLExample\\output_image.jpg");
00070 _LIT(KOutputWithBasicEffectFileName, "c:\\ICLExample\\output_image_with_basiceffect.jpg");
00071 _LIT(KOutputWithUndoFileName, "c:\\ICLExample\\output_image_with_undo.jpg");
00072 _LIT(KOutputWithOverlayFileName,"c:\\ICLExample\\output_image_with_overlay.jpg");
00073 _LIT(KOutputBitmapFileName,"c:\\ICLExample\\output_bitmap.mbm");
00074 _LIT(KOutputBitmapFileName01,"c:\\ICLExample\\output_bitmap01.mbm");
00075 _LIT(KOutputBitmapFileName02,"c:\\ICLExample\\output_bitmap02.mbm");
00076 _LIT(KOutputBitmapFileName03,"c:\\ICLExample\\output_bitmap03.mbm");
00077 _LIT(KOutputBitmapFileName04,"c:\\ICLExample\\output_bitmap04.mbm");
00078 _LIT(KOutputWithSpmoFileName,"c:\\ICLExample\\output_image_with_spmo.jpg");
00079 _LIT(KSpmoFileName, "c:\\ICLExample\\spmo.bin");
00080 _LIT(KSourceJpgCapstest,"\\ICLExample\\capstest.jpg");
00081 _LIT(KSourceJpgDatetree,"\\ICLExample\\datetree.jpg");
00082 _LIT(KSourceJpgOverlay,"\\ICLExample\\overlay.jpg");
00083 _LIT(KSourcePngOverlay,"\\ICLExample\\overlay.png");
00084 _LIT(KSourceMbmOverlay,"\\ICLExample\\mbm32bpp_1.mbm");
00085 _LIT(KSqueezeDestJpgDatetreeFileToFile,"\\ICLExample\\dest_datetreefiletofile.jpg");
00086 _LIT(KSqueezeDestJpgDatetreeBufferToBuffer,"\\ICLExample\\dest_datetreebufffertobuffer.jpg");
00087 _LIT(KAutoSqueezeDestJpgCapstest,"\\ICLExample\\dest_capstestautosqueze.jpg");
00088 _LIT(KRotate90DestJpgCapstest, "\\ICLExample\\dest_capstestrotate90.jpg");
00089 _LIT(KOverlayDestPngFileToFile, "\\ICLExample\\dest_overlayfile_filetofile.jpg");
00090 _LIT(KOverlayDestJpgDataFileToFile, "\\ICLExample\\dest_overlaydata_filetofile.jpg");
00091 _LIT(KOverlayDestBitmapFileToFile,"\\ICLExample\\dest_overlaybitmap_filetofile.jpg");
00092
00093 _LIT(KTitle, "ICL Example" );
00094 _LIT(KWelcomeMessage,"\n Welcome to ICL Example\n");
00095 _LIT(KPressAKeyMsg, "\nPress any key to step through the example\n");
00096 _LIT(KExitMsg, "\nPress any key to exit the application ");
00097 _LIT(KPressAKey, "\nPress any key to continue\n");
00098 _LIT(KFailed, "\nFailed to complete");
00099
00100 _LIT(KDecode, "\n Decoding Bitmap");
00101 _LIT(KDecodeFromDescriptorToBitmap, "\nDecode descriptor to bitmap\n");
00102 _LIT(KDecodeFromDescriptorAndFile, "\nFile %S successfully decoded from descriptor and file\n");
00103 _LIT(KDecodeToHalfFourthAndEighthSizedBmp, "\nFile %S successfully decoded to half, fourth and eighth sized bitmap using reduction factor and reduced size\n");
00104 _LIT(KSeparateThreadAndCancelAndContinueConvert, "\nFile %S successfully decoded using separate thread and Continue convert\n");
00105 _LIT(KDecodeUsingImageMask, "\nDecode using image mask\n");
00106 _LIT(KDecodeToYuv, "\nFile %S successfully decoded to image frame Yuv\n");
00107 _LIT(KStreamYuv, "\nFile %S successfully block stream decoded to image frame Yuv and block stream encoded to Jpeg file\n");
00108 _LIT(KDecodeUsingSepThread, "\nDecode using separate thread\n");
00109 _LIT(KAccessThumbnailToDecode, "\nJPEG thumbnail access\n");
00110 _LIT(KAccessExifMetadata, "\nAccess Exif metadata\n");
00111 _LIT(KDisplayingImageComments, "\nDecode and display image comments\n");
00112 _LIT(KGettingMimeTypeOfSourceDescriptor, "\nGet the MIME type of a source image descriptor, and load a decoder using a MIME type\n");
00113 _LIT(KRChunk, "aRChunkICL");
00114 _LIT(KAccessExifThumbnailAndDecodeThumbnail, "\nEXIF And JPEG thumbnail accessed and thumbnail part of file %S decoded successfully\n");
00115 _LIT(KImageMaskAndMultiFrameImageDecode, "\nFile %S successfully decoded using image mask and Multiframe image \n");
00116 _LIT(KImageAndFrameComment, "\nImage comment and frame comment accessed successfully\n");
00117 _LIT(KGettingMimeTypeFromSourceAndFile, "\nFile %S decoded successfully after getting the MIME type from source image\n");
00118
00119 _LIT(KEncode, "\n Encoding Bitmap");
00120 _LIT(KFileEncode, "\nFile %S encoded successfully to descriptor\n");
00121 _LIT(KEncodeImageWithThumbnail, "\nEncode a JPEG thumbnail of an image\n");
00122 _LIT(KAccessToThumbnailAndExifSetting,"\nThumbnail access and setting Exif metadata to image successful\n");
00123 _LIT(KFileRotate, "\nBitmap rotated successfully\n");
00124 _LIT(KEncodeRotate, "\nBitmap encoded to file %S with rotation operation successful\n");
00125 _LIT(KScaleBitmap, "\nBitmap scaled successfully including optional selection of low memory and quality algorithms\n");
00126 _LIT(KSetSourceDestinationandResize, "\nResize using CImageTransform\n");
00127 _LIT(KFileRotateAfterDecode, "\nFile %S rotated successfully after being decoded\n");
00128 _LIT(KSetSourceAndDestinationAndResize, "\nSetting source and destination and resize and preserve image data successful\n");
00129 _LIT8(KExifMetadata, "Smiley bitmap");
00130 _LIT8(KBuf8ParamWriteVersion, "Add Exif data");
00131 _LIT(KExifAndThumbnailAdded, "\nAdding thumbnail and Exif metadata successful\n");
00132 _LIT(KAddThumbnailToJpegFile, "\nAdd thumbnail to JPEG file\n");
00133 _LIT(KPluginLoadedSpecificToUID, "\nPlugin loaded according to specific uid\n");
00134 _LIT(KScaledWithWithoutAndThresholdScaling, "\nScaling with and without mask and threshold scaling successful\n");
00135
00136 _LIT(KPanoramaStitching, "\nPanorama stitching\n");
00137 _LIT(KBPStitching, "\nBasic panorama stitching\n");
00138 _LIT(KVFTStitching, "\nView Finder Image Tracking\n");
00139 _LIT(KGeneratingSpmo, "\n Generating Spmo");
00140 _LIT(KGeneratingSpmoIteratively, "\n Generating Spmo iteratively\n");
00141 _LIT(KBasicImageProcessing, "\n Basic image processing\n");
00142 _LIT(KBasicEffectImageProcessing, "\n Image processing with basic effects applied\n");
00143 _LIT(KEffectImageProcessingWithUndo, "\n Image processing with undo\n");
00144 _LIT(KEffectImageProcessingWithPreview, "\n Image processing with preview\n");
00145 _LIT(KEffectImageProcessingWithOverlay, "\n Image processing with overlay\n");
00146 _LIT(KImageProcessingWithSpmo, "\n Image processing with Spmo\n");
00147
00148 _LIT(KImageTransform, "\n Image Transform Functions");
00149 _LIT(KSqueezeFileToFile, "\nSqueezing Jpg File to a Jpg File");
00150 _LIT(KSqueezeBufferToBuffer, "\nSqueezing Jpg in Buffer to a Jpg in Buffer");
00151 _LIT(KAutoSqueezeFileToFile, "\nAuto-Squeezing Jpg File to a Jpg File");
00152
00153 _LIT(KRotateFileToFile, "\nRotating a Jpg File to a Jpg File");
00154
00155 _LIT(KOverlayJpgDataFileToFile, "\nOverlay Jpg data to a Jpg File to a Jpg File");
00156 _LIT(KOverlayPngFileToFile, "\nOverlay Png file to a Jpg File to a Jpg File");
00157 _LIT(KOverlayBmpDataFileToFile, "\nOverlay Bmp data to a Jpg File to a Jpg File");
00158
00159 class CActiveListener;
00160
00179 typedef struct
00180 {
00181 TBool iClip;
00182 TBool iRotate90;
00183 TBool iMirrorVerticalAxis;
00184 TInt iScalingCoeff;
00185 const TText* iOutputFile;
00186 }
00187 TDecodeParams;
00188
00189 class CIclExample: public CBase
00190 {
00191 public:
00192 static CIclExample* NewLC();
00193
00194 ~CIclExample();
00195 CActiveListener* CreateAndInitializeActiveListenerLC();
00196 void DecodeFromDescriptorToBitmapL(const TDesC& aFileName);
00197 void DecodeFromFileToBitmapL(const TDesC& aFilename);
00198 void DecodeToYuvFrameL(const TDesC& aFileName);
00199 void AccessThumbnailToDecodeL(const TDesC& aFileName);
00200 void AccessExifMetadataL(const TDesC& aFileName);
00201 void DecodeUsingSepThreadL(const TDesC& aFileName);
00202 void DecodeToHalfFourthAndEighthSizedBitmapL(const TDesC& aFileName);
00203 void DecodeUsingImageMaskL(const TDesC& aFileName);
00204 void MultiFrameImageDecodeL(const TDesC& aFileName);
00205 void DecodeTheThumbnailL(const TDesC& aFileName);
00206 void DecodeUsingContinueConvertL(const TDesC& aFileName);
00207 void DisplayingImageCommentsL(const TDesC& aFileName);
00208 void DisplayingFrameCommentsL(const TDesC& aFileName);
00209 void GettingMimeTypeOfSourceDescriptorL(const TDesC& aFileName);
00210 void GettingMimeTypeOfSourceFileL(const TDesC& aFileName);
00211 void EncodeBitmapToDescriptorL(const TDesC& aFileName);
00212 void EncodeImageWithThumbnailL(const TDesC& aFileName);
00213 void SettingExifMetadataL(const TDesC& aFileName);
00214 void RotateBitmapL(const TDesC& aFileName);
00215 void ScaleBitmapL(const TDesC& aFileName);
00216 void DecodeWithRotateL(const TDesC& aFileName);
00217 void SetSourceDestinationandResizeL(const TDesC& aFileName);
00218 void SettingWithUseOfPreserveImageDataL(const TDesC& aFileName1,const TDesC& aFileName2);
00219 void AddThumbnailToJpegFileL(const TDesC& aSrcFileName, const TDesC& aDesFileName );
00220 void AddExifDataToJpegFileL(const TDesC& aFileName);
00221 void LoadPluginByUidL(const TDesC& aFilename, TUid aCodecUid);
00222 void BlockStreamDecodeAndEncodeYuvFrameL(const TDesC& aSrcFileName, const TDesC& aDestFileName);
00223 void EncodeBitmapToFileUsingOperationExtensionL(const TDesC& aSrcFileName, const TDesC& aDestFileName);
00224
00225 void ClipAndRotateDuringDecodeL();
00226
00227
00228 void BasicPanoramaStitchingL();
00229 void ViewFinderImageTrackingL();
00230
00231 void GeneratingSpmoL();
00232 void GeneratingSpmoIterativelyL();
00233
00234
00235 void BasicImageProcessingL();
00236 void BasicEffectImageProcessingL();
00237 void EffectImageProcessingWithUndoL();
00238 void EffectImageProcessingWithPreviewL();
00239 void EffectImageProcessingWithOverlayL();
00240 void ImageProcessingWithSpmoL();
00241
00242
00243 void SqueezeJpgFileToFileL(const TDesC& aSrcFileName, const TDesC& aDestFileName);
00244 void SqueezeJpgBufferToBufferL(const TDesC& aSrcFileName, const TDesC& aDestFileName);
00245 void AutoSqueezeJpgFileToFileL(const TDesC& aSrcFileName, const TDesC& aDestFileName);
00246
00247 void RotateJpgFileToFileL(const TDesC& aSrcFileName, const TDesC& aDestFileName);
00248
00249 void OverlayJpgDataToJpgFileToFileL(const TDesC& aSrcFileName, const TDesC& aOverlayFileName, const TDesC& aDestFileName);
00250 void OverlayPngFileToJpgFileToFileL(const TDesC& aSrcFileName, const TDesC& aOverlayFileName, const TDesC& aDestFileName);
00251 void OverlayBmpDataToJpgFileToFileL(const TDesC& aSrcFileName, const TDesC& aOverlayFileName, const TDesC& aDestFileName);
00252
00253 public:
00254 inline void SetConsole(CConsoleBase* aConsole);
00255
00256
00257 private:
00258 CIclExample();
00259 void ConstructL();
00260
00261 TPtr8 LoadImageIntoMemoryLC(const TDesC& aFileName);
00262
00263 private:
00264
00265 RFs iFs;
00266 CConsoleBase* iConsole;
00267 };
00268
00269 inline void CIclExample::SetConsole(CConsoleBase* aConsole)
00270 {
00271 iConsole = aConsole;
00272 }
00273
00278 class CActiveListener : public CActive
00279 {
00280 public:
00281 static CActiveListener* NewLC();
00282 ~CActiveListener();
00283
00284 void Initialize();
00285 TBool IsRequestCancelled();
00286
00287 private:
00288 CActiveListener();
00289
00290 virtual void RunL();
00291 virtual void DoCancel();
00292 };
00293
00294 #endif //__ICLEXAMPLE_H__
00295