imagingmodules/jp2kcodec/Inc/JP2KComponentInfo.h
changeset 0 469c91dae73b
equal deleted inserted replaced
-1:000000000000 0:469c91dae73b
       
     1 /*
       
     2 * Copyright (c) 2003, 2004 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:  CJ2kComponentInfo class used to collect component related
       
    15 *                information such as precincts size at each resolution level and
       
    16 *                list of subbands
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __JP2KCOMPONENTINFO_H__
       
    22 #define __JP2KCOMPONENTINFO_H__
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 // FUNCTION PROTOTYPES
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CJ2kTileInfo;
       
    37 class CJ2kSubband;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42  * JP2KComponentInfo class used to collect component related
       
    43  * information such as precincts size at each resolution level,
       
    44  * list of subbands, and etc. It contains the data to control
       
    45  * where to resume the parsing of the bitstream.
       
    46  *
       
    47  * JP2KCodec.dll
       
    48  * @since 2.6
       
    49  */
       
    50 class CJ2kComponentInfo : public CBase
       
    51 {
       
    52 public:
       
    53     public:  // Constructors and destructor
       
    54 
       
    55         /**
       
    56         * Two-phased constructor.
       
    57         */
       
    58         static CJ2kComponentInfo* NewLC( CJ2kTileInfo& aTile, TUint16 aIndex );
       
    59 
       
    60         /**
       
    61         * Destructor.
       
    62         */
       
    63         virtual ~CJ2kComponentInfo();
       
    64 
       
    65     public: // New functions
       
    66 
       
    67         /**
       
    68         * At each component, parse the bitstream with LRCP progression order
       
    69         * @since 2.6
       
    70         * @param aTile: a reference to CJ2kTileInfo object.
       
    71         * @return TUint8: true if incomplete, false if completed.
       
    72         */
       
    73         TUint8 LRCPProgressionL( CJ2kTileInfo& aTile );
       
    74 
       
    75         /**
       
    76         * At each component, parse the bitstream with RPCL progression order
       
    77         * @since 2.6
       
    78         * @param aTile: a reference to CJ2kTileInfo object.
       
    79         * @return TUint8: true if incomplete, false if completed.
       
    80         */
       
    81         TUint8 RPCLProgressionL( CJ2kTileInfo& aTile );
       
    82 
       
    83         /**
       
    84         * At each component, parse the bitstream with CPRL progression order
       
    85         * @since 2.6
       
    86         * @param aTile: a reference to CJ2kTileInfo object.
       
    87         * @return TUint8: true if incomplete, false if completed.
       
    88         */
       
    89         TUint8 CPRLProgressionL( CJ2kTileInfo& aTile );
       
    90 
       
    91         /**
       
    92         * Get the subband at specific resolution level
       
    93         * @since 2.6
       
    94         * @param aResLevel: resolution level.
       
    95         * @return CJ2kSubband*: pointer to CJ2kSubband object.
       
    96         */
       
    97         const CJ2kSubband* SubbandAt( TUint8 aResLevel ) const;
       
    98 
       
    99         /**
       
   100         * Get the number of packets at specific resolution level
       
   101         * @since 2.6
       
   102         * @param aResLevel: resolution level.
       
   103         * @return TUint32: number of packets.
       
   104         */
       
   105         TUint32 NumOfPackets( TUint8 aResLevel ) const;
       
   106 
       
   107         /**
       
   108         * Get the quantization exponent value for transformation
       
   109         * @since 2.6
       
   110         * @param aIndex: subband index.
       
   111         * @return TUint8: exponent value.
       
   112         */
       
   113         TUint8 Exponent( TUint16 aIndex ) const;
       
   114 
       
   115         /**
       
   116         * Get the quantization mantissa value for transformation
       
   117         * @since 2.6
       
   118         * @param aIndex: subband index.
       
   119         * @return TUint16: mantissa value.
       
   120         */
       
   121         TUint16 Mantissa( TUint16 aIndex ) const;
       
   122 
       
   123         /**
       
   124         * Get the magnitude bits
       
   125         * @since 2.6
       
   126         * @param aIndex: subband index.
       
   127         * @return TUint8: magnitude bits.
       
   128         */
       
   129         TUint8 MagnitudeBits( TUint16 aIndex ) const;
       
   130 
       
   131         /**
       
   132         * Reset the last packet processed for each subband
       
   133         * @since 2.6
       
   134         */
       
   135         void ResetLastPacketProcessed();
       
   136 
       
   137         /**
       
   138         * Get the resolution level
       
   139         * @since 2.6
       
   140         * @return TUint8: resolution level.
       
   141         */
       
   142         TUint8 Levels() const;
       
   143 
       
   144         /**
       
   145         * Get the codeblock style
       
   146         * @since 2.6
       
   147         * @return TUint8: codeblock style.
       
   148         */
       
   149         TUint8 CodeBlockStyle() const;
       
   150 
       
   151         /**
       
   152         * Get the number of guard
       
   153         * @since 2.6
       
   154         * @return TUint8: number of guard.
       
   155         */
       
   156         TUint8 NumGuard() const;
       
   157 
       
   158         /**
       
   159         * Get the quantization style
       
   160         * @since 2.6
       
   161         * @return TUint8: quantization style.
       
   162         */
       
   163         TUint8 QuantizationStyle() const;
       
   164 
       
   165         /**
       
   166         * Get the region of interest shifting
       
   167         * @since 2.6
       
   168         * @return TUint8: region of interest shifting.
       
   169         */
       
   170         TUint8 RoiShift() const;
       
   171 
       
   172         /**
       
   173         * Get the codeblock size
       
   174         * @since 2.6
       
   175         * @return TSize&: a reference to the codeblock size.
       
   176         */
       
   177         const TSize& CodeBlockSize() const;
       
   178 
       
   179         /**
       
   180         * Get the canvas of the component
       
   181         * @since 2.6
       
   182         * @return TRect&: a reference to the component's canvas.
       
   183         */
       
   184         const TRect& ComponentCanvas() const;
       
   185 
       
   186         /**
       
   187         * Get the precinct size at specific resolution level
       
   188         * @since 2.6
       
   189         * @param aResLevel: resolution level.
       
   190         * @return TSize&: a reference to the precinct size.
       
   191         */
       
   192         const TSize& PrecinctSizeAt( TUint8 aResLevel ) const;
       
   193 
       
   194         /**
       
   195         * Get the minimum grid size
       
   196         * @since 2.6
       
   197         * @return TSize&: a reference to the minimum grid.
       
   198         */
       
   199         const TSize& MinGrid() const;
       
   200 
       
   201         /**
       
   202         * Is coding style shows SOP marker may exists in codestream
       
   203         * @since 2.6
       
   204         * @return TUInt8: true if SOP marker used.
       
   205         */
       
   206         TUint8 IsSOPMarkerUsed() const;
       
   207 
       
   208         /**
       
   209         * Is coding style shows EPH marker may exists in codestream
       
   210         * @since 2.6
       
   211         * @return TUint8: true if EPH marker used.
       
   212         */
       
   213         TUint8 IsEPHMarkerUsed() const;
       
   214 
       
   215         /**
       
   216         * Is codeblock style shows AC bypass
       
   217         * @since 2.6
       
   218         * @return TUint8: true if AC bypass.
       
   219         */
       
   220         TUint8 IsACByPass() const;
       
   221 
       
   222         /**
       
   223         * Is codeblock style shows termination
       
   224         * @since 2.6
       
   225         * @return TUint8: true if termination.
       
   226         */
       
   227         TUint8 IsTermination() const;
       
   228 
       
   229         /**
       
   230         * Is transformation reversible
       
   231         * @since 2.6
       
   232         * @return TUint8: true if reversible.
       
   233         */
       
   234         TUint8 IsReversible() const;  
       
   235 
       
   236     public: // Functions from base classes
       
   237       
       
   238     protected:  // New functions
       
   239         
       
   240     protected:  // Functions from base classes
       
   241 
       
   242     private:
       
   243 
       
   244         /**
       
   245         * C++ default constructor.
       
   246         */
       
   247         CJ2kComponentInfo();
       
   248 
       
   249         /**
       
   250         * By default Symbian 2nd phase constructor is private.
       
   251         */
       
   252         void ConstructL( CJ2kTileInfo& aTile, TUint16 aIndex );
       
   253 
       
   254     public:     // Data
       
   255    
       
   256     protected:  // Data
       
   257 
       
   258     private:    // Data
       
   259 
       
   260         // Canvas of the component
       
   261         TRect iComponentCanvas;  
       
   262 
       
   263         // Root of the subbands
       
   264         CJ2kSubband *iRootSubband; 
       
   265 
       
   266         // Precincts at each resolution level
       
   267         RArray<TSize> iPrecinctSizeList;
       
   268 
       
   269         // List of grid
       
   270         RArray<TSize> iGridList;         
       
   271 
       
   272         // Minimum grid size
       
   273         TSize iMinGrid;          
       
   274 
       
   275         // Size of codeblock
       
   276         TSize iCodeBlockSiz;           
       
   277 
       
   278         // Number of resolution level
       
   279         TUint8 iNumOfLevels; 
       
   280         
       
   281         // Codeblock style
       
   282         TUint8 iCodeBlockStyle;         
       
   283 
       
   284         // DWT transformation
       
   285         TUint8 iWaveletTransformation;  
       
   286 
       
   287         // Coding style
       
   288         TUint8 iCod;                    
       
   289     
       
   290         // Quantization
       
   291         TUint8 iQc;                     
       
   292 
       
   293         // Region of interest
       
   294         TUint8 iRoiShift;    
       
   295         
       
   296         // Quantization values for transformation        
       
   297         HBufC8 *iExponentList;
       
   298 
       
   299         // Quantization values for transformation
       
   300         HBufC16 *iMantissaList;           
       
   301 
       
   302     public:     // Friend classes
       
   303         
       
   304     protected:  // Friend classes
       
   305         
       
   306     private:    // Friend classes
       
   307 };
       
   308 
       
   309 // For inliners.
       
   310 #include "JP2KComponentInfo.inl"
       
   311 
       
   312 #endif // __JP2KCOMPONENTINFO_H__