digiKam
|
Public Slots | |
void | start () |
void | stop () |
void | wait () |
Signals | |
void | finished () |
void | signalImageLoaded (const LoadingDescription &loadingDescription, const DImg &img) |
void | signalImageSaved (const QString &filePath, bool success) |
void | signalImageStartedLoading (const LoadingDescription &loadingDescription) |
void | signalImageStartedSaving (const QString &filePath) |
void | signalLoadingProgress (const LoadingDescription &loadingDescription, float progress) |
void | signalMoreCompleteLoadingAvailable (const LoadingDescription &oldLoadingDescription, const LoadingDescription &newLoadingDescription) |
void | signalSavingProgress (const QString &filePath, float progress) |
void | signalThumbnailLoaded (const LoadingDescription &loadingDescription, const QImage &img) |
void | starting () |
Public Member Functions | |
void | imageLoaded (const LoadingDescription &loadingDescription, const DImg &img) override |
void | imageSaved (const QString &filePath, bool success) override |
void | imageStartedLoading (const LoadingDescription &loadingDescription) override |
void | imageStartedSaving (const QString &filePath) override |
bool | isFinished () const |
bool | isRunning () const |
void | load (const LoadingDescription &description) |
void | load (const LoadingDescription &description, LoadingPolicy policy) |
LoadingPolicy | loadingPolicy () const |
void | loadingProgress (const LoadingDescription &loadingDescription, float progress) override |
ManagedLoadSaveThread (QObject *const parent=nullptr) | |
void | moreCompleteLoadingAvailable (const LoadingDescription &oldLoadingDescription, const LoadingDescription &newLoadingDescription) override |
QThread::Priority | priority () const |
virtual bool | querySendNotifyEvent () const |
void | save (const DImg &image, const QString &filePath, const QString &format) |
void | save (DImg &image, const QString &filePath, const QString &format) |
void | savingProgress (const QString &filePath, float progress) override |
void | setEmitSignals (bool emitThem) |
void | setLoadingPolicy (LoadingPolicy policy) |
void | setNotificationPolicy (NotificationPolicy notificationPolicy) |
void | setPriority (QThread::Priority priority) |
void | setTerminationPolicy (TerminationPolicy terminationPolicy) |
State | state () const |
void | stopAllTasks () |
void | stopLoading (const LoadingDescription &desc, LoadingTaskFilter filter=LoadingTaskFilterAll) |
void | stopLoading (const QString &filePath=QString(), LoadingTaskFilter filter=LoadingTaskFilterAll) |
void | stopSaving (const QString &filePath=QString()) |
virtual void | taskHasFinished () |
TerminationPolicy | terminationPolicy () const |
void | thumbnailLoaded (const LoadingDescription &loadingDescription, const QImage &img) override |
~ManagedLoadSaveThread () override | |
Static Public Member Functions | |
static int | exifOrientation (const QString &filePath, const DMetadata &metadata, bool isRaw, bool fromRawEmbeddedPreview) |
static LoadSaveFileInfoProvider * | infoProvider () |
static void | setInfoProvider (LoadSaveFileInfoProvider *const infoProvider) |
Protected Member Functions | |
void | load (const LoadingDescription &description, LoadingMode loadingMode, AccessMode mode=AccessModeReadWrite) |
void | load (const LoadingDescription &description, LoadingMode loadingMode, LoadingPolicy policy, AccessMode mode=AccessModeReadWrite) |
void | loadPreview (const LoadingDescription &description, LoadingPolicy policy) |
void | loadThumbnail (const LoadingDescription &description) |
void | notificationReceived () |
void | preloadThumbnail (const LoadingDescription &description) |
void | preloadThumbnailGroup (const QList< LoadingDescription > &descriptions) |
void | prependThumbnailGroup (const QList< LoadingDescription > &descriptions) |
void | run () override |
bool | runningFlag () const volatile |
void | shutDown () |
void | start (QMutexLocker &locker) |
void | stop (QMutexLocker &locker) |
QMutex * | threadMutex () const |
void | wait (QMutexLocker &locker) |
Protected Attributes | |
LoadSaveTask * | m_currentTask |
LoadingPolicy | m_loadingPolicy |
QMutex | m_mutex |
NotificationPolicy | m_notificationPolicy |
TerminationPolicy | m_terminationPolicy |
QList< LoadSaveTask * > | m_todo |
|
inherited |
used by SharedLoadSaveThread only
Enumerator | |
---|---|
AccessModeRead | image will only be used for reading |
AccessModeReadWrite | image data will possibly be changed |
used by SharedLoadSaveThread only
Enumerator | |
---|---|
LoadingModeNormal | no sharing of loading process, no caching of image |
LoadingModeShared | loading process is shared, image is cached |
Enumerator | |
---|---|
LoadingPolicyFirstRemovePrevious | Load image immediately, remove and stop all previous loading tasks. |
LoadingPolicyPrepend | Prepend loading in front of all other tasks, but wait for the current task to finish. No other tasks will be removed, preloading tasks will be stopped and postponed. |
LoadingPolicySimplePrepend | Prepend in front of all other tasks (not touching the current task). Do not check for duplicate tasks, do not check for preloading tasks. |
LoadingPolicyAppend | Append loading task to the end of the list, but in front of all preloading tasks. No other tasks will be removed, preloading tasks will be stopped and postponed. This is similar to the simple load() operation from LoadSaveThread, except for the special care taken for preloading. |
LoadingPolicySimpleAppend | Append to the lists of tasks. Do not check for duplicate tasks, do not check for preloading tasks. |
LoadingPolicyPreload | Preload image, i.e. load it with low priority when no other tasks are scheduled. All other tasks will take precedence, and preloading tasks will be stopped and postponed when another task is added. No progress info will be sent for preloaded images |
|
inherited |
|
inherited |
|
explicit |
Termination is controlled by setting the TerminationPolicy Default is TerminationPolicyTerminateLoading
|
override |
References shutDown().
|
staticinherited |
Retrieves the Exif orientation, either from the info provider if available, or from the metadata
References Digikam::MetaEngineRotation::exifOrientation(), Digikam::MetaEngine::getItemOrientation(), Digikam::LoadSaveThread::infoProvider(), Digikam::MetaEngine::ORIENTATION_NORMAL, Digikam::MetaEngine::ORIENTATION_UNSPECIFIED, Digikam::LoadSaveFileInfoProvider::orientationHint(), and Digikam::MetaEngineRotation::toTransform().
Referenced by Digikam::DImg::exifOrientation().
|
signalinherited |
|
overridevirtualinherited |
|
overridevirtualinherited |
Implements Digikam::LoadSaveNotifier.
References Digikam::LoadSaveThread::notificationReceived(), and Digikam::LoadSaveThread::signalImageSaved().
Referenced by Digikam::SavingTask::execute().
|
overridevirtualinherited |
Implements Digikam::LoadSaveNotifier.
References Digikam::LoadSaveThread::notificationReceived(), and Digikam::LoadSaveThread::signalImageStartedLoading().
Referenced by Digikam::SharedLoadingTask::execute().
|
overridevirtualinherited |
Implements Digikam::LoadSaveNotifier.
References Digikam::LoadSaveThread::notificationReceived(), and Digikam::LoadSaveThread::signalImageStartedSaving().
Referenced by Digikam::SavingTask::execute().
|
staticinherited |
Referenced by Digikam::LoadSaveThread::exifOrientation(), and Digikam::LoadSaveThread::setInfoProvider().
|
inherited |
References Digikam::DynamicThread::Inactive.
|
inherited |
void Digikam::ManagedLoadSaveThread::load | ( | const LoadingDescription & | description | ) |
Append a task to load the given file to the task list. If there is already a task for the given file, it will possibly be rescheduled, but no second task will be added. Only loading tasks will - if required by the policy - be stopped or removed, saving tasks will not be touched.
References LoadingModeNormal, and m_loadingPolicy.
Referenced by Digikam::SharedLoadSaveThread::load(), load(), loadPreview(), and save().
|
protected |
References load(), and m_loadingPolicy.
|
protected |
References load(), Digikam::LoadingTask::loadingDescription(), LoadingPolicyAppend, LoadingPolicyFirstRemovePrevious, LoadingPolicyPreload, LoadingPolicyPrepend, LoadingPolicySimpleAppend, LoadingPolicySimplePrepend, LoadingTaskFilterAll, LoadingTaskFilterPreloading, Digikam::LoadingTask::LoadingTaskStatusLoading, Digikam::LoadingTask::LoadingTaskStatusStopping, Digikam::LoadSaveThread::m_currentTask, Digikam::LoadSaveThread::m_todo, Digikam::LoadingTask::setStatus(), Digikam::DynamicThread::start(), and Digikam::DynamicThread::threadMutex().
void Digikam::ManagedLoadSaveThread::load | ( | const LoadingDescription & | description, |
LoadingPolicy | policy | ||
) |
References load(), and LoadingModeNormal.
ManagedLoadSaveThread::LoadingPolicy Digikam::ManagedLoadSaveThread::loadingPolicy | ( | ) | const |
References m_loadingPolicy.
|
overridevirtualinherited |
Implements Digikam::LoadSaveNotifier.
References Digikam::LoadSaveThread::notificationReceived(), and Digikam::LoadSaveThread::signalLoadingProgress().
Referenced by Digikam::LoadingTask::progressInfo().
|
protected |
References load(), and LoadingModeShared.
Referenced by Digikam::PreviewLoadThread::load().
|
protected |
|
overridevirtualinherited |
|
protectedinherited |
References Digikam::LoadSaveThread::m_notificationPolicy, Digikam::LoadSaveThread::NotificationPolicyDirect, and Digikam::LoadSaveThread::NotificationPolicyTimeLimited.
Referenced by Digikam::LoadSaveThread::imageLoaded(), Digikam::LoadSaveThread::imageSaved(), Digikam::LoadSaveThread::imageStartedLoading(), Digikam::LoadSaveThread::imageStartedSaving(), Digikam::LoadSaveThread::loadingProgress(), Digikam::LoadSaveThread::moreCompleteLoadingAvailable(), Digikam::LoadSaveThread::savingProgress(), and Digikam::LoadSaveThread::thumbnailLoaded().
|
protected |
|
protected |
References Digikam::LoadingTask::LoadingTaskStatusPreloading, Digikam::LoadSaveThread::m_todo, Digikam::LoadingTask::setStatus(), Digikam::DynamicThread::start(), and Digikam::DynamicThread::threadMutex().
Referenced by Digikam::ThumbnailLoadThread::pregenerateGroup(), and Digikam::ThumbnailLoadThread::preloadGroup().
|
protected |
|
inherited |
Referenced by Digikam::DynamicThread::setPriority().
|
virtualinherited |
References Digikam::LoadSaveThread::m_notificationPolicy, Digikam::LoadSaveThread::NotificationPolicyDirect, and Digikam::LoadSaveThread::NotificationPolicyTimeLimited.
Referenced by Digikam::LoadingTask::progressInfo(), Digikam::SavingTask::progressInfo(), and Digikam::SharedLoadingTask::querySendNotifyEvent().
|
overrideprotectedvirtualinherited |
Implement this pure virtual function in your subclass.
Implements Digikam::DynamicThread.
References Digikam::LoadSaveTask::execute(), Digikam::LoadSaveThread::m_currentTask, Digikam::LoadSaveThread::m_notificationPolicy, Digikam::LoadSaveThread::m_todo, Digikam::LoadSaveThread::NotificationPolicyTimeLimited, Digikam::DynamicThread::runningFlag(), Digikam::DynamicThread::stop(), and Digikam::DynamicThread::threadMutex().
|
protectedinherited |
In you run() method, you shall regularly check for runningFlag() and cleanup and return if false.
Referenced by Digikam::ImageHistogram::calculate(), Digikam::RawProcessingFilter::continueQuery(), Digikam::LoadSaveThread::run(), Digikam::ScanStateFilter::run(), and Digikam::NREstimate::startAnalyse().
|
inherited |
Append a task to save the image to the task list
References Digikam::LoadSaveThread::m_todo, Digikam::DynamicThread::start(), and Digikam::DynamicThread::threadMutex().
void Digikam::ManagedLoadSaveThread::save | ( | DImg & | image, |
const QString & | filePath, | ||
const QString & | format | ||
) |
Append a task to save the image to the task list
References load(), Digikam::LoadingTask::loadingDescription(), LoadingPolicyPreload, LoadingTaskFilterPreloading, Digikam::LoadingTask::LoadingTaskStatusStopping, Digikam::LoadSaveThread::m_currentTask, Digikam::LoadSaveThread::m_todo, Digikam::LoadingTask::setStatus(), Digikam::DynamicThread::start(), and Digikam::DynamicThread::threadMutex().
|
overridevirtualinherited |
Implements Digikam::LoadSaveNotifier.
References Digikam::LoadSaveThread::notificationReceived(), and Digikam::LoadSaveThread::signalSavingProgress().
Referenced by Digikam::SavingTask::progressInfo().
|
inherited |
|
staticinherited |
References Digikam::LoadSaveThread::infoProvider().
Referenced by Digikam::DigikamApp::DigikamApp().
void Digikam::ManagedLoadSaveThread::setLoadingPolicy | ( | LoadingPolicy | policy | ) |
Set the loading policy. Default is LoadingPolicyAppend. You can override the default value for each operation.
References m_loadingPolicy.
Referenced by Digikam::FacePreviewLoader::FacePreviewLoader().
|
inherited |
References Digikam::LoadSaveThread::m_notificationPolicy.
|
inherited |
Sets the priority for this dynamic thread. Can be set anytime. If the thread is currently not running, the priority will be set when it is run next time. When you set QThread::InheritPriority (default), the priority is not changed but inherited from the thread pool.
References Digikam::DynamicThread::priority().
Referenced by Digikam::FacePipeline::Private::applyPriority(), and Digikam::FacePipeline::Private::createThumbnailLoadThread().
void Digikam::ManagedLoadSaveThread::setTerminationPolicy | ( | TerminationPolicy | terminationPolicy | ) |
References m_terminationPolicy, and terminationPolicy().
|
protected |
References LoadingTaskFilterAll, LoadingTaskFilterPreloading, Digikam::LoadingTask::LoadingTaskStatusStopping, Digikam::LoadSaveThread::m_currentTask, m_terminationPolicy, Digikam::LoadingTask::setStatus(), Digikam::DynamicThread::shutDown(), stopAllTasks(), TerminationPolicyTerminateAll, TerminationPolicyTerminateLoading, TerminationPolicyTerminatePreloading, TerminationPolicyWait, and Digikam::DynamicThread::threadMutex().
Referenced by ~ManagedLoadSaveThread(), and Digikam::ThumbnailLoadThread::~ThumbnailLoadThread().
|
signalinherited |
This signal is emitted when the loading process has finished. If the process failed, img is null.
Referenced by Digikam::FacePreviewLoader::FacePreviewLoader(), and Digikam::LoadSaveThread::imageLoaded().
|
signalinherited |
Referenced by Digikam::LoadSaveThread::imageSaved().
|
signalinherited |
All signals are delivered to the thread from where the LoadSaveThread object has been created. This thread must use its event loop to get the signals. You must connect to these signals with Qt::AutoConnection (default) or Qt::QueuedConnection. This signal is emitted when the loading process begins.
Referenced by Digikam::LoadSaveThread::imageStartedLoading().
|
signalinherited |
Referenced by Digikam::LoadSaveThread::imageStartedSaving().
|
signalinherited |
This signal is emitted whenever new progress info is available and the notification policy allows emitting the signal. No progress info will be sent for preloaded images (ManagedLoadSaveThread).
Referenced by Digikam::LoadSaveThread::loadingProgress().
|
signalinherited |
This signal is emitted if
Referenced by Digikam::LoadSaveThread::moreCompleteLoadingAvailable().
|
signalinherited |
Referenced by Digikam::LoadSaveThread::savingProgress().
|
signalinherited |
Referenced by Digikam::LoadSaveThread::thumbnailLoaded().
|
slotinherited |
Referenced by Digikam::ImageHistogram::calculateInThread(), Digikam::FacePreviewLoader::checkRestart(), Digikam::ImageHistogram::getCount(), Digikam::ImageHistogram::getMaximum(), Digikam::ImageHistogram::getMean(), Digikam::ImageHistogram::getMedian(), Digikam::ImageHistogram::getStdDev(), Digikam::LoadSaveThread::load(), load(), loadThumbnail(), Digikam::DImgThreadedFilter::multithreadedSteps(), preloadThumbnail(), preloadThumbnailGroup(), prependThumbnailGroup(), Digikam::ScanStateFilter::process(), Digikam::LoadSaveThread::save(), save(), and Digikam::DImgThreadedFilter::startFilter().
|
protectedinherited |
Doing the same as start(), stop() and wait above, provide it with a locked QMutexLocker on mutex(). Note the start() will unlock and relock for scheduling once, after state change.
References Digikam::ThreadManager::instance(), and Digikam::ThreadManager::schedule().
|
signalinherited |
Emitted if emitSignals is enabled
|
inherited |
|
slotinherited |
Stop computation, sets the running flag to false.
Referenced by Digikam::WBFilter::autoExposureAdjustement(), Digikam::DImgThreadedFilter::cancelFilter(), Digikam::DImgThreadedFilter::multithreadedSteps(), Digikam::LoadSaveThread::run(), Digikam::ScanStateFilter::run(), Digikam::DynamicThread::shutDown(), Digikam::FacePreviewLoader::slotImageLoaded(), Digikam::FacePipeline::Private::stop(), and Digikam::ImageHistogram::stopCalculation().
|
protectedinherited |
void Digikam::ManagedLoadSaveThread::stopAllTasks | ( | ) |
References Digikam::LoadingTask::LoadingTaskStatusStopping, Digikam::LoadSaveThread::m_currentTask, Digikam::LoadSaveThread::m_todo, Digikam::SavingTask::SavingTaskStatusStopping, Digikam::LoadingTask::setStatus(), Digikam::SavingTask::setStatus(), Digikam::LoadSaveTask::TaskTypeLoading, Digikam::LoadSaveTask::TaskTypeSaving, Digikam::DynamicThread::threadMutex(), and Digikam::LoadSaveTask::type().
Referenced by Digikam::FacePreviewLoader::cancel(), Digikam::ThumbnailLoadThread::cleanUp(), shutDown(), and Digikam::FacePipeline::Private::stop().
void Digikam::ManagedLoadSaveThread::stopLoading | ( | const LoadingDescription & | desc, |
LoadingTaskFilter | filter = LoadingTaskFilterAll |
||
) |
Same than previous method, but Stop and remove tasks filtered by LoadingDescription.
References Digikam::DynamicThread::threadMutex().
void Digikam::ManagedLoadSaveThread::stopLoading | ( | const QString & | filePath = QString() , |
LoadingTaskFilter | filter = LoadingTaskFilterAll |
||
) |
Stop and remove tasks filtered by filePath and policy. If filePath isNull, applies to all file paths.
References Digikam::DynamicThread::threadMutex().
Referenced by Digikam::EditorCore::load().
void Digikam::ManagedLoadSaveThread::stopSaving | ( | const QString & | filePath = QString() | ) |
Stop and remove saving tasks filtered by filePath. If filePath isNull, applies to all file paths.
References Digikam::SavingTask::filePath(), Digikam::LoadSaveThread::m_currentTask, Digikam::LoadSaveThread::m_todo, Digikam::SavingTask::SavingTaskStatusStopping, Digikam::SavingTask::setStatus(), Digikam::LoadSaveTask::TaskTypeSaving, Digikam::DynamicThread::threadMutex(), and Digikam::LoadSaveTask::type().
Referenced by Digikam::EditorCore::abortSaving().
|
virtualinherited |
ManagedLoadSaveThread::TerminationPolicy Digikam::ManagedLoadSaveThread::terminationPolicy | ( | ) | const |
References m_terminationPolicy.
Referenced by setTerminationPolicy().
|
protectedinherited |
This is the non-recursive mutex used to protect state variables and waiting in this class. You can use it if you want to protect your memory in the same scope as calling start, stop or wait, then using the QMutexLocker variants below. Note that when you have locked this mutex, you must use these variants, as the mutex is non-recursive.
Referenced by Digikam::ScanStateFilter::dispatch(), Digikam::LoadSaveThread::load(), load(), loadThumbnail(), preloadThumbnail(), preloadThumbnailGroup(), prependThumbnailGroup(), Digikam::ScanStateFilter::process(), Digikam::LoadSaveThread::run(), Digikam::ScanStateFilter::run(), Digikam::LoadSaveThread::save(), save(), shutDown(), stopAllTasks(), stopLoading(), stopSaving(), and Digikam::LoadSaveThread::taskHasFinished().
|
overridevirtualinherited |
Implements Digikam::LoadSaveNotifier.
Reimplemented in Digikam::ThumbnailLoadThread.
References Digikam::LoadSaveThread::notificationReceived(), and Digikam::LoadSaveThread::signalThumbnailLoaded().
Referenced by Digikam::ThumbnailLoadingTask::execute(), and Digikam::ThumbnailLoadThread::thumbnailLoaded().
|
slotinherited |
Waits until the thread finishes. Typically, call stop() before.
Referenced by Digikam::DImgThreadedFilter::cancelFilter(), Digikam::ThumbnailLoadThread::cleanUp(), Digikam::DynamicThread::shutDown(), Digikam::FacePreviewLoader::slotImageLoaded(), Digikam::ImageHistogram::stopCalculation(), and Digikam::FacePipeline::Private::wait().
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
Referenced by setTerminationPolicy(), shutDown(), and terminationPolicy().
|
protectedinherited |