tdf#125892 improve time to export PDF, use int ops for scaling

The time here is all in the nice rescaling we do these days. Speed it up
by using int ops instead of float ops.

This takes the time from 5m to 1m30 for me.

Change-Id: Ic1dcd9e49eef1894f4a4fdb416015b69c6ef96da
Reviewed-on: https://gerrit.libreoffice.org/74689
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx b/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx
index 389b2a3..25196d6 100644
--- a/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx
+++ b/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx
@@ -38,7 +38,7 @@
    const long aSourceSize,
    const long aDestinationSize,
    long& aNumberOfContributions,
    std::vector<double>& rWeights,
    std::vector<sal_Int16>& rWeights,
    std::vector<sal_Int32>& rPixels,
    std::vector<sal_Int32>& rCounts,
    const Kernel& aKernel)
@@ -76,7 +76,8 @@
            const long aPixelIndex(MinMax(j, 0, aSourceSize - 1));
            const long nIndex(aIndex + aCurrentCount);

            rWeights[nIndex] = aWeight;
            // scale the weight by 255 since we're converting from float to int
            rWeights[nIndex] = aWeight * 255;
            rPixels[nIndex] = aPixelIndex;

            aCurrentCount++;
@@ -102,7 +103,7 @@

    if(pReadAcc)
    {
        std::vector<double> aWeights;
        std::vector<sal_Int16> aWeights;
        std::vector<sal_Int32> aPixels;
        std::vector<sal_Int32> aCounts;
        long aNumberOfContributions(0);
@@ -122,15 +123,15 @@
                for(long x(0); x < nNewWidth; x++)
                {
                    const long aBaseIndex(x * aNumberOfContributions);
                    double aSum(0.0);
                    double aValueRed(0.0);
                    double aValueGreen(0.0);
                    double aValueBlue(0.0);
                    sal_Int32 aSum(0);
                    sal_Int32 aValueRed(0);
                    sal_Int32 aValueGreen(0);
                    sal_Int32 aValueBlue(0);

                    for(long j(0); j < aCounts[x]; j++)
                    {
                        const long aIndex(aBaseIndex + j);
                        const double aWeight(aWeights[aIndex]);
                        const sal_Int16 aWeight(aWeights[aIndex]);
                        BitmapColor aColor;

                        aSum += aWeight;
@@ -190,7 +191,7 @@

    if(pReadAcc)
    {
        std::vector<double> aWeights;
        std::vector<sal_Int16> aWeights;
        std::vector<sal_Int32> aPixels;
        std::vector<sal_Int32> aCounts;
        long aNumberOfContributions(0);
@@ -214,15 +215,15 @@
                for(long y(0); y < nNewHeight; y++)
                {
                    const long aBaseIndex(y * aNumberOfContributions);
                    double aSum(0.0);
                    double aValueRed(0.0);
                    double aValueGreen(0.0);
                    double aValueBlue(0.0);
                    sal_Int32 aSum(0);
                    sal_Int32 aValueRed(0);
                    sal_Int32 aValueGreen(0);
                    sal_Int32 aValueBlue(0);

                    for(long j(0); j < aCounts[y]; j++)
                    {
                        const long aIndex(aBaseIndex + j);
                        const double aWeight(aWeights[aIndex]);
                        const sal_Int16 aWeight(aWeights[aIndex]);
                        aSum += aWeight;
                        const BitmapColor & aColor = aScanline[aPixels[aIndex]];
                        aValueRed += aWeight * aColor.GetRed();