digiKam
Digikam::ThumbnailCreator Class Reference

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)
 

Member Enumeration Documentation

◆ StorageMethod

Enumerator
FreeDesktopStandard 
ThumbnailDatabase 

Constructor & Destructor Documentation

◆ ThumbnailCreator() [1/2]

Digikam::ThumbnailCreator::ThumbnailCreator ( StorageMethod  method)
explicit

Create a thumbnail creator object. You must call setThumbnailSize before load.

References Digikam::ThumbnailCreator::Private::thumbnailStorage.

◆ ThumbnailCreator() [2/2]

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.

◆ ~ThumbnailCreator()

Digikam::ThumbnailCreator::~ThumbnailCreator ( )

Member Function Documentation

◆ deleteThumbnailsFromDisk()

void Digikam::ThumbnailCreator::deleteThumbnailsFromDisk ( const QString &  filePath) const

◆ errorString()

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.

◆ fileThumbnailInfo()

ThumbnailInfo Digikam::ThumbnailCreator::fileThumbnailInfo ( const QString &  path)
static

◆ identifierForDetail()

QString Digikam::ThumbnailCreator::identifierForDetail ( const ThumbnailInfo info,
const QRect &  rect 
)
static

Returns the customIdentifier for the detail thumbnail

References Digikam::ThumbnailIdentifier::filePath.

◆ load()

QImage Digikam::ThumbnailCreator::load ( const ThumbnailIdentifier identifier) const

Create a thumbnail for the specified file.

Referenced by Digikam::ThumbnailLoadingTask::execute(), loadDetail(), pregenerate(), and pregenerateDetail().

◆ loadDetail()

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().

◆ pregenerate()

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().

◆ pregenerateDetail()

void Digikam::ThumbnailCreator::pregenerateDetail ( const ThumbnailIdentifier identifier,
const QRect &  detailRect 
) const

◆ setExifRotate()

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.

◆ setLoadingProperties()

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.

◆ setOnlyLargeThumbnails()

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().

◆ setRemoveAlphaChannel()

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().

◆ setThumbnailInfoProvider()

void Digikam::ThumbnailCreator::setThumbnailInfoProvider ( ThumbnailInfoProvider *const  provider)

◆ setThumbnailSize()

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().

◆ store()

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().

◆ storeDetailThumbnail()

void Digikam::ThumbnailCreator::storeDetailThumbnail ( const QString &  path,
const QRect &  detailRect,
const QImage &  image 
) const

◆ storedSize()

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().

◆ thumbnailSize()

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().


The documentation for this class was generated from the following files: