diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2018-01-30 20:40:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-06 07:39:11 +0100 |
commit | 3e0efdb50cd9bcf1749993607330ea1567eb33a2 (patch) | |
tree | c740dfc9b598480d5168282154045bbc938f6862 /filter/source/graphicfilter/ipsd/ipsd.cxx | |
parent | f38e35338e3010f137d7b35fa3150792fabfa825 (diff) |
convert SetPixel->SetPixelOnData
by extracting out the Y scanline computation from the innermost
loop.
Inspired by commit 078d01c1b6cb9bbd80aeadc49a71cc817413164c.
Change-Id: Ic3c1827c01ed3aec629975749a551c7a68ae4a5e
Reviewed-on: https://gerrit.libreoffice.org/48926
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter/source/graphicfilter/ipsd/ipsd.cxx')
-rw-r--r-- | filter/source/graphicfilter/ipsd/ipsd.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 9f08f4dd8c93..f8f53ccfaf1f 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -672,6 +672,7 @@ bool PSDReader::ImplReadBody() for ( nY = 0; nY < mpFileHeader->nRows; nY++ ) { + Scanline pScanline = mpWriteAcc->GetScanline( nY ); for ( nX = 0; nX < mpFileHeader->nColumns; nX++ ) { sal_Int32 nDAT = pBlack[ nX + nY * mpFileHeader->nColumns ] * ( nBlackMax - 256 ) / 0x1ff; @@ -680,7 +681,7 @@ bool PSDReader::ImplReadBody() sal_uInt8 cR = static_cast<sal_uInt8>(MinMax( aBitmapColor.GetRed() - nDAT, 0L, 255L )); sal_uInt8 cG = static_cast<sal_uInt8>(MinMax( aBitmapColor.GetGreen() - nDAT, 0L, 255L )); sal_uInt8 cB = static_cast<sal_uInt8>(MinMax( aBitmapColor.GetBlue() - nDAT, 0L, 255L )); - mpWriteAcc->SetPixel( nY, nX, BitmapColor( cR, cG, cB ) ); + mpWriteAcc->SetPixelOnData( pScanline, nX, BitmapColor( cR, cG, cB ) ); } } } |