digiKam
|
Classes | |
class | Private |
Public Types | |
enum | StorageMethod { FreeDesktopStandard , ThumbnailDatabase } |
Public Member Functions | |
void | deleteThumbnailsFromDisk (const QString &filePath) const |
QString | errorString () const |
QImage | load (const ThumbnailIdentifier &identifier) const |
QImage | loadDetail (const ThumbnailIdentifier &identifier, const QRect &detailRect) const |
void | pregenerate (const ThumbnailIdentifier &identifier) const |
void | pregenerateDetail (const ThumbnailIdentifier &identifier, const QRect &detailRect) const |
void | setExifRotate (bool rotate) |
void | setLoadingProperties (DImgLoaderObserver *const observer, const DRawDecoding &settings) |
void | setOnlyLargeThumbnails (bool onlyLarge) |
void | setRemoveAlphaChannel (bool removeAlpha) |
void | setThumbnailInfoProvider (ThumbnailInfoProvider *const provider) |
void | setThumbnailSize (int thumbnailSize) |
void | store (const QString &path, const QImage &image) const |
void | storeDetailThumbnail (const QString &path, const QRect &detailRect, const QImage &image) const |
int | storedSize () const |
ThumbnailCreator (int thumbnailSize, StorageMethod method) | |
ThumbnailCreator (StorageMethod method) | |
int | thumbnailSize () const |
~ThumbnailCreator () | |
Static Public Member Functions | |
static ThumbnailInfo | fileThumbnailInfo (const QString &path) |
static QString | identifierForDetail (const ThumbnailInfo &info, const QRect &rect) |
|
explicit |
Create a thumbnail creator object. You must call setThumbnailSize before load.
References Digikam::ThumbnailCreator::Private::thumbnailStorage.
Digikam::ThumbnailCreator::ThumbnailCreator | ( | int | thumbnailSize, |
StorageMethod | method | ||
) |
Create a thumbnail creator object, and set the thumbnail size.
References setThumbnailSize(), thumbnailSize(), and Digikam::ThumbnailCreator::Private::thumbnailStorage.
Digikam::ThumbnailCreator::~ThumbnailCreator | ( | ) |
void Digikam::ThumbnailCreator::deleteThumbnailsFromDisk | ( | const QString & | filePath | ) | const |
Deletes all available thumbnails from the on-disk thumbnail cache. A subsequent call to load() will recreate the thumbnail.
References fileThumbnailInfo(), FreeDesktopStandard, Digikam::ThumbnailCreator::Private::infoProvider, ThumbnailDatabase, Digikam::ThumbnailInfoProvider::thumbnailInfo(), and Digikam::ThumbnailCreator::Private::thumbnailStorage.
Referenced by Digikam::ThumbnailLoadThread::deleteThumbnail().
QString Digikam::ThumbnailCreator::errorString | ( | ) | const |
Returns the last error that occurred. It is valid if load returned a null QImage object.
References Digikam::ThumbnailCreator::Private::error.
|
static |
Creates a default ThumbnailInfo for the given path using QFileInfo only
References Digikam::ThumbnailInfo::fileName, Digikam::ThumbnailIdentifier::filePath, Digikam::ThumbnailInfo::isAccessible, Digikam::ThumbnailInfo::mimeType, Digikam::ThumbnailInfo::modificationDate, and suffix.
Referenced by deleteThumbnailsFromDisk(), and Digikam::ThumbsDbInfoProvider::thumbnailInfo().
|
static |
Returns the customIdentifier for the detail thumbnail
References Digikam::ThumbnailIdentifier::filePath.
QImage Digikam::ThumbnailCreator::load | ( | const ThumbnailIdentifier & | identifier | ) | const |
Create a thumbnail for the specified file.
Referenced by Digikam::ThumbnailLoadingTask::execute(), loadDetail(), pregenerate(), and pregenerateDetail().
QImage Digikam::ThumbnailCreator::loadDetail | ( | const ThumbnailIdentifier & | identifier, |
const QRect & | detailRect | ||
) | const |
Creates a thumbnail for the specified detail of the file. A suitable custom identifier (for cache key etc.) is inserted as image.text("customIdentifier").
References load().
Referenced by Digikam::ThumbnailLoadingTask::execute().
void Digikam::ThumbnailCreator::pregenerate | ( | const ThumbnailIdentifier & | identifier | ) | const |
Ensures that the thumbnail is pregenerated in the database, but does not load it from there.
References load().
Referenced by Digikam::ThumbnailLoadingTask::execute().
void Digikam::ThumbnailCreator::pregenerateDetail | ( | const ThumbnailIdentifier & | identifier, |
const QRect & | detailRect | ||
) | const |
References load().
Referenced by Digikam::ThumbnailLoadingTask::execute().
void Digikam::ThumbnailCreator::setExifRotate | ( | bool | rotate | ) |
Set the Exif rotation property. If exifRotate is true, the thumbnail will be rotated according to the Exif information. Default value is true.
References Digikam::ThumbnailCreator::Private::exifRotate.
void Digikam::ThumbnailCreator::setLoadingProperties | ( | DImgLoaderObserver *const | observer, |
const DRawDecoding & | settings | ||
) |
If you plan to load thumbnail from the context of the threadimageio framework, you can specify the relevant parameters. They will be passed if a thumbnail is created by loading with DImg. Note that DImg is not used in most cases (Raw files, JPEG)
References Digikam::ThumbnailCreator::Private::observer, and Digikam::ThumbnailCreator::Private::rawSettings.
void Digikam::ThumbnailCreator::setOnlyLargeThumbnails | ( | bool | onlyLarge | ) |
If you enable this property, the thumbnail creator will create only large thumbnails on disk (256x256 as described in FreeDesktop paper). Normally, for requested sizes below 128, thumbnails of 128x128 will be cached on disk. Default value is false.
References Digikam::ThumbnailCreator::Private::onlyLargeThumbnails.
Referenced by Digikam::ThumbnailLoadThread::ThumbnailLoadThread().
void Digikam::ThumbnailCreator::setRemoveAlphaChannel | ( | bool | removeAlpha | ) |
If you enable this property, the returned QImage objects will not have an alpha channel. Images with transparency will be blended over an opaque background.
References Digikam::ThumbnailCreator::Private::removeAlphaChannel.
Referenced by Digikam::ThumbnailLoadThread::ThumbnailLoadThread().
void Digikam::ThumbnailCreator::setThumbnailInfoProvider | ( | ThumbnailInfoProvider *const | provider | ) |
Set a ThumbnailInfoProvider to provide custom ThumbnailInfos
References Digikam::ThumbnailCreator::Private::infoProvider.
Referenced by Digikam::ThumbnailLoadThread::deleteThumbnail(), and Digikam::ThumbnailLoadThread::ThumbnailLoadThread().
void Digikam::ThumbnailCreator::setThumbnailSize | ( | int | thumbnailSize | ) |
Sets the thumbnail size. This is the maximum size of the QImage returned by load.
References thumbnailSize(), and Digikam::ThumbnailCreator::Private::thumbnailSize.
Referenced by Digikam::ThumbnailLoadThread::setThumbnailSize(), and ThumbnailCreator().
void Digikam::ThumbnailCreator::store | ( | const QString & | path, |
const QImage & | image | ||
) | const |
Store the given image as thumbnail of the given path. Image should at least have storedSize().
Referenced by storeDetailThumbnail().
void Digikam::ThumbnailCreator::storeDetailThumbnail | ( | const QString & | path, |
const QRect & | detailRect, | ||
const QImage & | image | ||
) | const |
References store().
Referenced by Digikam::ThumbnailLoadThread::storeDetailThumbnail().
int Digikam::ThumbnailCreator::storedSize | ( | ) | const |
Return the stored image size, the size of the image that is stored on disk (according to Storage Method). This size is possibly larger than thumbnailSize. Possible values: 128 or 256.
References Digikam::ThumbnailCreator::Private::storageSize().
Referenced by Digikam::ThumbnailLoadThread::storedSize().
int Digikam::ThumbnailCreator::thumbnailSize | ( | ) | const |
Return the thumbnail size, the maximum size of the QImage returned by load.
References Digikam::ThumbnailCreator::Private::thumbnailSize.
Referenced by setThumbnailSize(), and ThumbnailCreator().