protected void writeFull ( ) { byte [ ] imageData = rawImage . getData ( ) ; int numOfComponents = frameHeader . getNf ( ) ; int [ ] pixes = new int [ numOfComponents * DCTSIZE2 ] ; int blockIndex = 0 ; int startCoordinate = 0 , scanlineStride = numOfComponents * rawImage . getWidth ( ) , row = 0 ; x = 0 ; y = 0 ; for ( int m = 0 ; m < MCUsPerColumn * MCUsPerRow ; m ++ ) { blockIndex = 0 ; // one MCU for ( int v = 0 ; v < maxVSampleFactor ; v ++ ) { for ( int h = 0 ; h < maxHSampleFactor ; h ++ ) { row = y + 1 ; startCoordinate = ( y * rawImage . getWidth ( ) + x ) * numOfComponents ; // one block for ( int k = blockIndex * DCTSIZE2 , i = 0 ; k < blockIndex * DCTSIZE2 + DCTSIZE2 ; k ++ ) { pixes [ i ++ ] = allMCUDatas [ 0 ] [ m ] [ k ] ; if ( numOfComponents > 1 ) { pixes [ i ++ ] = allMCUDatas [ 1 ] [ m ] [ k ] ; pixes [ i ++ ] = allMCUDatas [ 2 ] [ m ] [ k ] ; } if ( numOfComponents > 3 ) { pixes [ i ++ ] = allMCUDatas [ 3 ] [ m ] [ k ] ; } x ++ ; if ( x % 8 == 0 ) { y ++ ; x -= 8 ; } } colorConvertor . convertBlock ( pixes , 0 , imageData , numOfComponents , startCoordinate , row , scanlineStride ) ; blockIndex ++ ; x += 8 ; y -= 8 ; } x -= maxHSampleFactor * 8 ; y += 8 ; } x += maxHSampleFactor * 8 ; y -= maxVSampleFactor * 8 ; if ( x >= rawImage . getWidth ( ) ) { x = 0 ; y += maxVSampleFactor * 8 ; } } }
Used by progressive mode