diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-10-24 06:48:31 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-10-24 06:48:31 +0000 |
commit | 25ee55f91cc29e5797268ef22e96a7a0d72d59ba (patch) | |
tree | e66f9532a7e31bbf410bcd626f8d49c9726362f7 /vcl/source/gdi/pngread.cxx | |
parent | 384b62be71760cb8e2159da8402303df5b7a013b (diff) |
INTEGRATION: CWS impress69 (1.9.80); FILE MERGED
2005/10/14 22:40:50 af 1.9.80.2: RESYNC: (1.9-1.11); FILE MERGED
2005/09/13 15:18:03 sj 1.9.80.1: #i54556# trying to use full scanlines when possible
Diffstat (limited to 'vcl/source/gdi/pngread.cxx')
-rw-r--r-- | vcl/source/gdi/pngread.cxx | 56 |
1 files changed, 44 insertions, 12 deletions
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index ec90dc4b0fe9..0496a093cafc 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -4,9 +4,9 @@ * * $RCSfile: pngread.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: hr $ $Date: 2005-09-23 13:55:35 $ + * last change: $Author: rt $ $Date: 2005-10-24 07:48:31 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1220,8 +1220,13 @@ void PNGReaderImpl::ImplGetFilter ( sal_uInt32 nXStart, sal_uInt32 nXAdd ) { if ( mnBitDepth == 8 ) // maybe the source is a 16 bit grayscale { - for ( nX = nXStart; nX < mnWidth; nX += nXAdd ) - ImplSetPixel( nY, nX, *pTmp++, FALSE ); + if ( mnPass == 7 ) // mnPass == 7 -> no interlace or whole scanline is available + mpAcc->CopyScanline( nY, pTmp, BMP_FORMAT_8BIT_PAL, mnScansize -1 ); + else + { + for ( nX = nXStart; nX < mnWidth; nX += nXAdd ) + ImplSetPixel( nY, nX, *pTmp++, FALSE ); + } } else { @@ -1246,10 +1251,23 @@ void PNGReaderImpl::ImplGetFilter ( sal_uInt32 nXStart, sal_uInt32 nXAdd ) { if ( mnBitDepth == 8 ) // maybe the source is a 16 bit each sample { - for ( nX = nXStart; nX < mnWidth; nX += nXAdd, pTmp += 4 ) - ImplSetAlphaPixel( nY, nX, BitmapColor( mpColorTable[ pTmp[ 0 ] ], - mpColorTable[ pTmp[ 1 ] ], - mpColorTable[ pTmp[ 2 ] ] ), pTmp[ 3 ] ); + if ( mpColorTable != mpDefaultColorTable ) + { + for ( nX = nXStart; nX < mnWidth; nX += nXAdd, pTmp += 4 ) + ImplSetAlphaPixel( nY, nX, BitmapColor( mpColorTable[ pTmp[ 0 ] ], + mpColorTable[ pTmp[ 1 ] ], + mpColorTable[ pTmp[ 2 ] ] ), pTmp[ 3 ] ); + } + else + { +// if ( mnPass == 7 ) // mnPass == 7 -> no interlace or whole scanline is available +// mpAcc->CopyScanline( nY, pTmp, BMP_FORMAT_32BIT_TC_RGBA, mnScansize -1 ); +// else + { + for ( nX = nXStart; nX < mnWidth; nX += nXAdd, pTmp += 4 ) + ImplSetAlphaPixel( nY, nX, BitmapColor( pTmp[ 0 ], pTmp[ 1 ], pTmp[ 2 ] ), pTmp[ 3 ] ); + } + } } else { @@ -1302,10 +1320,24 @@ void PNGReaderImpl::ImplGetFilter ( sal_uInt32 nXStart, sal_uInt32 nXAdd ) { if ( mnBitDepth == 8 ) // maybe the source is a 16 bit each sample { - for ( nX = nXStart; nX < mnWidth; nX += nXAdd, pTmp += 3 ) - ImplSetPixel( nY, nX, BitmapColor( mpColorTable[ pTmp[ 0 ] ], - mpColorTable[ pTmp[ 1 ] ], - mpColorTable[ pTmp[ 2 ] ] ), FALSE ); + if ( mpColorTable != mpDefaultColorTable ) + { + for ( nX = nXStart; nX < mnWidth; nX += nXAdd, pTmp += 3 ) + ImplSetPixel( nY, nX, BitmapColor( mpColorTable[ pTmp[ 0 ] ], + mpColorTable[ pTmp[ 1 ] ], + mpColorTable[ pTmp[ 2 ] ] ), FALSE ); + } + else + { + if ( mnPass == 7 ) // mnPass == 7 -> no interlace or whole scanline is available + mpAcc->CopyScanline( nY, pTmp, BMP_FORMAT_24BIT_TC_RGB, mnScansize -1 ); + else + { + for ( nX = nXStart; nX < mnWidth; nX += nXAdd, pTmp += 3 ) + ImplSetPixel( nY, nX, BitmapColor( pTmp[ 0 ], pTmp[ 1 ], pTmp[ 2 ] ), FALSE ); + } + + } } else { |