camerauis/cameraapp/generic/inc/cameracontroller/cambuffer.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Declaration of CCamBuffer class.
       
    15 *                Temporary own implementation of MCameraBuffer. 
       
    16 *                
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef C_CAM_BUFFER_H
       
    24 #define C_CAM_BUFFER_H
       
    25 
       
    26 
       
    27 #include <e32base.h> // CBase
       
    28 #include <ecam.h>    // MCameraBuffer
       
    29 
       
    30 
       
    31 class CFbsBitmap;
       
    32 
       
    33 
       
    34 class CCamBuffer : public CBase, 
       
    35                    public MCameraBuffer
       
    36   {
       
    37   // =======================================================
       
    38   public:
       
    39 
       
    40     static CCamBuffer* NewL( const CFbsBitmap& aBitmap, 
       
    41                                    HBufC8*     aData );
       
    42     static CCamBuffer* NewLC( const CFbsBitmap& aBitmap, 
       
    43                                     HBufC8*     aData );
       
    44 
       
    45     static CCamBuffer* NewL( CFbsBitmap* aBitmap, 
       
    46                              HBufC8*     aData );
       
    47     static CCamBuffer* NewLC( CFbsBitmap* aBitmap, 
       
    48                               HBufC8*     aData );
       
    49 
       
    50         
       
    51   // from MCameraBuffer
       
    52   public:
       
    53 
       
    54     virtual TInt NumFrames();
       
    55     virtual TDesC8* DataL( TInt aFrameIndex );
       
    56     virtual CFbsBitmap& BitmapL( TInt aFrameIndex );
       
    57     virtual RChunk& ChunkL();
       
    58     virtual TInt ChunkOffsetL( TInt aFrameIndex );
       
    59     virtual TInt FrameSize( TInt aFrameIndex );
       
    60     virtual void Release();
       
    61 
       
    62   // new methods
       
    63   public:
       
    64   protected:
       
    65   private:
       
    66     
       
    67     void ConstructL( const CFbsBitmap& aBitmap, 
       
    68                            HBufC8*     aData );
       
    69 
       
    70     void ConstructL( CFbsBitmap* aBitmap, 
       
    71                      HBufC8*     aData );
       
    72 
       
    73     CCamBuffer();
       
    74 
       
    75     ~CCamBuffer(); /** private to force use of Release() */
       
    76 
       
    77   // =======================================================
       
    78   // Data
       
    79   public:
       
    80     // Defined in MCameraBuffer
       
    81     //     TInt iIndexOfFirstFrameInBuffer;
       
    82     //     TTimeIntervalMicroSeconds iElapsedTime;
       
    83   protected:
       
    84   private:
       
    85   
       
    86     CFbsBitmap* iBitmap;
       
    87     HBufC8*     iImageData;
       
    88     RChunk      iChunk; // Needed to reference
       
    89 
       
    90     TBool iOwnBitmap;
       
    91     TBool iOwnData;
       
    92   // =======================================================
       
    93   };  
       
    94 
       
    95 
       
    96 #endif // C_CAM_BUFFER_H
       
    97 
       
    98 // end of file