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, AccessMode mode, LoadingPolicy policy=LoadingPolicyAppend) |
void | load (const LoadingDescription &description, LoadingPolicy policy) |
LoadingPolicy | loadingPolicy () const |
void | loadingProgress (const LoadingDescription &loadingDescription, float progress) override |
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) |
SharedLoadSaveThread (QObject *const parent=nullptr) | |
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 |
~SharedLoadSaveThread () 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 |
|
inherited |
used by SharedLoadSaveThread only
Enumerator | |
---|---|
LoadingModeNormal | no sharing of loading process, no caching of image |
LoadingModeShared | loading process is shared, image is cached |
|
inherited |
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 |
|
inherited |
|
inherited |
|
explicit |
|
override |
|
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 |
|
inherited |
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 Digikam::ManagedLoadSaveThread::LoadingModeNormal, and Digikam::ManagedLoadSaveThread::m_loadingPolicy.
Referenced by load(), Digikam::ManagedLoadSaveThread::load(), Digikam::ManagedLoadSaveThread::loadPreview(), and Digikam::ManagedLoadSaveThread::save().
void Digikam::SharedLoadSaveThread::load | ( | const LoadingDescription & | description, |
AccessMode | mode, | ||
LoadingPolicy | policy = LoadingPolicyAppend |
||
) |
|
protectedinherited |
|
protectedinherited |
References Digikam::ManagedLoadSaveThread::load(), Digikam::LoadingTask::loadingDescription(), Digikam::ManagedLoadSaveThread::LoadingPolicyAppend, Digikam::ManagedLoadSaveThread::LoadingPolicyFirstRemovePrevious, Digikam::ManagedLoadSaveThread::LoadingPolicyPreload, Digikam::ManagedLoadSaveThread::LoadingPolicyPrepend, Digikam::ManagedLoadSaveThread::LoadingPolicySimpleAppend, Digikam::ManagedLoadSaveThread::LoadingPolicySimplePrepend, Digikam::ManagedLoadSaveThread::LoadingTaskFilterAll, Digikam::ManagedLoadSaveThread::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().
|
inherited |
|
inherited |
References Digikam::ManagedLoadSaveThread::m_loadingPolicy.
|
overridevirtualinherited |
Implements Digikam::LoadSaveNotifier.
References Digikam::LoadSaveThread::notificationReceived(), and Digikam::LoadSaveThread::signalLoadingProgress().
Referenced by Digikam::LoadingTask::progressInfo().
|
protectedinherited |
References Digikam::ManagedLoadSaveThread::load(), and Digikam::ManagedLoadSaveThread::LoadingModeShared.
Referenced by Digikam::PreviewLoadThread::load().
|
protectedinherited |
|
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().
|
protectedinherited |
|
protectedinherited |
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().
|
protectedinherited |
|
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().
|
inherited |
Append a task to save the image to the task list
References Digikam::ManagedLoadSaveThread::load(), Digikam::LoadingTask::loadingDescription(), Digikam::ManagedLoadSaveThread::LoadingPolicyPreload, Digikam::ManagedLoadSaveThread::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().
|
inherited |
Set the loading policy. Default is LoadingPolicyAppend. You can override the default value for each operation.
References Digikam::ManagedLoadSaveThread::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().
|
inherited |
|
protectedinherited |
References Digikam::ManagedLoadSaveThread::LoadingTaskFilterAll, Digikam::ManagedLoadSaveThread::LoadingTaskFilterPreloading, Digikam::LoadingTask::LoadingTaskStatusStopping, Digikam::LoadSaveThread::m_currentTask, Digikam::ManagedLoadSaveThread::m_terminationPolicy, Digikam::LoadingTask::setStatus(), Digikam::DynamicThread::shutDown(), Digikam::ManagedLoadSaveThread::stopAllTasks(), Digikam::ManagedLoadSaveThread::TerminationPolicyTerminateAll, Digikam::ManagedLoadSaveThread::TerminationPolicyTerminateLoading, Digikam::ManagedLoadSaveThread::TerminationPolicyTerminatePreloading, Digikam::ManagedLoadSaveThread::TerminationPolicyWait, and Digikam::DynamicThread::threadMutex().
Referenced by Digikam::ManagedLoadSaveThread::~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(), Digikam::ManagedLoadSaveThread::load(), Digikam::ManagedLoadSaveThread::loadThumbnail(), Digikam::DImgThreadedFilter::multithreadedSteps(), Digikam::ManagedLoadSaveThread::preloadThumbnail(), Digikam::ManagedLoadSaveThread::preloadThumbnailGroup(), Digikam::ManagedLoadSaveThread::prependThumbnailGroup(), Digikam::ScanStateFilter::process(), Digikam::LoadSaveThread::save(), Digikam::ManagedLoadSaveThread::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 |
|
inherited |
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(), Digikam::ManagedLoadSaveThread::shutDown(), and Digikam::FacePipeline::Private::stop().
|
inherited |
Same than previous method, but Stop and remove tasks filtered by LoadingDescription.
References Digikam::DynamicThread::threadMutex().
|
inherited |
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().
|
inherited |
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 |
|
inherited |
References Digikam::ManagedLoadSaveThread::m_terminationPolicy.
Referenced by Digikam::ManagedLoadSaveThread::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(), Digikam::ManagedLoadSaveThread::load(), Digikam::ManagedLoadSaveThread::loadThumbnail(), Digikam::ManagedLoadSaveThread::preloadThumbnail(), Digikam::ManagedLoadSaveThread::preloadThumbnailGroup(), Digikam::ManagedLoadSaveThread::prependThumbnailGroup(), Digikam::ScanStateFilter::process(), Digikam::LoadSaveThread::run(), Digikam::ScanStateFilter::run(), Digikam::LoadSaveThread::save(), Digikam::ManagedLoadSaveThread::save(), Digikam::ManagedLoadSaveThread::shutDown(), Digikam::ManagedLoadSaveThread::stopAllTasks(), Digikam::ManagedLoadSaveThread::stopLoading(), Digikam::ManagedLoadSaveThread::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 |
Referenced by Digikam::ManagedLoadSaveThread::load(), Digikam::ManagedLoadSaveThread::prependThumbnailGroup(), Digikam::LoadSaveThread::run(), Digikam::ManagedLoadSaveThread::save(), Digikam::ManagedLoadSaveThread::shutDown(), Digikam::ManagedLoadSaveThread::stopAllTasks(), Digikam::ManagedLoadSaveThread::stopSaving(), and Digikam::LoadSaveThread::taskHasFinished().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Referenced by Digikam::LoadSaveThread::load(), Digikam::ManagedLoadSaveThread::load(), Digikam::ManagedLoadSaveThread::loadThumbnail(), Digikam::ManagedLoadSaveThread::preloadThumbnail(), Digikam::ManagedLoadSaveThread::preloadThumbnailGroup(), Digikam::ManagedLoadSaveThread::prependThumbnailGroup(), Digikam::LoadSaveThread::run(), Digikam::LoadSaveThread::save(), Digikam::ManagedLoadSaveThread::save(), Digikam::ManagedLoadSaveThread::stopAllTasks(), and Digikam::ManagedLoadSaveThread::stopSaving().