summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-29 14:12:57 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-29 21:47:10 +0100
commitf06d75ae96a1b54207cb2cf9aecf35b4d29c2e59 (patch)
treef69e53e34c16133cefb0f3e0afb5a2e02f02031e /filter
parent8d1d82dd63eada8faa2f6eb43ef900764a5fda62 (diff)
ofz: optimize ras filter a titch
Change-Id: Iabfbfa8d6beddb04ab26c4f8f05996b5e2daa24a Reviewed-on: https://gerrit.libreoffice.org/48840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/iras/iras.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx
index 78670d0f3287..810915dc09a7 100644
--- a/filter/source/graphicfilter/iras/iras.cxx
+++ b/filter/source/graphicfilter/iras/iras.cxx
@@ -239,6 +239,7 @@ bool RASReader::ImplReadBody(BitmapWriteAccess * pAcc)
sal_uInt8 nDat = 0;
for (y = 0; y < mnHeight && mbStatus; ++y)
{
+ Scanline pScanline = pAcc->GetScanline(y);
for (x = 0; x < mnWidth && mbStatus; ++x)
{
if (!(x & 7))
@@ -247,9 +248,9 @@ bool RASReader::ImplReadBody(BitmapWriteAccess * pAcc)
if (!m_rRAS.good())
mbStatus = false;
}
- pAcc->SetPixelIndex( y, x,
+ pAcc->SetPixelOnData(pScanline, x, BitmapColor(
sal::static_int_cast< sal_uInt8 >(
- nDat >> ( ( x & 7 ) ^ 7 )) );
+ nDat >> ( ( x & 7 ) ^ 7 )) ));
}
if (!( ( x - 1 ) & 0x8 ) )
{
@@ -264,10 +265,11 @@ bool RASReader::ImplReadBody(BitmapWriteAccess * pAcc)
case 8 :
for (y = 0; y < mnHeight && mbStatus; ++y)
{
+ Scanline pScanline = pAcc->GetScanline(y);
for (x = 0; x < mnWidth && mbStatus; ++x)
{
sal_uInt8 nDat = ImplGetByte();
- pAcc->SetPixelIndex( y, x, nDat );
+ pAcc->SetPixelOnData(pScanline, x, BitmapColor(nDat));
if (!m_rRAS.good())
mbStatus = false;
}
@@ -287,6 +289,7 @@ bool RASReader::ImplReadBody(BitmapWriteAccess * pAcc)
case 24 :
for (y = 0; y < mnHeight && mbStatus; ++y)
{
+ Scanline pScanline = pAcc->GetScanline(y);
for (x = 0; x < mnWidth && mbStatus; ++x)
{
if ( mnType == RAS_TYPE_RGB_FORMAT )
@@ -301,7 +304,7 @@ bool RASReader::ImplReadBody(BitmapWriteAccess * pAcc)
nGreen = ImplGetByte();
nRed = ImplGetByte();
}
- pAcc->SetPixel ( y, x, BitmapColor( nRed, nGreen, nBlue ) );
+ pAcc->SetPixelOnData(pScanline, x, BitmapColor(nRed, nGreen, nBlue));
if (!m_rRAS.good())
mbStatus = false;
}
@@ -317,6 +320,7 @@ bool RASReader::ImplReadBody(BitmapWriteAccess * pAcc)
case 32 :
for (y = 0; y < mnHeight && mbStatus; ++y)
{
+ Scanline pScanline = pAcc->GetScanline(y);
for (x = 0; x < mnWidth && mbStatus; ++x)
{
ImplGetByte(); // pad byte > nil
@@ -332,7 +336,7 @@ bool RASReader::ImplReadBody(BitmapWriteAccess * pAcc)
nGreen = ImplGetByte();
nRed = ImplGetByte();
}
- pAcc->SetPixel ( y, x, BitmapColor( nRed, nGreen, nBlue ) );
+ pAcc->SetPixelOnData(pScanline, x, BitmapColor(nRed, nGreen, nBlue));
if (!m_rRAS.good())
mbStatus = false;
}