Kaydet (Commit) 101e1cce authored tarafından Armin Le Grand's avatar Armin Le Grand

Small correction in scaling code seen while debugging something else

üst e0705e2a
...@@ -2481,29 +2481,42 @@ sal_Bool Bitmap::ImplScaleConvolution( ...@@ -2481,29 +2481,42 @@ sal_Bool Bitmap::ImplScaleConvolution(
{ {
const sal_uInt32 nInBetweenSizeHorFirst(nHeight * nNewWidth); const sal_uInt32 nInBetweenSizeHorFirst(nHeight * nNewWidth);
const sal_uInt32 nInBetweenSizeVerFirst(nNewHeight * nWidth); const sal_uInt32 nInBetweenSizeVerFirst(nNewHeight * nWidth);
Bitmap aSource(*this);
if(nInBetweenSizeHorFirst < nInBetweenSizeVerFirst) if(nInBetweenSizeHorFirst < nInBetweenSizeVerFirst)
{ {
if(bScaleHor) if(bScaleHor)
{ {
bResult = ImplScaleConvolutionHor(*this, aResult, fScaleX, aKernel); bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX, aKernel);
} }
if(bResult && bScaleVer) if(bResult && bScaleVer)
{ {
bResult = ImplScaleConvolutionVer(*this, aResult, fScaleY, aKernel); if(bScaleHor)
{
// copy partial result, independent of color depth
aSource = aResult;
}
bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY, aKernel);
} }
} }
else else
{ {
if(bScaleVer) if(bScaleVer)
{ {
bResult = ImplScaleConvolutionVer(*this, aResult, fScaleY, aKernel); bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY, aKernel);
} }
if(bResult && bScaleHor) if(bResult && bScaleHor)
{ {
bResult = ImplScaleConvolutionHor(*this, aResult, fScaleX, aKernel); if(bScaleVer)
{
// copy partial result, independent of color depth
aSource = aResult;
}
bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX, aKernel);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment