imageadaptationextensions/iclextjpegapi/inc/IclExtJpegApiFrameImpl.h
changeset 0 469c91dae73b
equal deleted inserted replaced
-1:000000000000 0:469c91dae73b
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Definition of TFrameFormatExt and CVisualFrameImpl
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef _ICLEXTJPEGAPIFRAMEIMPL_
       
    19 #define _ICLEXTJPEGAPIFRAMEIMPL_
       
    20 
       
    21 #include <icl/icl_propertyuids.h>
       
    22 #include "IclExtJpegApiConst.h"
       
    23 
       
    24 class CVisualFrame::TFrameLayout;   
       
    25 
       
    26 #include "imageframe.h"
       
    27 
       
    28 /**
       
    29 * TFrameFormatExt
       
    30 * @lib IclExtJpegApi.lib
       
    31 * @since 3.2
       
    32 */
       
    33 class TFrameFormatExt : public TFrameFormatBase
       
    34     {
       
    35     public:
       
    36     
       
    37         /**
       
    38         * C++ default constructor.
       
    39         */
       
    40         TFrameFormatExt( TInt aFormatCode ) : 
       
    41             TFrameFormatBase( KUidExtIclImageFrameFormat ), 
       
    42             iFormatCode( aFormatCode )
       
    43             {
       
    44             Constructor();
       
    45             };
       
    46 
       
    47         /**
       
    48         * Duplicate
       
    49         * @since 3.2
       
    50         * @return TFrameFormatExt
       
    51         */
       
    52         TFrameFormatBase* DuplicateL() const
       
    53             {
       
    54             return new ( ELeave ) TFrameFormatExt( iFormatCode );
       
    55             };
       
    56 
       
    57         /**
       
    58         * Colour space
       
    59         * @since 3.2
       
    60         * @return TUid
       
    61         */
       
    62         TUid ColourSpace() const;
       
    63             
       
    64         /**
       
    65         * Sampling
       
    66         * @since 3.2
       
    67         * @return TUid
       
    68         */
       
    69         TUid Sampling() const;
       
    70             
       
    71         /**
       
    72         * Format code
       
    73         * @since 3.2
       
    74         * @return TInt
       
    75         */
       
    76         TInt FormatCode() const;
       
    77             
       
    78         /**
       
    79         * Set colour space
       
    80         * @since 3.2
       
    81         * @param aColourSpace
       
    82         * @return void
       
    83         */
       
    84         void SetColourSpace( TUid aColourSpace );
       
    85     
       
    86 
       
    87     protected:
       
    88           
       
    89         /**
       
    90         * constructor.
       
    91         */
       
    92         void Constructor();
       
    93 
       
    94     protected: // Data
       
    95     
       
    96         // The image frame colour space
       
    97         TUid    iColourSpace;
       
    98         // The frame sampling 
       
    99         TUid    iSampling;
       
   100         // The image frame format code which uniquely identifies all other parameters.  
       
   101         TInt    iFormatCode; 
       
   102     
       
   103     };  
       
   104     
       
   105 
       
   106 /**
       
   107 * CVisualFrameImpl
       
   108 * @lib IclExtJpegApi.lib
       
   109 * @since 3.2
       
   110 */  
       
   111 class CVisualFrameImpl : public CImageFrame 
       
   112        	{
       
   113         public:
       
   114             
       
   115             /**
       
   116             * Two-phased constructor.
       
   117             * @since 3.2
       
   118             * @param aBuffer		A descriptor reference to buffer containing the image data.
       
   119             * @param aDimension		The dimensions of the corresponding image data.
       
   120             * @param aFrameFormat	The frame format of the corresponding image data.
       
   121             */
       
   122             static CVisualFrameImpl* NewL(  
       
   123                                     TDes8& aBuffer, 
       
   124                                     const TSize& aDimension,
       
   125                                     TInt aFrameFormat );
       
   126                        
       
   127             /**
       
   128             * Two-phased constructor.
       
   129             * @param aChunk         An RChunk reference to buffer containing the image data.
       
   130         	* @param aSize          The amount of image data in bytes.
       
   131         	* @param amaxSize       The maximum size of the memory reserved in the chunk.
       
   132         	* @param aDataOffset    The offset value specifying the location of the image 
       
   133         	*                       data in the chunk.
       
   134         	* @param aDimension     The dimensions of the corresponding image data.
       
   135         	* @param aFrameFormat   The frame format of the corresponding image data.
       
   136             */                                
       
   137             static CVisualFrameImpl* NewL( 
       
   138                                     RChunk& aChunk, 
       
   139                                     TInt aSize,
       
   140                                     TInt aMaxSize, 
       
   141                                     TInt aDataOffset,
       
   142                                     const TSize& aDimension, 
       
   143                                     TInt aFrameFormat );
       
   144             /**
       
   145             * Two-phased constructor.
       
   146             * @param aBuffer        A descriptor reference to buffer containing the image data.
       
   147         	* @param aDimension     The dimensions of the corresponding image data.
       
   148         	* @param aFrameLayout   The layout of the image color components.
       
   149             */
       
   150             static CVisualFrameImpl* NewL( 
       
   151                                     TDes8& aBuffer, 
       
   152                                     const TSize& aDimension, 
       
   153                                     TInt aFrameFormat, 
       
   154                                     const CVisualFrame::TFrameLayout& aFrameLayout ); 
       
   155             
       
   156             /**
       
   157             * Two-phased constructor.
       
   158             * @param aChunk         An RChunk reference to buffer containing the image data.
       
   159         	* @param aSize          The amount of image data in bytes.
       
   160         	* @param aMaxSize       The maximum size of the memory reserved in the chunk for 
       
   161         	*                       the image data.
       
   162         	* @param aDimension     The dimensions of the corresponding image data.
       
   163         	* @param aFrameFormat   The frame format of the corresponding image data.
       
   164         	* @param aFrameLayout   The layout of the image color components. TFrameLayout 
       
   165         	* 						contains the scan line lengths and offsets for each component 
       
   166         	*						in planar YUV case
       
   167             */
       
   168             static CVisualFrameImpl* NewL( 
       
   169                                     RChunk& aChunk, 
       
   170                                     TInt aSize, 
       
   171                                     TInt aMaxSize,
       
   172                                     const TSize& aDimension, 
       
   173                                     TInt aFrameFormat, 
       
   174                                     const CVisualFrame::TFrameLayout& aFrameLayout );       
       
   175            
       
   176             static CVisualFrameImpl* NewL( const CImageFrame* aImageFrame ); 
       
   177             
       
   178             /**
       
   179             * Get image frame
       
   180             * @since 3.2
       
   181             * @return CImageFrame
       
   182             */
       
   183             CImageFrame* GetImageFrameL();
       
   184                                     
       
   185             /**
       
   186             * Returns a constant reference to the chunk containing 
       
   187         	* the image data, if exists.
       
   188             * @since 3.2
       
   189             * @return RChunk
       
   190             */                                    
       
   191             const RChunk& DataChunkL() const;
       
   192             
       
   193             /**
       
   194             * Returns a descriptor pointer to the image data location, if exists
       
   195             * @since 3.2
       
   196             * @return TPtr8
       
   197             */
       
   198             TPtr8 DataPtrL() const;
       
   199             
       
   200             /**
       
   201             * Returns the dimensions of the image.
       
   202             * @since 3.2
       
   203             * @return TSize
       
   204             */
       
   205             TSize Dimension() const;
       
   206             
       
   207             /**
       
   208             * Return the image data format.
       
   209             * @since 3.2
       
   210             * @return TInt
       
   211             */
       
   212             TInt FrameFormat2() const;
       
   213             
       
   214             /**
       
   215             * Returns the offset of the image data for non-planar, 
       
   216         	* single-component or compressed images. 
       
   217             * @since 3.2
       
   218             * @return TInt
       
   219             */
       
   220             TInt DataOffset() const;
       
   221             
       
   222             /**
       
   223             * Returns the amount of stored image data in bytes.
       
   224             * @since 3.2
       
   225             * @return TInt
       
   226             */
       
   227             TInt Size() const;
       
   228 
       
   229             /**
       
   230             * Sets the amount of image data to the given value. 
       
   231         	* Should be called when the image data amount is modified explicitly.
       
   232             * @since 3.2
       
   233             * @param
       
   234             * @return void
       
   235             */
       
   236             void SetSizeL( TInt aSize );
       
   237 
       
   238             /**
       
   239             * Returns the maximum size of the memory space reserved for image data
       
   240             * @since 3.2
       
   241             * @return TInt
       
   242             */
       
   243             TInt MaxSize() const;
       
   244             
       
   245             /**
       
   246             * Returns the storage type of the image data.
       
   247             * @since 3.2
       
   248             * @return TInt
       
   249             */
       
   250             TInt DataContainer() const;
       
   251             
       
   252             /**
       
   253             * Returns the layout of the image data for planar compressed images.
       
   254             * @since 3.2
       
   255             * @param
       
   256             * @return CVisualFrame::TFrameLayout
       
   257             */
       
   258             const CVisualFrame::TFrameLayout& FrameLayout2() const;    
       
   259 
       
   260             /**
       
   261             * Destructor.
       
   262             */
       
   263             virtual ~CVisualFrameImpl();      
       
   264             
       
   265         private: // Data
       
   266         
       
   267             CVisualFrame::TFrameLayout iFrameLayout2;
       
   268 
       
   269             TInt iSize;
       
   270         };
       
   271 
       
   272 
       
   273 #endif // _ICLEXTJPEGAPIFRAMEIMPL_
       
   274 
       
   275 
       
   276 // End of File