some confusions using CImageEncoder
| Sun, 2007-11-18 13:19 | |
|
Hi, I am using the following code TJpegImageData* imageData=new(ELeave)TJpegImageData; void CSmsEncoder::EncodeImageToFile(CFbsBitmap& aBitmap, RFile* aDestFile) where #define KDirPictures PathInfo::ImagesPath() _LIT (KFileName2,"Smpp.jpg"); RFS is the server session:-- which I get by CCoeEnv::Static()->FsSession() CFBsBitmap aBitmap---> is the bitmap image taken from camera I am confused what is the purpose of |
|






Forum posts: 1142
I have never used this class, but from its name and its usage, it seems the purpose is to define what color sampling and quality setting to use when encoding the jpeg.
A quick check in the header file where it is defined confirms this (found it using a search-in-all-files)
The CFrameImageData is just a generic container for the jpeg-specific "TJpegImageData". (ImageEncoder supports several different format as you probably know)
/** @publishedAll @released JPEG specific image data variant which holds color sampling and quality factor information. It can be used with both the JPEG decoder and encoder. */ class TJpegImageData : public TImageDataBlock { public: /** Flag reflecting the color sampling type. */ enum TColorSampling { /** Monochrome. */ EMonochrome, /** Horizontal and vertical chrominance decimation. */ EColor420, /** Horizontal chrominance decimation. */ EColor422, /** No chrominance decimation. */ EColor444 }; public: IMPORT_C TJpegImageData(); // Defaults to EColor420 and 75 public: /** @see enum TColorSampling The color sampling scheme to use. */ TColorSampling iSampleScheme; /** The quality factor. This represents the current allowable percentage level of degradation when compressing the image data. The range is 0 to 100 inclusive. */ TInt iQualityFactor; private: TImageDataBlock* DuplicateL(CFrameImageData& aFrameImageData) const; };