|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/qgsimagecache.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +class QgsImageCache : QgsAbstractContentCacheBase |
| 15 | +{ |
| 16 | +%Docstring |
| 17 | +A cache for images derived from raster files. |
| 18 | + |
| 19 | +QgsImageCache stores pre-rendered resampled versions of raster image files, allowing efficient |
| 20 | +reuse without incurring the cost of resampling on every render. |
| 21 | + |
| 22 | +QgsImageCache is not usually directly created, but rather accessed through |
| 23 | +:py:func:`QgsApplication.imageCache()` |
| 24 | + |
| 25 | +.. versionadded:: 3.6 |
| 26 | +%End |
| 27 | + |
| 28 | +%TypeHeaderCode |
| 29 | +#include "qgsimagecache.h" |
| 30 | +%End |
| 31 | + public: |
| 32 | + |
| 33 | + QgsImageCache( QObject *parent /TransferThis/ = 0 ); |
| 34 | +%Docstring |
| 35 | +Constructor for QgsImageCache, with the specified ``parent`` object. |
| 36 | +%End |
| 37 | + |
| 38 | + QImage pathAsImage( const QString &path, QSize size, bool keepAspectRatio, bool &fitsInCache /Out/ ); |
| 39 | +%Docstring |
| 40 | +Returns the specified ``path`` rendered as an image. If possible, a pre-existing cached |
| 41 | +version of the image will be used. If not, the image is fetched and resampled to the desired |
| 42 | +size, and then the result cached for subsequent lookups. |
| 43 | + |
| 44 | +``path`` may be a local file, remote (HTTP) url, or a base 64 encoded string (with a "base64:" prefix). |
| 45 | + |
| 46 | +The ``size`` parameter dictates the target size of the image. An invalid size indicates the |
| 47 | +original raster image size (with no resampling). |
| 48 | + |
| 49 | +If ``keepAspectRatio`` is true, then the original raster aspect ratio will be maintained during |
| 50 | +any resampling operations. |
| 51 | + |
| 52 | +If the resultant raster was of a sufficiently small size to store in the cache, then ``fitsInCache`` |
| 53 | +will be set to true. |
| 54 | +%End |
| 55 | + |
| 56 | + signals: |
| 57 | + |
| 58 | + void remoteImageFetched( const QString &url ); |
| 59 | +%Docstring |
| 60 | +Emitted when the cache has finished retrieving an image file from a remote ``url``. |
| 61 | +%End |
| 62 | + |
| 63 | +}; |
| 64 | + |
| 65 | +/************************************************************************ |
| 66 | + * This file has been generated automatically from * |
| 67 | + * * |
| 68 | + * src/core/qgsimagecache.h * |
| 69 | + * * |
| 70 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 71 | + ************************************************************************/ |
0 commit comments