IEBgps/inc/IEImageDecoder.h
changeset 3 93fff7023be8
equal deleted inserted replaced
2:e1e28b0273b0 3:93fff7023be8
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors: Juha Kauppinen, Mika Hokkanen
       
    13 * 
       
    14 * Description: Photo Browser
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __IEIMAGEDECODER_H__
       
    19 #define __IEIMAGEDECODER_H__
       
    20 
       
    21 // Include files
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include <fbs.h>
       
    25 #include <ImageConversion.h>
       
    26 #include <IclExtJpegApi.h>
       
    27 
       
    28 class MDecodingObserver
       
    29 {
       
    30 public:
       
    31 	//virtual void YuvImageReady(TInt aError) = 0;
       
    32 	virtual void BitmapReady(TInt aError) = 0;
       
    33 };
       
    34 
       
    35 // Forward class declarations
       
    36 
       
    37 // Class declaration
       
    38 class CIEImageDecoder : CActive
       
    39 {
       
    40 public:
       
    41 	static CIEImageDecoder* NewL(RFs& aFileServer, MDecodingObserver& aObserver);
       
    42 	~CIEImageDecoder();
       
    43 
       
    44 private:
       
    45 	void ConstructL();
       
    46 	CIEImageDecoder(RFs& aFileServer, MDecodingObserver& aObserver);
       
    47 	
       
    48 public: // From CAtive
       
    49 	void RunL()	;
       
    50 	void DoCancel();
       
    51 	
       
    52 public:
       
    53 	void GetImageSizeL(const TFileName aFileName, TSize& aSize);
       
    54 	void ConvertJpeg2YuvL(const TDesC& aSourceFile, 
       
    55 					HBufC8& aBuffer);
       
    56 	
       
    57 	void ConvertJpeg2BitmapL(CFbsBitmap& aDestBitmap, TDesC8& aSourceData);
       
    58 	
       
    59 	TPtr8 GetVisualFrame();
       
    60 	
       
    61 	void CancelDecoding();
       
    62 	
       
    63 private: // Data
       
    64 	RFs& iFileServer;
       
    65 	MDecodingObserver& iObserver;
       
    66 	CImageDecoder* iImageDecoder;
       
    67 	CExtJpegDecoder* iExtImageDecoder;
       
    68 	CVisualFrame* iVisualFrame;
       
    69 	TBool iDecoderBusy;
       
    70 	TBool iDecode2Yuv;
       
    71 	TBool iDecode2Bitmap;
       
    72 	TPtr8 iSrcPtr;
       
    73 	
       
    74 	TUint8* iBufU;
       
    75 	TInt iNumOfBitmaps;
       
    76 };
       
    77 
       
    78 #endif // __IEIMAGEDECODER_H__