camappengine/StillConverter/Inc/CaeStillConverter.h
branchRCL_3
changeset 34 27fe719c32e6
parent 0 9b3e960ffc8a
equal deleted inserted replaced
33:e3cdd00b5ae3 34:27fe719c32e6
       
     1 /*
       
     2 * Copyright (c) 2002 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:
       
    13 *
       
    14 * Description:  Still Image Converter base class for Camera Application Engine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CAESTILLCONVERTER_H
       
    21 #define CAESTILLCONVERTER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <imageconversion.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 const TUid KUidSpecialFreeScalingDecoder = { 0x101FF555 }; // This decoder supports free scaling
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * Still Converter class.
       
    34 * Base class for still image conversions by the Camera Application Engine.
       
    35 */
       
    36 NONSHARABLE_CLASS( CCaeStillConverter ) : public CActive
       
    37     {
       
    38     
       
    39     public: 
       
    40         
       
    41         /**
       
    42         * Destructor.
       
    43         */
       
    44         virtual ~CCaeStillConverter();
       
    45 
       
    46     protected:
       
    47 
       
    48         /**
       
    49         * Internal state.
       
    50         */
       
    51         enum 
       
    52             {
       
    53             EIdle,
       
    54             EConvert
       
    55             };
       
    56 
       
    57     protected:  // Functions from base classes
       
    58         /**
       
    59         * From CActive, handles an active object’s request completion event.
       
    60         * @return void
       
    61         */
       
    62         void RunL();
       
    63 
       
    64         /**
       
    65         * From CActive, called if CCaeStillConverter function RunL() leaves.
       
    66         * @param aError Standard Symbian OS error code
       
    67         * @return Error code KErrNone
       
    68         */
       
    69         TInt RunError( 
       
    70             TInt aError );
       
    71 
       
    72     protected:
       
    73         /**
       
    74         * C++ constructor.
       
    75         */
       
    76         CCaeStillConverter();
       
    77 
       
    78         /**
       
    79         * Symbian 2nd phase constructor that can leave.
       
    80         * This is intended to be called from derived class ConstructL().
       
    81         */
       
    82         void ConstructL();
       
    83 
       
    84     protected:
       
    85         /**
       
    86         * Returns the engine state.
       
    87         * @return Boolean indicating if Still Converter is busy
       
    88         */
       
    89         TBool IsBusy() const;
       
    90 
       
    91     protected: // To be implemented in a derived class.
       
    92         /**
       
    93         * Converts (encodes or decodes) the image.
       
    94         * @return void
       
    95         */
       
    96         virtual void ConvertL() = 0;
       
    97    
       
    98         /**
       
    99         * Perfoms necessary cleanup and delivers the result to the client.
       
   100         * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code
       
   101         * @return void
       
   102         */
       
   103         virtual void ConversionComplete( 
       
   104             TInt aError ) = 0;
       
   105 
       
   106         /** 
       
   107         * Sets the specific image codec implementation to be used in decoding and encoding.
       
   108         * @since 3.1
       
   109         * @param aCodecUid The UID of the specific image codec to be used.
       
   110         * @return void
       
   111         */
       
   112         virtual void SetImageCodecL( 
       
   113         	TUid aCodecUid ) = 0;
       
   114         	
       
   115     protected:  // Data
       
   116 
       
   117         // Class for image data.
       
   118         class CImageItem: public CBase
       
   119             {
       
   120             public:
       
   121                 CImageItem() {};
       
   122                 virtual ~CImageItem() 
       
   123                     {
       
   124                     delete iBitmap;
       
   125                     delete iImageBuffer;
       
   126                     delete iFrameImageData;
       
   127                     };
       
   128             public:
       
   129                 // Bitmap.
       
   130                 CFbsBitmap* iBitmap;
       
   131                 // Bitmap target size.
       
   132                 TSize iBitmapSize;
       
   133                 // Bitmap target size for free scaling.
       
   134                 TSize iFullyScaledBitmapSize;
       
   135                // Bitmap display mode.
       
   136                 TDisplayMode iBitmapDisplayMode;
       
   137                 // Image in some common image file format (like Jpeg)
       
   138                 HBufC8* iImageBuffer;
       
   139                  // Info for encoder
       
   140                 CFrameImageData* iFrameImageData;
       
   141                 // UID of conversion target image type.
       
   142                 TUid iImageTypeUid;
       
   143             };
       
   144 
       
   145         // Specific image codec UID.
       
   146         TUid iImageCodecUid;
       
   147 
       
   148         // Pointer to array of CImageItem.
       
   149         RPointerArray<CImageItem>* iImageQueue;
       
   150 
       
   151         // Still Converter state.
       
   152         TInt iState;
       
   153         
       
   154     };
       
   155 
       
   156 
       
   157 #endif // CAESTILLCONVERTER_H
       
   158 
       
   159 // End of File