Scribus image cache proxy.
More...
#include <scimagecacheproxy.h>
|
| ScImageCacheProxy (const QString &fn) |
| Construct a cache proxy object. More...
|
|
bool | enabled () const |
| Check if the image cache is enabled.
|
|
const QString & | getFilename () const |
| Get original image file name.
|
|
bool | load (QImage &image) |
| Load image from cache. More...
|
|
bool | save (const QImage &image) |
| Save image to cache. More...
|
|
bool | touch () const |
| Touch an image in the cache. More...
|
|
void | addMetadata (const QString &key, const QString &value) |
| Add or overwrite image metadata.
|
|
void | addModifier (const QString &key, const QString &value) |
| Add or overwrite an image modifier.
|
|
void | delModifier (const QString &key) |
| Delete an image modifier.
|
|
bool | canUseCachedImage () const |
| Check if the cached image can be used in place of the original. More...
|
|
void | addInfo (const QString &key, const QString &value) |
| Add image information.
|
|
QString | getInfo (const QString &key) const |
| Retrieve image information.
|
|
|
static QString | getBaseName (const QString &metafile) |
| Get base name of reference/image file from meta file. More...
|
|
static bool | getRefCount (const QString &reffile, int &refcount) |
| Get reference count from a reference file. More...
|
|
static bool | fixRefCount (const QString &reffile, int refcount) |
| Set reference count in a reference file. More...
|
|
static bool | removeCacheEntry (const QString &metafile, bool haveMasterLock=false) |
| Remove an entry from the image cache. More...
|
|
Scribus image cache proxy.
- Author
- Marcus Holland-Moritz
ScImageCacheProxy::ScImageCacheProxy |
( |
const QString & |
fn | ) |
|
Construct a cache proxy object.
- Parameters
-
fn | Full path to the original image file |
bool ScImageCacheProxy::canUseCachedImage |
( |
| ) |
const |
Check if the cached image can be used in place of the original.
- Returns
true
if the cached image can be used, false
otherwise
bool ScImageCacheProxy::fixRefCount |
( |
const QString & |
reffile, |
|
|
int |
refcount |
|
) |
| |
|
static |
Set reference count in a reference file.
- Parameters
-
reffile | Path to reference file relative to the cache root directory |
refcount | The reference count to write to the file |
- Returns
true
if the reference count could be written, false
otherwise
QString ScImageCacheProxy::getBaseName |
( |
const QString & |
metafile | ) |
|
|
static |
Get base name of reference/image file from meta file.
- Parameters
-
metafile | Path to meta file relative to the cache root directory |
- Returns
- Reference/image file basename, i.e. path and filename without the suffix
bool ScImageCacheProxy::getRefCount |
( |
const QString & |
reffile, |
|
|
int & |
refcount |
|
) |
| |
|
static |
Get reference count from a reference file.
- Parameters
-
reffile | Path to reference file relative to the cache root directory |
refcount | Reference to the variable receiving the reference counter |
- Returns
true
if the reference count could be read, false
otherwise
bool ScImageCacheProxy::load |
( |
QImage & |
image | ) |
|
Load image from cache.
- Parameters
-
image | QImage object to which to load the cached image |
- Returns
true
if the image could be loaded, false
otherwise
bool ScImageCacheProxy::removeCacheEntry |
( |
const QString & |
metafile, |
|
|
bool |
haveMasterLock = false |
|
) |
| |
|
static |
Remove an entry from the image cache.
Attempts to remove a meta file from the image cache. Decrements the reference counter of the referenced image. If the reference counter drops to zero, the image and its reference file will also be removed.
- Parameters
-
metafile | Path to meta file relative to the cache root directory |
haveMasterLock | true if a master lock has already been acquired |
- Returns
true
if the reference count could be written, false
otherwise
bool ScImageCacheProxy::save |
( |
const QImage & |
image | ) |
|
Save image to cache.
- Parameters
-
image | QImage object from which to save the cached image |
- Returns
true
if the image could be saved, false
otherwise
bool ScImageCacheProxy::touch |
( |
| ) |
const |
Touch an image in the cache.
- Returns
true
if the image could be touched, false
otherwise
The documentation for this class was generated from the following files:
- /Users/ale/src/Scribus/scribus/scimagecacheproxy.h
- /Users/ale/src/Scribus/scribus/scimagecacheproxy.cpp