digiKam
Digikam::ImageHistogram Class Reference
+ Inheritance diagram for Digikam::ImageHistogram:

Public Types

enum  State { Inactive , Scheduled , Running , Deactivating }
 

Public Slots

void start ()
 
void stop ()
 
void wait ()
 

Signals

void calculationAboutToStart ()
 
void calculationFinished (bool success)
 
void calculationStarted ()
 
void finished ()
 
void starting ()
 

Public Member Functions

void calculate ()
 
void calculateInThread ()
 
double getCount (int channel, int start, int end) const
 
int getHistogramSegments () const
 
double getMaximum (int channel, int start, int end) const
 
int getMaxSegmentIndex () const
 
double getMean (int channel, int start, int end) const
 
int getMedian (int channel, int start, int end) const
 
double getPixels () const
 
double getStdDev (int channel, int start, int end) const
 
double getValue (int channel, int bin) const
 
 ImageHistogram (const DImg &img, QObject *const parent=nullptr)
 
bool isCalculating () const
 
bool isFinished () const
 
bool isRunning () const
 
bool isSixteenBit () const
 
bool isValid () const
 
QThread::Priority priority () const
 
void setEmitSignals (bool emitThem)
 
void setPriority (QThread::Priority priority)
 
State state () const
 
void stopCalculation ()
 
 ~ImageHistogram () override
 

Protected Member Functions

void run () override
 
bool runningFlag () const volatile
 
void shutDown ()
 
void start (QMutexLocker &locker)
 
void stop (QMutexLocker &locker)
 
QMutex * threadMutex () const
 
void wait (QMutexLocker &locker)
 

Member Enumeration Documentation

◆ State

Enumerator
Inactive 
Scheduled 
Running 
Deactivating 

Constructor & Destructor Documentation

◆ ImageHistogram()

Digikam::ImageHistogram::ImageHistogram ( const DImg img,
QObject *const  parent = nullptr 
)
explicit

◆ ~ImageHistogram()

Digikam::ImageHistogram::~ImageHistogram ( )
override

References stopCalculation().

Member Function Documentation

◆ calculate()

void Digikam::ImageHistogram::calculate ( )

◆ calculateInThread()

◆ calculationAboutToStart

void Digikam::ImageHistogram::calculationAboutToStart ( )
signal

when calculation in thread is initiated, from other thread

Referenced by calculateInThread().

◆ calculationFinished

void Digikam::ImageHistogram::calculationFinished ( bool  success)
signal

Referenced by calculate(), and calculateInThread().

◆ calculationStarted

void Digikam::ImageHistogram::calculationStarted ( )
signal

emitted from calculation thread

Referenced by calculate().

◆ finished

◆ getCount()

◆ getHistogramSegments()

int Digikam::ImageHistogram::getHistogramSegments ( ) const

◆ getMaximum()

double Digikam::ImageHistogram::getMaximum ( int  channel,
int  start,
int  end 
) const

◆ getMaxSegmentIndex()

int Digikam::ImageHistogram::getMaxSegmentIndex ( ) const

◆ getMean()

double Digikam::ImageHistogram::getMean ( int  channel,
int  start,
int  end 
) const

◆ getMedian()

int Digikam::ImageHistogram::getMedian ( int  channel,
int  start,
int  end 
) const

◆ getPixels()

double Digikam::ImageHistogram::getPixels ( ) const

◆ getStdDev()

double Digikam::ImageHistogram::getStdDev ( int  channel,
int  start,
int  end 
) const

◆ getValue()

◆ isCalculating()

bool Digikam::ImageHistogram::isCalculating ( ) const

◆ isFinished()

bool Digikam::DynamicThread::isFinished ( ) const
inherited

◆ isRunning()

◆ isSixteenBit()

bool Digikam::ImageHistogram::isSixteenBit ( ) const

Methods to access the histogram data.

Referenced by calculate().

◆ isValid()

bool Digikam::ImageHistogram::isValid ( ) const

◆ priority()

QThread::Priority Digikam::DynamicThread::priority ( ) const
inherited

◆ run()

void Digikam::ImageHistogram::run ( )
overrideprotectedvirtual

Implement this pure virtual function in your subclass.

Implements Digikam::DynamicThread.

References calculate().

◆ runningFlag()

bool Digikam::DynamicThread::runningFlag ( ) const volatile
protectedinherited

◆ setEmitSignals()

void Digikam::DynamicThread::setEmitSignals ( bool  emitThem)
inherited

◆ setPriority()

void Digikam::DynamicThread::setPriority ( QThread::Priority  priority)
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().

◆ shutDown()

void Digikam::DynamicThread::shutDown ( )
protectedinherited

If you are deleting data in your destructor which is accessed from the thread, do one of the following from your destructor to guarantee a safe shutdown: 1) Call this method 2) Call stop() and wait(), knowing that nothing will call start() anymore after this 3) Be sure the thread will never be running at destruction. Note: This irrevocably stops this object. Note: It is not sufficient that your parent class does this. Calling this method, or providing one of the above mentioned equivalent guarantees, must be done by every single last class in the hierarchy with an implemented destructor deleting data. (the base class destructor is always called after the derived class)

References Digikam::DynamicThread::stop(), and Digikam::DynamicThread::wait().

Referenced by Digikam::ManagedLoadSaveThread::shutDown(), Digikam::DynamicThread::~DynamicThread(), and Digikam::LoadSaveThread::~LoadSaveThread().

◆ start [1/2]

◆ start() [2/2]

void Digikam::DynamicThread::start ( QMutexLocker &  locker)
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().

◆ starting

void Digikam::DynamicThread::starting ( )
signalinherited

Emitted if emitSignals is enabled

◆ state()

◆ stop [1/2]

◆ stop() [2/2]

void Digikam::DynamicThread::stop ( QMutexLocker &  locker)
protectedinherited

◆ stopCalculation()

void Digikam::ImageHistogram::stopCalculation ( )

Stop threaded computation.

References Digikam::DynamicThread::stop(), and Digikam::DynamicThread::wait().

Referenced by ~ImageHistogram().

◆ threadMutex()

QMutex * Digikam::DynamicThread::threadMutex ( ) const
protectedinherited

◆ wait [1/2]

◆ wait() [2/2]

void Digikam::DynamicThread::wait ( QMutexLocker &  locker)
protectedinherited

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