imagingmodules/jp2kcodec/Inc/JP2KTileInfo.inl
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:  CJ2kTileInfo class used to collect tile related
       
    15 *                information such as Tile Part Header, SOT marker and
       
    16 *                list of components.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __JP2KTILEINFO_INL__
       
    22 #define __JP2KTILEINFO_INL__
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CJ2kTileInfo::SetTileLength
       
    28 // Set the tile length.
       
    29 // ( other items were commented in a header ).
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 inline void CJ2kTileInfo::SetTileLength( TUint32 aLength )
       
    33     {
       
    34     iTileLength = aLength;
       
    35     }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CJ2kTileInfo::TileLength
       
    39 // Get the tile length.
       
    40 // ( other items were commented in a header ).
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 inline TUint32& CJ2kTileInfo::TileLength()
       
    44     {
       
    45     return iTileLength;
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CJ2kTileInfo::TileCanvas
       
    50 // Get the canvas of the tile.
       
    51 // ( other items were commented in a header ).
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 inline const TRect& CJ2kTileInfo::TileCanvas() const
       
    55     {
       
    56     return iTileCanvas;
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CJ2kTileInfo::NumOfComponents
       
    61 // Get the number of componnets.
       
    62 // ( other items were commented in a header ).
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 inline TUint16 CJ2kTileInfo::NumOfComponents() const
       
    66     {
       
    67     return (TUint16)iComponentList.Count();
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CJ2kTileInfo::NumOfLayersPOC
       
    72 // Get the end of layer to process.
       
    73 // ( other items were commented in a header ).
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 inline TUint16 CJ2kTileInfo::NumOfLayersPOC() const
       
    77     {
       
    78     return iNumOfLayersPOC;
       
    79     }
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CJ2kTileInfo::NumOfLevelsPOC
       
    83 // Get the end of level to process.
       
    84 // ( other items were commented in a header ).
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 inline TUint8 CJ2kTileInfo::NumOfLevelsPOC() const
       
    88     {
       
    89     return iNumOfLevelsPOC;
       
    90     }
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CJ2kTileInfo::ComponentAt
       
    94 // Get the component at specific location.
       
    95 // ( other items were commented in a header ).
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 inline const CJ2kComponentInfo& CJ2kTileInfo::ComponentAt( TUint16 aIndex ) const
       
    99     {
       
   100     return *iComponentList[aIndex];
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CJ2kTileInfo::LastLayerProcessed
       
   105 // Get the last layer processed.
       
   106 // ( other items were commented in a header ).
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 inline TUint16 CJ2kTileInfo::LastLayerProcessed() const
       
   110     {
       
   111     return iLastLayer;
       
   112     }
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CJ2kTileInfo::LastLevelProcessed
       
   116 // Get the last resolution level processed.
       
   117 // ( other items were commented in a header ).
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 inline TUint8 CJ2kTileInfo::LastLevelProcessed() const
       
   121     {
       
   122     return iLastLevel;
       
   123     }
       
   124 
       
   125 // -----------------------------------------------------------------------------
       
   126 // CJ2kTileInfo::LastComponentProcessed
       
   127 // Get the last component processed.
       
   128 // ( other items were commented in a header ).
       
   129 // -----------------------------------------------------------------------------
       
   130 //
       
   131 inline TUint16 CJ2kTileInfo::LastComponentProcessed() const
       
   132     {
       
   133     return iLastComponent;
       
   134     }
       
   135 
       
   136 // -----------------------------------------------------------------------------
       
   137 // CJ2kTileInfo::LastN1Processed
       
   138 // Get the last position processed in vertical direction.
       
   139 // ( other items were commented in a header ).
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 inline TInt CJ2kTileInfo::LastN1Processed() const
       
   143     {
       
   144     return iLastN1;
       
   145     }
       
   146 
       
   147 // -----------------------------------------------------------------------------
       
   148 // CJ2kTileInfo::LastN2Processed
       
   149 // Get the last position processed in horizontal direction.
       
   150 // ( other items were commented in a header ).
       
   151 // -----------------------------------------------------------------------------
       
   152 //
       
   153 inline TInt CJ2kTileInfo::LastN2Processed() const
       
   154     {
       
   155     return iLastN2;
       
   156     }
       
   157 
       
   158 // -----------------------------------------------------------------------------
       
   159 // CJ2kTileInfo::IncrementLastLayerProcessed
       
   160 // Increment the last layer processed.
       
   161 // ( other items were commented in a header ).
       
   162 // -----------------------------------------------------------------------------
       
   163 //
       
   164 inline void CJ2kTileInfo::IncrementLastLayerProcessed()
       
   165     {
       
   166     ++iLastLayer;
       
   167     }
       
   168 
       
   169 // -----------------------------------------------------------------------------
       
   170 // CJ2kTileInfo::ResetLastLayerProcessed
       
   171 // Reset the last layer processed to 0.
       
   172 // ( other items were commented in a header ).
       
   173 // -----------------------------------------------------------------------------
       
   174 //
       
   175 inline void CJ2kTileInfo::ResetLastLayerProcessed()
       
   176     {
       
   177     iLastLayer = 0;
       
   178     }
       
   179 
       
   180 // -----------------------------------------------------------------------------
       
   181 // CJ2kTileInfo::ImageInfo
       
   182 // Get the reference to the image info.
       
   183 // ( other items were commented in a header ).
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 inline const CJ2kImageInfo& CJ2kTileInfo::ImageInfo() const
       
   187     {
       
   188     return iImageInfo;
       
   189     }
       
   190 
       
   191 // -----------------------------------------------------------------------------
       
   192 // CJ2kTileInfo::StreamReader
       
   193 // Get the reference to the stream reader.
       
   194 // ( other items were commented in a header ).
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 inline const TJ2kStreamReader& CJ2kTileInfo::StreamReader() const
       
   198     {
       
   199     return iReader;
       
   200     }
       
   201 
       
   202 // -----------------------------------------------------------------------------
       
   203 // CJ2kTileInfo::SetSotMarker
       
   204 // Set the SOT marker.
       
   205 // ( other items were commented in a header ).
       
   206 // -----------------------------------------------------------------------------
       
   207 //
       
   208 inline void CJ2kTileInfo::SetSotMarker( const TSotMarker &aSotMarker )
       
   209     {
       
   210     iSot = aSotMarker;
       
   211     }
       
   212 
       
   213 // -----------------------------------------------------------------------------
       
   214 // CJ2kTileInfo::SotMarker
       
   215 // Get the SOT marker.
       
   216 // ( other items were commented in a header ).
       
   217 // -----------------------------------------------------------------------------
       
   218 //
       
   219 inline const TSotMarker& CJ2kTileInfo::SotMarker() const
       
   220     {
       
   221     return iSot;
       
   222     }
       
   223 
       
   224 // -----------------------------------------------------------------------------
       
   225 // CJ2kTileInfo::TileMarker
       
   226 // Get the Tile Part Header.
       
   227 // ( other items were commented in a header ).
       
   228 // -----------------------------------------------------------------------------
       
   229 //
       
   230 inline const TTileMarker& CJ2kTileInfo::TileMarker() const
       
   231     {
       
   232     return iTileMarker;
       
   233     }
       
   234 
       
   235 // -----------------------------------------------------------------------------
       
   236 // CJ2kTileInfo::SetCheckMarker
       
   237 // Set the SOT/EOC check indicator.
       
   238 // ( other items were commented in a header ).
       
   239 // -----------------------------------------------------------------------------
       
   240 //
       
   241 inline void CJ2kTileInfo::SetCheckMarker( TUint8 aCheckMarker )
       
   242     {
       
   243     iCheckMarker = aCheckMarker;
       
   244     }
       
   245 
       
   246 // -----------------------------------------------------------------------------
       
   247 // CJ2kTileInfo::SetPacketHeaderReader
       
   248 // Set the packet header reader.
       
   249 // ( other items were commented in a header ).
       
   250 // -----------------------------------------------------------------------------
       
   251 //
       
   252 inline void CJ2kTileInfo::SetPacketHeaderReader( MJ2kPacketHeaderReader* aReader )
       
   253     {
       
   254     iPacketHeaderReader = aReader;
       
   255     }
       
   256 
       
   257 // -----------------------------------------------------------------------------
       
   258 // CJ2kTileInfo::PacketHeaderReader
       
   259 // Get the packet header reader.
       
   260 // ( other items were commented in a header ).
       
   261 // -----------------------------------------------------------------------------
       
   262 //
       
   263 inline MJ2kPacketHeaderReader& CJ2kTileInfo::PacketHeaderReader()
       
   264     {
       
   265     return *iPacketHeaderReader;
       
   266     }
       
   267 
       
   268 // -----------------------------------------------------------------------------
       
   269 // CJ2kTileInfo::IsFirstTilePart
       
   270 // Is this the first tile part.
       
   271 // ( other items were commented in a header ).
       
   272 // -----------------------------------------------------------------------------
       
   273 //
       
   274 inline TUint8 CJ2kTileInfo::IsFirstTilePart() const
       
   275     {
       
   276     return ( iSot.iTPsot == 0 );
       
   277     }
       
   278 
       
   279 // -----------------------------------------------------------------------------
       
   280 // CJ2kTileInfo::IsPPT
       
   281 // Is packet header should be read from PPT marker.
       
   282 // ( other items were commented in a header ).
       
   283 // -----------------------------------------------------------------------------
       
   284 //
       
   285 inline TUint8 CJ2kTileInfo::IsPPT() const
       
   286     {
       
   287     return ( iPptBuffer != 0 || iTileMarker.iPpt.Count() != 0 );
       
   288     }
       
   289 
       
   290 // -----------------------------------------------------------------------------
       
   291 // CJ2kTileInfo::IsPOC
       
   292 // Is POC marker should be used for progression order.
       
   293 // ( other items were commented in a header ).
       
   294 // -----------------------------------------------------------------------------
       
   295 //
       
   296 inline TUint8 CJ2kTileInfo::IsPOC() const
       
   297     {
       
   298     return ( iPOC != 0 );
       
   299     }
       
   300 
       
   301 // -----------------------------------------------------------------------------
       
   302 // CJ2kTileInfo::IsLastTilePart
       
   303 // Is this the last tile part.
       
   304 // ( other items were commented in a header ).
       
   305 // -----------------------------------------------------------------------------
       
   306 //
       
   307 inline TUint8 CJ2kTileInfo::IsLastTilePart() const
       
   308     {
       
   309     return ( iSot.iTNsot != 0 && iSot.iTNsot == ( iSot.iTPsot + 1 ) );
       
   310     }
       
   311 
       
   312 // -----------------------------------------------------------------------------
       
   313 // CJ2kTileInfo::IsCheckMarker
       
   314 // Is SOT/EOC marker should be checked during progression.
       
   315 // ( other items were commented in a header ).
       
   316 // -----------------------------------------------------------------------------
       
   317 //
       
   318 inline TUint8 CJ2kTileInfo::IsCheckMarker() const
       
   319     {
       
   320     return iCheckMarker;
       
   321     }
       
   322 
       
   323 // -----------------------------------------------------------------------------
       
   324 // CJ2kTileInfo::IsSpeedup
       
   325 // Is RLCP/RPCL progression order used.
       
   326 // ( other items were commented in a header ).
       
   327 // -----------------------------------------------------------------------------
       
   328 //
       
   329 inline TUint8 CJ2kTileInfo::IsSpeedup() const
       
   330     {
       
   331     return ( ProgressionOrder() == EProgression_R_L_C_P ||
       
   332              ProgressionOrder() == EProgression_R_P_C_L );
       
   333     }
       
   334 
       
   335 #endif // __JP2KTILEINFO_INL__