digiKam
Loading...
Searching...
No Matches
imagehistogram.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2004-07-21
7 * Description : image histogram manipulation methods.
8 *
9 * SPDX-FileCopyrightText: 2004-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QObject>
20#include <QEvent>
21#include <QThread>
22
23// Local includes
24
25#include "digikam_export.h"
26#include "dynamicthread.h"
27
28namespace Digikam
29{
30
31class DImg;
32
33class DIGIKAM_EXPORT ImageHistogram : public DynamicThread
34{
35 Q_OBJECT
36
37public:
38
39 explicit ImageHistogram(const DImg& img, QObject* const parent = nullptr);
40 ~ImageHistogram() override;
41
45 void calculate();
46 void calculateInThread();
47
51 void stopCalculation();
52 bool isCalculating() const;
53
57 bool isSixteenBit() const;
58 bool isValid() const;
59
60 double getCount(int channel, int start, int end) const;
61 double getMean(int channel, int start, int end) const;
62 double getPixels() const;
63 double getStdDev(int channel, int start, int end) const;
64 double getValue(int channel, int bin) const;
65 double getMaximum(int channel, int start, int end) const;
66
67 int getHistogramSegments() const;
68 int getMaxSegmentIndex() const;
69 int getMedian(int channel, int start, int end) const;
70
71Q_SIGNALS:
72
73 void calculationFinished(bool success);
74
79
84
85protected:
86
87 void run() override;
88
89private:
90
91 class Private;
92 Private* const d = nullptr;
93};
94
95} // namespace Digikam
Definition dimg.h:52
Definition dynamicthread.h:33
Definition imagehistogram.h:34
void calculationFinished(bool success)
Definition datefolderview.cpp:34