15 Commits

Author SHA1 Message Date
Nyall Dawson
bc90217bc0 Add method to prepare animated images in advance, by extracting
all frames from the animation to a temporary directory

This avoids lengthy delays when trying to render a specific frame
from the animation, as most animation formats require us to
iterate through all preceding frames in order to retrieve a specific
frame. By iterating once in advance and saving the results out we
gain instant access to any individual frame from the animation.
2022-04-27 05:57:21 +10:00
Nyall Dawson
0aad51c6d4 Base default image cache size on system memory
Instead of always defaulting to 100mb, then base the cache size
on the system memory:

- > 32gb, use 500mb
- 16-32gb, use 250mb
- else 100mb

The larger sizes can make a big difference to rendering speed for
complex projects, so let's let powerful systems utilise all that
memory!

(Only supported on linux for now)
2022-04-04 19:12:11 +10:00
Nyall Dawson
3e2467d3f3 Add method to retrieve next frame delay for animated images to QgsImageCache 2022-03-28 06:16:02 +10:00
Nyall Dawson
8b16383ff0 [api] Add support for reading individual frames from animated image
formats (gif/mng/webp) to QgsImageCache

The frames are correctly cached in the image cache, resulting in
super speedy retrieval after the first render
2022-03-08 13:49:24 +10:00
Nyall Dawson
c3ac518912 Spelling 2021-09-28 08:57:44 +10:00
Nyall Dawson
51cb63feec Add a target dpi argument to QgsImageCache
This allows callers to specify the desired rendering resolution of the
image when they aren't explicitly requesting a preset image size.

It can be used for image drivers for formats which don't have a fixed
size (e.g. pdf) so that the image is rendered in the desired resolution.
2021-09-28 08:57:44 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
rldhont
6625c7ba62 [Bugfix] Get remote SVG synchronously - in the server context 2019-10-11 14:08:17 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
nirvn
60442980dd Add dox comment, fix travis 2018-12-05 11:14:13 +07:00
nirvn
ad4b876866 Add opacity parameter to image cache 2018-12-05 11:14:13 +07:00
Nyall Dawson
c1df802769 Add method to QgsImageCache to retrieve original image size 2018-12-05 11:14:13 +07:00
Nyall Dawson
84838d1ec6 [FEATURE][API] Add a content cache for raster images
This new class QgsImageCache is the equivalent of QgsSvgCache
but for raster images.

QgsImageCache stores pre-rendered resampled versions of raster
image files, allowing efficient reuse without incurring the
cost of resampling on every render.

Additionally, it offers the other benefits QgsSvgCache has,
such as thread safety, ability to transparently download remote
images, and support for base64 encoded strings.
2018-12-05 11:14:13 +07:00