IEBgps/inc/IEImageEncoder.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 __IEIMAGEENCODER_H__
       
    19 #define __IEIMAGEENCODER_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 
       
    29 // Forward class declarations
       
    30 class MEncodingObserver
       
    31 {
       
    32 public:
       
    33 	//virtual void JpegImageReady(TInt aError) = 0;
       
    34 };
       
    35 
       
    36 
       
    37 // Class declaration
       
    38 class CIEImageEncoder : CActive
       
    39 {
       
    40 public:
       
    41 	static CIEImageEncoder* NewL(RFs& aFileServer, MEncodingObserver& aObserver);
       
    42 	~CIEImageEncoder();
       
    43 
       
    44 private:
       
    45 	void ConstructL();
       
    46 	CIEImageEncoder(RFs& aFileServer, MEncodingObserver& aObserver);
       
    47 	
       
    48 public:
       
    49 	void ConvertYuv2JpegL(HBufC8*& aDestBuffer, 
       
    50 					HBufC8& aSourceBuffer, 
       
    51 					const TSize aSize);
       
    52 	
       
    53 	void ConvertYuv2JpegL(TDesC& aFileName, 
       
    54 					HBufC8& aSourceBuffer, 
       
    55 					const TSize aSize);
       
    56 
       
    57 	void CancelEncoding();
       
    58 	
       
    59 private:	
       
    60 	void SetJpegImageDataL();
       
    61 	
       
    62 public: // From CAtive
       
    63 	void RunL()	;
       
    64 	void DoCancel();
       
    65 	
       
    66 private: // Data
       
    67 	RFs& iFileServer;
       
    68 	MEncodingObserver& iObserver;
       
    69 	
       
    70 	CImageEncoder* iImageEncoder;
       
    71 	CExtJpegEncoder* iExtImageEncoder;
       
    72 	
       
    73 	CVisualFrame* iVisualFrame;
       
    74 	
       
    75 	CFrameImageData* iFrameImageData;
       
    76 		
       
    77 	TBool iEncoderBusy;
       
    78 };
       
    79 
       
    80 #endif // __IEIMAGEENCODER_H__