diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-63CBD66E-9E92-51EB-8709-9DE6F2808DC8-GENID-1-6-1-17-1-1-4-1-7-1.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-63CBD66E-9E92-51EB-8709-9DE6F2808DC8-GENID-1-6-1-17-1-1-4-1-7-1.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,137 @@ + + + + + +ICLExample: +Decoding/Encoding an image using the Image Conversion Library +

This example application demonstrates how to convert still images, stored +in files or descriptors, to and from bitmap objects using the Image Conversion +Library (ICL) API. It is located in the folder examples\Multimedia\ICL\ICLExample.

+

The overview contains the following sections:

+ +
Description

The +example application demonstrates how to encode, decode, rotate and scale an +image using the plug-ins provided by ICL. It covers the following scenarios:

    +
  • Decoding an image format +from a descriptor or a file

  • +
  • Encoding an image format +into a descriptor

  • +
  • Rotating a bitmap

  • +
  • Scaling a bitmap with +or without a mask.

  • +
  • Stiching images together +to form a panorama

  • +
  • Various image processing +techniques

  • +
  • Various image transformation +techniques

  • +
  • Working with Scalado +SpeedView objects(Spmo) inside an image

  • +

Note: An ECom session is started internally by the ICL framework, +as it uses the ECom framework. The session is ended by calling the REComSession::FinalClose() function.

Decoding +an image format from a descriptor or a file

The application creates +and initialises a decoder (CImageDecoder) object to decode +either from a descriptor or a file to a bitmap. It uses the CImageDecoder::DataNewL() and CImageDecoder::FileNewL() functions to specify the descriptor and file image sources respectively. +After the source is specified, the application creates a bitmap (CFbsBitmap) +object to store the decoded image. Finally, the CImageDecoder::Convert() function +is called to start decoding process.

Apart from decoding an image +from a file or a descriptor to a bitmap, the example application also demonstrates +the following:

    +
  • decoding a JPEG image +to a YUV format image frame using a CJPEGImageFrameDecoder object. +Before starting the decoding process by calling the CJPEGImageFrameDecoder::ConvertFrame() function, +the CJPEGImageFrameDecoder::RecommendedBufferSize() function +is called to find out whether the image supports YUV format or not.

  • +
  • accessing the thumbnail +and Exif (Exchangeable Image File Format) metadata of a JPEG image using a CJPEGExifDecoder object

  • +
  • decoding a JPEG image +thumbnail to a bitmap

  • +
  • decoding an image to +bitmaps of different sizes using the CImageDecoder::ReductionFactor() and CImageDecoder::ReducedSize() functions

  • +
  • decoding an image in +a separate thread using the CImageDecoder::EOptionAlwaysThread option

  • +
  • decoding a multi-frame +GIF image to bitmap

  • +
  • decoding a GIF image +to a bitmap with a mask

  • +
  • displaying comments +attached to the image and its frames, using the CImageDecoder::ImageCommentL() and CImageDecoder::FrameCommentL() functions.

  • +

Encoding an image format into a descriptor

The application +creates and initialises an encoder (CImageEncoder) object +to encode the bitmap to a descriptor. It uses the CImageEncoder::DataNewL() function +to specify the descriptor to be used to store the encoded image. The application +creates a bitmap (CFbsBitmap) object to represent the source +bitmap. Finally, the CImageEncoder::Convert() function +is called to start the encoding process.

Apart from encoding a bitmap +to a descriptor, the example application also demonstrates the following:

    +
  • accessing the thumbnail +and setting Exif metadata using CJPEGExifEncoder and MExifMetadataWriter objects

  • +
  • resizing an image and +preserving image data using an object of the CImageTransform class

  • +
  • adding a thumbnail and +Exif metadata to a JPEG image using CImageTransform, CJPEGExifEncoder and MExifMetadataWriter objects.

  • +

Rotating a bitmap

The example application rotates +a bitmap using an object of the CBitmapRotator class.

Scaling +a bitmap with and without a mask

The example application scales +a bitmap using an object of the CBitmapScaler class.

Basic +panorama stitching

The example application stitches the individual +images into a panorama image, It uses an object of the CImagePanorama class +for doing this.

Panorama stitching based on viewfinder tracking

The +example application stitches the images together to form panorama based on +viewfinder tracking. It uses an object of the CVFTracker class +for doing this.

Basic image processing

The example +application demonstrates how to scale an image and re-encode at a specific +quality. It uses the CImgProcessorObserverStub and CImgProcessor classes +for doing this.

Image processing with some basic effects

The +example demonstrates how to crop an image, apply effects and geometrical operations +to it and re-encode the image to a specific size and quality. It uses a class TGeometricalOperation in +addition to the above mentioned classes.

Generating Scalado SpeedView +objects (Spmo)

The example generates the Spmo objects and adds +them to an image file

Removing effects from the images

The +example application removes the effects applied tpo an image. It uses the +class TEffectRotation in addition to the basic image processor +classes.

Adding effects to the images and generating a preview

Effects +are added to the images and a preview of images is generated . It uses TEffect and TPreview classes +in addition to the above mentioned basic image processing classes.

Adding +effects to the images and generating an overlay

The example demonstrates +overlay of a PNG image on a JPEG image. The overlay can be re-sized and repositioned +through a preview before encoding it into the image. It uses TOverlay class +in addition to the above mentioned classes.

Adding a SpeedView +object to the image

The example adds a SpeedView object to an +image which has been processed. It uses TCapsImageProcessorExtension class +in additioned to the above mentioned classes

Squeeze an image from +a file to a file

The example squeezes an image from a file to +file. It uses CImageTransform andCSqueezeTransformExtension for +doing this.

Squeeze an image from buffer to buffer

The +example squeezes an image from a buffer to a buffer.

Auto squeeze +an image from file to file

The example auto squeezes an image +from file to file

Rotate an image from file to file

The +example rotates an image from file to file.

Blend a jpg data in +file to a file and squeeze it

The example generates an overlay +of an image on another image and also squeezes the resultant image from a +file to file.

Note: The application uses an object of the TFrameInfo class +to store image header information, such as, image size, dimension of the frame, +colour depth and so on.

+
Download

Click +on the following link to download the example: ICLExample.zip file

Click: browse to view the example code.

+
Class summary

CImageDecoder CImageEncoder CBitmapRotator CBitmapScaler CImageTransform CGifScaler CJPEGImageFrameDecoder CJPEGExifDecoder CJPEGExifEncoder CImagePanorama CPanoramaTransform CVFTracker CImgProcessor CImageTransform CSqueezeTransformExtension COrientationTransformExtension COverlayTransformExtension CCapsSpmo CapsSpmoUtility MExifMetadata MExifMetadataWriter TExifReaderUtility TExifWriterUtility TEffect TGeometricalOperation TEffectRotation TPreview TOverlay TCapsImageProcessorExtension

+
Build

The Symbian build process describes +how to build an application.

The IclExample builds +an executable called iclexample.exe in the standard location +(\epoc32\release\winscw\ <build_variant > for +CodeWarrior). After launching the executable, depending on the emulator you +are using, you may need to task away from the application launcher/shell screen +to view the console.

+
\ No newline at end of file