digiKam
|
Classes | |
class | Private |
Public Slots | |
void | cancel () |
void | setActive (bool active) |
Public Member Functions | |
int | enqueue () |
void | setThumbnailLoadThread (ThumbnailLoadThread *const thread) |
ThumbnailLoadThread * | thread () const |
ThumbnailImageCatcher (QObject *const parent=nullptr) | |
ThumbnailImageCatcher (ThumbnailLoadThread *const thread, QObject *const parent=nullptr) | |
QList< QImage > | waitForThumbnails () |
~ThumbnailImageCatcher () override | |
Protected Slots | |
void | slotThumbnailLoaded (const LoadingDescription &, const QImage &) |
|
explicit |
Use this class to get a thumbnail synchronously.
Note: Not meant for loading QPixmap thumbnails.
|
explicit |
References setThumbnailLoadThread(), and thread().
|
override |
|
slot |
If the catcher is waiting in waitForThumbnails() in a different thread, cancels the waiting. The results will be returned as received so far.
References Digikam::ThumbnailImageCatcher::Private::condVar, Digikam::ThumbnailImageCatcher::Private::mutex, Digikam::ThumbnailImageCatcher::Private::Quitting, Digikam::ThumbnailImageCatcher::Private::state, and Digikam::ThumbnailImageCatcher::Private::Waiting.
Referenced by Digikam::FaceItemRetriever::cancel(), and setActive().
int Digikam::ThumbnailImageCatcher::enqueue | ( | ) |
After requesting a thumbnail from the thread, call enqueue() each time. Enqueue records the requested loading operation in an internal list. A loading operation can result in the return of more than one thumbnail, so enqueue() returns the number of expected results. Then call waitForThumbnails. The returned list is the sum of previous calls to enqueue, one entry per expected result, in order. If stopped prematurely or loading failed, the respective entries will be null.
References Digikam::ThumbnailLoadThread::lastDescriptions(), Digikam::ThumbnailImageCatcher::Private::mutex, Digikam::ThumbnailImageCatcher::Private::tasks, and Digikam::ThumbnailImageCatcher::Private::thread.
Referenced by Digikam::FaceItemRetriever::getThumbnails().
|
slot |
The catcher is active per default after construction. Deactivate it if you use the catcher as a longer-lived object and do not use it for some time, then activate it before you request a thumbnail from the thread again.
References Digikam::ThumbnailImageCatcher::Private::active, cancel(), Digikam::ThumbnailImageCatcher::Private::mutex, and Digikam::ThumbnailImageCatcher::Private::reset().
Referenced by Digikam::FaceItemRetriever::getThumbnails().
void Digikam::ThumbnailImageCatcher::setThumbnailLoadThread | ( | ThumbnailLoadThread *const | thread | ) |
References Digikam::ThumbnailImageCatcher::Private::Inactive, Digikam::ThumbnailImageCatcher::Private::mutex, Digikam::ThumbnailImageCatcher::Private::reset(), slotThumbnailLoaded(), Digikam::ThumbnailImageCatcher::Private::state, thread(), and Digikam::ThumbnailImageCatcher::Private::thread.
Referenced by ThumbnailImageCatcher().
|
protectedslot |
References Digikam::ThumbnailImageCatcher::Private::Accepting, Digikam::ThumbnailImageCatcher::Private::harvest(), Digikam::ThumbnailImageCatcher::Private::Inactive, Digikam::ThumbnailImageCatcher::Private::intermediate, Digikam::ThumbnailImageCatcher::Private::mutex, Digikam::ThumbnailImageCatcher::Private::Quitting, Digikam::ThumbnailImageCatcher::Private::state, and Digikam::ThumbnailImageCatcher::Private::Waiting.
Referenced by setThumbnailLoadThread().
ThumbnailLoadThread * Digikam::ThumbnailImageCatcher::thread | ( | ) | const |
References Digikam::ThumbnailImageCatcher::Private::thread.
Referenced by Digikam::FaceItemRetriever::getThumbnails(), setThumbnailLoadThread(), and ThumbnailImageCatcher().
QList< QImage > Digikam::ThumbnailImageCatcher::waitForThumbnails | ( | ) |
References Digikam::ThumbnailImageCatcher::Private::active, Digikam::ThumbnailImageCatcher::Private::condVar, Digikam::ThumbnailImageCatcher::Private::CatcherResult::description, Digikam::ThumbnailImageCatcher::Private::harvest(), Digikam::ThumbnailImageCatcher::Private::CatcherResult::image, Digikam::ThumbnailImageCatcher::Private::intermediate, Digikam::ThumbnailImageCatcher::Private::mutex, Digikam::ThumbnailImageCatcher::Private::reset(), Digikam::ThumbnailImageCatcher::Private::state, Digikam::ThumbnailImageCatcher::Private::tasks, Digikam::ThumbnailImageCatcher::Private::thread, and Digikam::ThumbnailImageCatcher::Private::Waiting.
Referenced by Digikam::FaceItemRetriever::getThumbnails().