Image Scaling in the GUI (for 3.7)

Tomaž Vajngerl quikee at gmail.com
Mon Jun 25 13:34:51 PDT 2012


Hi,

Now that we have higher quality scaling algorithms on Bitmap, which
are used for PDF export, I wanted to do the same in the GUI. I
discovered that "grfmgr" is responsible for scaling when displaying
images on the GUI, but it has its own functions for scaling. So I
started to work on removing the scaling used in grfmgr and use
Bitmap::Scale instead. Meanwhile Luboš Luňák enabled Bitmap::Scale
(baca49fdda5e350b7b0f122d50739ee98cc6fe25) in a similar way I did at
first, but this solution does not work well when zooming and the image
must actually be croped to the display rectangle first. I have
addressed this issue in commit
764525b39c78bfad1f6fc44a8517a565547f67cf, cleaned up the CreateOutput
function and have additionally removed the scaling found in "grfmgr".

There are still some issues that I have found and need to be resolved:
- Scaling is not so good when upscaling (can be seen at higher zoom
levels), I need to check this in Bitmap::Scale to improve this.
- Scaling is bad when dealing with transparent images.
- There are some artifacts when rotating an image at arbitrary angles.
- Scaling performance could be better - BMP_SCALE_BOX is faster and
may be better for use on the GUI, however the same path is used for
Export. Another idea is to combine scale and crop to speed up
processing for certain scenarios (zoom).

If someone finds other problems please report them to me. Thanks.

Comments?

Regards,
Tomaž


More information about the LibreOffice mailing list