imagingmodules/jp2kcodec/Src/JP2KImageWriter.cpp
branchRCL_3
changeset 4 3993b8f65362
parent 0 469c91dae73b
equal deleted inserted replaced
0:469c91dae73b 4:3993b8f65362
   109     {
   109     {
   110     return iTileStartList[aTileIndex];
   110     return iTileStartList[aTileIndex];
   111     }
   111     }
   112 
   112 
   113 // -----------------------------------------------------------------------------
   113 // -----------------------------------------------------------------------------
   114 // CJ2kWriterComponentInfo::UpdateNextTileStartAt
   114 // CJ2kWriterComponentInfo::UpdateNextTileStartAtL
   115 // Update the starting point of next tile
   115 // Update the starting point of next tile
   116 // (other items were commented in a header).
   116 // (other items were commented in a header).
   117 // -----------------------------------------------------------------------------
   117 // -----------------------------------------------------------------------------
   118 //
   118 //
   119 void CJ2kWriterComponentInfo::UpdateNextTileStartAt( TUint16 aTileIndex, 
   119 void CJ2kWriterComponentInfo::UpdateNextTileStartAtL( TUint16 aTileIndex, 
   120                                                      const TSize& aSize,
   120                                                      const TSize& aSize,
   121                                                      CJ2kImageInfo& aImageInfo )
   121                                                      CJ2kImageInfo& aImageInfo )
   122     {
   122     {
   123     TUint16 numOfHorizTiles = aImageInfo.NumOfHorizTiles();
   123     TUint16 numOfHorizTiles = aImageInfo.NumOfHorizTilesL();
   124     TUint16 numOfVertTiles  = aImageInfo.NumOfVertTiles();
   124     TUint16 numOfVertTiles  = aImageInfo.NumOfVertTilesL();
   125 
   125 
   126     // Calculate the p and q of a tile
   126     // Calculate the p and q of a tile
   127     TDiv tDiv = TJ2kUtils::Div( aTileIndex, numOfHorizTiles );
   127     TDiv tDiv = TJ2kUtils::DivL( aTileIndex, numOfHorizTiles );
   128     if ( tDiv.rem != ( numOfHorizTiles - 1 ) )
   128     if ( tDiv.rem != ( numOfHorizTiles - 1 ) )
   129         {
   129         {
   130         iTileStartList[aTileIndex + 1].iX = iTileStartList[aTileIndex].iX + aSize.iWidth;
   130         iTileStartList[aTileIndex + 1].iX = iTileStartList[aTileIndex].iX + aSize.iWidth;
   131         }
   131         }
   132 
   132 
   280                 {
   280                 {
   281                 // Allocate memory for block of color pixels
   281                 // Allocate memory for block of color pixels
   282                 iColorPixelBlock = STATIC_CAST( TRgb*, User::AllocL( 2 * KPixelsBlock * sizeof( TRgb ) ) );
   282                 iColorPixelBlock = STATIC_CAST( TRgb*, User::AllocL( 2 * KPixelsBlock * sizeof( TRgb ) ) );
   283                 }
   283                 }
   284 
   284 
   285             CombineOutputFile( aTile, subbandSize );
   285             CombineOutputFileL( aTile, subbandSize );
   286             for ( c = 0; c < iNumComponents; c++ )
   286             for ( c = 0; c < iNumComponents; c++ )
   287                 {
   287                 {
   288                 iComponents[c]->FreeData();
   288                 iComponents[c]->FreeData();
   289                 }
   289                 }
   290             }
   290             }
   306                 // Allocate memory for block of grayscale pixels
   306                 // Allocate memory for block of grayscale pixels
   307                 iMonoPixelBlock = STATIC_CAST( TUint32*, User::AllocL( KPixelsBlock * sizeof( TUint32 ) ) );
   307                 iMonoPixelBlock = STATIC_CAST( TUint32*, User::AllocL( KPixelsBlock * sizeof( TUint32 ) ) );
   308                 }
   308                 }
   309 
   309 
   310             // Output a single component
   310             // Output a single component
   311             WriteOutputFile( aTile, c, subbandSize, bitdepth );
   311             WriteOutputFileL( aTile, c, subbandSize, bitdepth );
   312             iComponents[c]->FreeData();
   312             iComponents[c]->FreeData();
   313             }
   313             }
   314         }
   314         }
   315     else
   315     else
   316         {
   316         {
   326             for ( c = 0; c < 3; c++ )
   326             for ( c = 0; c < 3; c++ )
   327                 {
   327                 {
   328                 bitdepth = iImageInfo.DepthOfComponent( c );
   328                 bitdepth = iImageInfo.DepthOfComponent( c );
   329 
   329 
   330                 // Output single files 
   330                 // Output single files 
   331                 WriteOutputFile( aTile, c, subbandSize, bitdepth );
   331                 WriteOutputFileL( aTile, c, subbandSize, bitdepth );
   332                 iComponents[c]->FreeData();
   332                 iComponents[c]->FreeData();
   333                 }
   333                 }
   334             }
   334             }
   335         else if ( iJ2kInfo.iCMPList.Count() )
   335         else if ( iJ2kInfo.iCMPList.Count() )
   336             {
   336             {
   338                 {
   338                 {
   339                 // Bitdepth is the lowest seven bits plus one for palettes
   339                 // Bitdepth is the lowest seven bits plus one for palettes
   340                 bitdepth = ( TUint8 )( ( iJ2kInfo.iPalette.iBList[0] & 0x7f )+1 );
   340                 bitdepth = ( TUint8 )( ( iJ2kInfo.iPalette.iBList[0] & 0x7f )+1 );
   341 
   341 
   342                 // Output single files 
   342                 // Output single files 
   343                 WriteOutputFile( aTile, c, subbandSize, bitdepth );
   343                 WriteOutputFileL( aTile, c, subbandSize, bitdepth );
   344                 iComponents[c]->FreeData();
   344                 iComponents[c]->FreeData();
   345                 }
   345                 }
   346             }
   346             }
   347         else
   347         else
   348             {
   348             {
   349             bitdepth = iImageInfo.DepthOfComponent( aComponentIndex );
   349             bitdepth = iImageInfo.DepthOfComponent( aComponentIndex );
   350 
   350 
   351             // Output only the first component to screen
   351             // Output only the first component to screen
   352             if( aComponentIndex == 0 )
   352             if( aComponentIndex == 0 )
   353                 {
   353                 {
   354                 WriteOutputFile( aTile, aComponentIndex, subbandSize, bitdepth );
   354                 WriteOutputFileL( aTile, aComponentIndex, subbandSize, bitdepth );
   355                 }
   355                 }
   356             iComponents[aComponentIndex]->FreeData();
   356             iComponents[aComponentIndex]->FreeData();
   357             }
   357             }
   358         }
   358         }
   359     }
   359     }
   437                 {
   437                 {
   438                 // Allocate memory for block of color pixels
   438                 // Allocate memory for block of color pixels
   439                 iColorPixelBlock = STATIC_CAST( TRgb*, User::AllocL( 2 * KPixelsBlock * sizeof( TRgb ) ) );
   439                 iColorPixelBlock = STATIC_CAST( TRgb*, User::AllocL( 2 * KPixelsBlock * sizeof( TRgb ) ) );
   440                 }
   440                 }
   441 
   441 
   442             CombineOutputFile( aTile, subbandSize );
   442             CombineOutputFileL( aTile, subbandSize );
   443             for ( c = 0; c < iNumComponents; c++ )
   443             for ( c = 0; c < iNumComponents; c++ )
   444                 {
   444                 {
   445                 iComponents[c]->FreeData();
   445                 iComponents[c]->FreeData();
   446                 }
   446                 }
   447             }
   447             }
   463                 // Allocate memory for block of grayscale pixels
   463                 // Allocate memory for block of grayscale pixels
   464                 iMonoPixelBlock = STATIC_CAST( TUint32*, User::AllocL( KPixelsBlock * sizeof( TUint32 ) ) );
   464                 iMonoPixelBlock = STATIC_CAST( TUint32*, User::AllocL( KPixelsBlock * sizeof( TUint32 ) ) );
   465                 }
   465                 }
   466 
   466 
   467             // Output a single component
   467             // Output a single component
   468             WriteOutputFile( aTile, c, subbandSize, bitdepth );
   468             WriteOutputFileL( aTile, c, subbandSize, bitdepth );
   469             iComponents[c]->FreeData();
   469             iComponents[c]->FreeData();
   470             }
   470             }
   471         }
   471         }
   472     else
   472     else
   473         {
   473         {
   483             for ( c = 0; c < 3; c++ )
   483             for ( c = 0; c < 3; c++ )
   484                 {
   484                 {
   485                 bitdepth = iImageInfo.DepthOfComponent( c );
   485                 bitdepth = iImageInfo.DepthOfComponent( c );
   486 
   486 
   487                 // Output single files 
   487                 // Output single files 
   488                 WriteOutputFile( aTile, c, subbandSize, bitdepth );
   488                 WriteOutputFileL( aTile, c, subbandSize, bitdepth );
   489                 iComponents[c]->FreeData();
   489                 iComponents[c]->FreeData();
   490                 }
   490                 }
   491             }
   491             }
   492         else if ( iJ2kInfo.iCMPList.Count() )
   492         else if ( iJ2kInfo.iCMPList.Count() )
   493             {
   493             {
   495                 {
   495                 {
   496                 // Bitdepth is the lowest seven bits plus one for palettes
   496                 // Bitdepth is the lowest seven bits plus one for palettes
   497                 bitdepth = (TUint8)( ( iJ2kInfo.iPalette.iBList[0] & 0x7f )+1 );
   497                 bitdepth = (TUint8)( ( iJ2kInfo.iPalette.iBList[0] & 0x7f )+1 );
   498 
   498 
   499                 // Output single files 
   499                 // Output single files 
   500                 WriteOutputFile( aTile, c, subbandSize, bitdepth );
   500                 WriteOutputFileL( aTile, c, subbandSize, bitdepth );
   501                 iComponents[c]->FreeData();
   501                 iComponents[c]->FreeData();
   502                 }
   502                 }
   503             }
   503             }
   504         else
   504         else
   505             {
   505             {
   506             bitdepth = iImageInfo.DepthOfComponent( aComponentIndex );
   506             bitdepth = iImageInfo.DepthOfComponent( aComponentIndex );
   507 
   507 
   508             // Output only the first component to screen
   508             // Output only the first component to screen
   509             if( aComponentIndex == 0 )
   509             if( aComponentIndex == 0 )
   510                 {
   510                 {
   511                 WriteOutputFile( aTile, aComponentIndex, subbandSize, bitdepth );
   511                 WriteOutputFileL( aTile, aComponentIndex, subbandSize, bitdepth );
   512                 }
   512                 }
   513 
   513 
   514             iComponents[aComponentIndex]->FreeData();
   514             iComponents[aComponentIndex]->FreeData();
   515             }
   515             }
   516         }
   516         }
  1076         iMatrix[6] = ( TInt32 )( KSRGBMaxIntShifted * ( KSRGB20 * redX   + KSRGB21 * redY   + KSRGB22 * redZ ) );
  1076         iMatrix[6] = ( TInt32 )( KSRGBMaxIntShifted * ( KSRGB20 * redX   + KSRGB21 * redY   + KSRGB22 * redZ ) );
  1077         iMatrix[7] = ( TInt32 )( KSRGBMaxIntShifted * ( KSRGB20 * greenX + KSRGB21 * greenY + KSRGB22 * greenZ ) );
  1077         iMatrix[7] = ( TInt32 )( KSRGBMaxIntShifted * ( KSRGB20 * greenX + KSRGB21 * greenY + KSRGB22 * greenZ ) );
  1078         iMatrix[8] = ( TInt32 )( KSRGBMaxIntShifted * ( KSRGB20 * blueX  + KSRGB21 * blueY  + KSRGB22 * blueZ ) );
  1078         iMatrix[8] = ( TInt32 )( KSRGBMaxIntShifted * ( KSRGB20 * blueX  + KSRGB21 * blueY  + KSRGB22 * blueZ ) );
  1079         
  1079         
  1080         iRedTRCLut = STATIC_CAST( TInt32*, User::AllocL( lutSize * sizeof( TInt32 ) ) );
  1080         iRedTRCLut = STATIC_CAST( TInt32*, User::AllocL( lutSize * sizeof( TInt32 ) ) );
       
  1081         //ASSERT(redTRC);
       
  1082         User::LeaveIfNull(redTRC);
  1081         if ( redTRC->Length() == 1 )
  1083         if ( redTRC->Length() == 1 )
  1082             {
  1084             {
  1083             gamma = (TReal)( *redTRC )[0] / KGamma;
  1085             gamma = (TReal)( *redTRC )[0] / KGamma;
  1084             maxInput = (TReal)( lutSize - 1 );
  1086             maxInput = (TReal)( lutSize - 1 );
  1085             for ( index = 0; index < lutSize; ++index )
  1087             for ( index = 0; index < lutSize; ++index )
  1110             {
  1112             {
  1111             lutSize = 1 << iImageInfo.DepthOfComponent( 1 );
  1113             lutSize = 1 << iImageInfo.DepthOfComponent( 1 );
  1112             }
  1114             }
  1113 
  1115 
  1114         iGreenTRCLut = STATIC_CAST( TInt32*, User::AllocL( lutSize * sizeof( TInt32 ) ) );
  1116         iGreenTRCLut = STATIC_CAST( TInt32*, User::AllocL( lutSize * sizeof( TInt32 ) ) );
       
  1117         //ASSERT(greenTRC);
       
  1118         User::LeaveIfNull(greenTRC);
  1115         if ( greenTRC->Length() == 1 )
  1119         if ( greenTRC->Length() == 1 )
  1116             {
  1120             {
  1117             gamma = (TReal)( *greenTRC )[0] / KGamma;
  1121             gamma = (TReal)( *greenTRC )[0] / KGamma;
  1118             maxInput = (TReal)( lutSize - 1 );
  1122             maxInput = (TReal)( lutSize - 1 );
  1119             for ( index = 0; index < lutSize; ++index )
  1123             for ( index = 0; index < lutSize; ++index )
  1144             {
  1148             {
  1145             lutSize = 1 << iImageInfo.DepthOfComponent( 2 );
  1149             lutSize = 1 << iImageInfo.DepthOfComponent( 2 );
  1146             }
  1150             }
  1147 
  1151 
  1148         iBlueTRCLut = STATIC_CAST( TInt32*, User::AllocL( lutSize * sizeof( TInt32 ) ) );
  1152         iBlueTRCLut = STATIC_CAST( TInt32*, User::AllocL( lutSize * sizeof( TInt32 ) ) );
       
  1153         //ASSERT(blueTRC);
       
  1154         User::LeaveIfNull(blueTRC);
  1149         if ( blueTRC->Length() == 1 )
  1155         if ( blueTRC->Length() == 1 )
  1150             {
  1156             {
  1151             gamma = (TReal)( *blueTRC )[0] / KGamma;
  1157             gamma = (TReal)( *blueTRC )[0] / KGamma;
  1152             maxInput = (TReal)( lutSize - 1 );
  1158             maxInput = (TReal)( lutSize - 1 );
  1153             for ( index = 0; index < lutSize; ++index )
  1159             for ( index = 0; index < lutSize; ++index )
  1172         }
  1178         }
  1173     else
  1179     else
  1174         {
  1180         {
  1175 
  1181 
  1176         iGrayTRCLut = STATIC_CAST( TInt32*, User::AllocL( lutSize * sizeof( TInt32 ) ) );
  1182         iGrayTRCLut = STATIC_CAST( TInt32*, User::AllocL( lutSize * sizeof( TInt32 ) ) );
       
  1183         //ASSERT(grayTRC);
       
  1184         User::LeaveIfNull(grayTRC);
  1177         if ( grayTRC->Length() == 1 )
  1185         if ( grayTRC->Length() == 1 )
  1178             {
  1186             {
  1179 
  1187 
  1180             gamma = (TReal)( *grayTRC )[0] / KGamma;
  1188             gamma = (TReal)( *grayTRC )[0] / KGamma;
  1181             maxInput = (TReal)( lutSize - 1 );
  1189             maxInput = (TReal)( lutSize - 1 );
  1255     TUint16 l = 0;
  1263     TUint16 l = 0;
  1256     TUint16 m = 0;                 
  1264     TUint16 m = 0;                 
  1257     TUint16 tileIndex = 0;            
  1265     TUint16 tileIndex = 0;            
  1258     TUint16 tileYIndex = 0;
  1266     TUint16 tileYIndex = 0;
  1259     TPoint tileStart( 0, 0 );
  1267     TPoint tileStart( 0, 0 );
  1260     TUint16 numOfHorizTiles = iImageInfo.NumOfHorizTiles();
  1268     TUint16 numOfHorizTiles = iImageInfo.NumOfHorizTilesL();
  1261     TUint16 numOfVertTiles  = iImageInfo.NumOfVertTiles();
  1269     TUint16 numOfVertTiles  = iImageInfo.NumOfVertTilesL();
  1262     TRect tileCanvas( 0, 0, 0, 0 );
  1270     TRect tileCanvas( 0, 0, 0, 0 );
  1263     TRect componentCanvas( 0, 0, 0, 0 );
  1271     TRect componentCanvas( 0, 0, 0, 0 );
  1264     const TSizMarker &sizMarker = iImageInfo.SizMarker();
  1272     const TSizMarker &sizMarker = iImageInfo.SizMarker();
  1265     TInt  useHeight = 0;
  1273     TInt  useHeight = 0;
  1266     TInt  useWidth = 0;
  1274     TInt  useWidth = 0;
  1284                                          Max( sizMarker.iYTOsiz + l * sizMarker.iYTsiz, sizMarker.iYOsiz ) );
  1292                                          Max( sizMarker.iYTOsiz + l * sizMarker.iYTsiz, sizMarker.iYOsiz ) );
  1285 
  1293 
  1286                 tileCanvas.iBr = TPoint( Min( sizMarker.iXTOsiz + ( m + 1 ) * sizMarker.iXTsiz, sizMarker.iXsiz ),
  1294                 tileCanvas.iBr = TPoint( Min( sizMarker.iXTOsiz + ( m + 1 ) * sizMarker.iXTsiz, sizMarker.iXsiz ),
  1287                                          Min( sizMarker.iYTOsiz + ( l + 1 ) * sizMarker.iYTsiz, sizMarker.iYsiz ) );
  1295                                          Min( sizMarker.iYTOsiz + ( l + 1 ) * sizMarker.iYTsiz, sizMarker.iYsiz ) );
  1288                 // Component canvas
  1296                 // Component canvas
  1289                 componentCanvas.iTl = TPoint( TJ2kUtils::Ceil( tileCanvas.iTl.iX, sizMarker.iXRsiz[compIndex] ),
  1297                 componentCanvas.iTl = TPoint( TJ2kUtils::CeilL( tileCanvas.iTl.iX, sizMarker.iXRsiz[compIndex] ),
  1290                                               TJ2kUtils::Ceil( tileCanvas.iTl.iY, sizMarker.iYRsiz[compIndex] ) );
  1298                                               TJ2kUtils::CeilL( tileCanvas.iTl.iY, sizMarker.iYRsiz[compIndex] ) );
  1291 
  1299 
  1292                 componentCanvas.iBr = TPoint( TJ2kUtils::Ceil( tileCanvas.iBr.iX, sizMarker.iXRsiz[compIndex] ),
  1300                 componentCanvas.iBr = TPoint( TJ2kUtils::CeilL( tileCanvas.iBr.iX, sizMarker.iXRsiz[compIndex] ),
  1293                                               TJ2kUtils::Ceil( tileCanvas.iBr.iY, sizMarker.iYRsiz[compIndex] ) );
  1301                                               TJ2kUtils::CeilL( tileCanvas.iBr.iY, sizMarker.iYRsiz[compIndex] ) );
  1294 
  1302 
  1295                 if ( m )
  1303                 if ( m )
  1296                     {
  1304                     {
  1297                     tileStart.iX = component->iTileStartList[tileIndex - 1].iX + useWidth;
  1305                     tileStart.iX = component->iTileStartList[tileIndex - 1].iX + useWidth;
  1298                     }
  1306                     }
  1545 
  1553 
  1546     CleanupStack::PopAndDestroy( aNumCSComp + 1 );
  1554     CleanupStack::PopAndDestroy( aNumCSComp + 1 );
  1547     }
  1555     }
  1548 
  1556 
  1549 // -----------------------------------------------------------------------------
  1557 // -----------------------------------------------------------------------------
  1550 // CJ2kImageWriter::WriteOutputFile
  1558 // CJ2kImageWriter::WriteOutputFileL
  1551 // Write the component to the single output file
  1559 // Write the component to the single output file
  1552 // (other items were commented in a header).
  1560 // (other items were commented in a header).
  1553 // -----------------------------------------------------------------------------
  1561 // -----------------------------------------------------------------------------
  1554 //
  1562 //
  1555 void CJ2kImageWriter::WriteOutputFile( CJ2kTileInfo& aTile,
  1563 void CJ2kImageWriter::WriteOutputFileL( CJ2kTileInfo& aTile,
  1556                                        TUint16 aCompIndex,
  1564                                        TUint16 aCompIndex,
  1557                                        const TSize& aSize,
  1565                                        const TSize& aSize,
  1558                                        TUint16 aBitDepth )
  1566                                        TUint16 aBitDepth )
  1559     {
  1567     {
  1560     TPrecInt* imageRow = 0;
  1568     TPrecInt* imageRow = 0;
  1563 
  1571 
  1564     TUint16 numLevels = aTile.ComponentAt( aCompIndex ).Levels();
  1572     TUint16 numLevels = aTile.ComponentAt( aCompIndex ).Levels();
  1565     TInt16 tempNumLevels = (TUint16)( numLevels - iImageInfo.LevelDrop() );
  1573     TInt16 tempNumLevels = (TUint16)( numLevels - iImageInfo.LevelDrop() );
  1566    
  1574    
  1567     TPoint tileStartCoord = currentComponent->TileStartAt( aTile.SotMarker().iIsot );
  1575     TPoint tileStartCoord = currentComponent->TileStartAt( aTile.SotMarker().iIsot );
  1568     currentComponent->UpdateNextTileStartAt( aTile.SotMarker().iIsot, aSize, iImageInfo );
  1576     currentComponent->UpdateNextTileStartAtL( aTile.SotMarker().iIsot, aSize, iImageInfo );
  1569 
  1577 
  1570     if ( tempNumLevels < 0 )
  1578     if ( tempNumLevels < 0 )
  1571         {
  1579         {
  1572    
  1580    
  1573         TInt32 i;
  1581         TInt32 i;
  1587             }
  1595             }
  1588         
  1596         
  1589         // Also take care of next tile's starting position
  1597         // Also take care of next tile's starting position
  1590         outputSize.iHeight /= stepSize;
  1598         outputSize.iHeight /= stepSize;
  1591         outputSize.iWidth /= stepSize;
  1599         outputSize.iWidth /= stepSize;
  1592         iComponents[0]->UpdateNextTileStartAt( aTile.SotMarker().iIsot, outputSize, iImageInfo );
  1600         iComponents[0]->UpdateNextTileStartAtL( aTile.SotMarker().iIsot, outputSize, iImageInfo );
  1593         }
  1601         }
  1594 
  1602 
  1595     TInt32 dcShift = 0;
  1603     TInt32 dcShift = 0;
  1596     TInt32 j = 0;
  1604     TInt32 j = 0;
  1597     if ( aBitDepth == 8 )
  1605     if ( aBitDepth == 8 )
  1667         SetPixelPos( tileStartCoord );
  1675         SetPixelPos( tileStartCoord );
  1668         }
  1676         }
  1669     }
  1677     }
  1670 
  1678 
  1671 // -----------------------------------------------------------------------------
  1679 // -----------------------------------------------------------------------------
  1672 // CJ2kImageWriter::CombineOutputFile
  1680 // CJ2kImageWriter::CombineOutputFileL
  1673 // Write all components of the tile to the single output file
  1681 // Write all components of the tile to the single output file
  1674 // (other items were commented in a header).
  1682 // (other items were commented in a header).
  1675 // -----------------------------------------------------------------------------
  1683 // -----------------------------------------------------------------------------
  1676 //
  1684 //
  1677 void CJ2kImageWriter::CombineOutputFile( CJ2kTileInfo& aTile, const TSize& aSize )
  1685 void CJ2kImageWriter::CombineOutputFileL( CJ2kTileInfo& aTile, const TSize& aSize )
  1678     {
  1686     {
  1679     TInt32 i = 0;
  1687     TInt32 i = 0;
  1680     TInt32 j = 0;
  1688     TInt32 j = 0;
  1681     TUint16 numLevels = aTile.ComponentAt( 0 ).Levels();
  1689     TUint16 numLevels = aTile.ComponentAt( 0 ).Levels();
  1682     TInt16 tempNumLevels = (TUint16)( numLevels - iImageInfo.LevelDrop() );
  1690     TInt16 tempNumLevels = (TUint16)( numLevels - iImageInfo.LevelDrop() );
  1683 
  1691 
  1684     TSize outputSize = aSize;
  1692     TSize outputSize = aSize;
  1685     TPoint& tileStartCoord = iComponents[0]->TileStartAt( aTile.SotMarker().iIsot );
  1693     TPoint& tileStartCoord = iComponents[0]->TileStartAt( aTile.SotMarker().iIsot );
  1686     iComponents[0]->UpdateNextTileStartAt( aTile.SotMarker().iIsot, outputSize, iImageInfo );
  1694     iComponents[0]->UpdateNextTileStartAtL( aTile.SotMarker().iIsot, outputSize, iImageInfo );
  1687 
  1695 
  1688     if ( tempNumLevels < 0 )
  1696     if ( tempNumLevels < 0 )
  1689         {
  1697         {
  1690         TInt32 stepSize = 1;
  1698         TInt32 stepSize = 1;
  1691     
  1699     
  1703             }
  1711             }
  1704         
  1712         
  1705         // Also take care of next tile's starting position
  1713         // Also take care of next tile's starting position
  1706         outputSize.iHeight /= stepSize;
  1714         outputSize.iHeight /= stepSize;
  1707         outputSize.iWidth /= stepSize;
  1715         outputSize.iWidth /= stepSize;
  1708         iComponents[0]->UpdateNextTileStartAt( aTile.SotMarker().iIsot, outputSize, iImageInfo );
  1716         iComponents[0]->UpdateNextTileStartAtL( aTile.SotMarker().iIsot, outputSize, iImageInfo );
  1709         
  1717         
  1710         tempNumLevels = 0;
  1718         tempNumLevels = 0;
  1711         }
  1719         }
  1712 
  1720 
  1713     TInt32 dcShift = 0;
  1721     TInt32 dcShift = 0;