digiKam
histogrambox.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 : 2008-09-30
7  * Description : a widget to display an image histogram and its control widgets
8  *
9  * Copyright (C) 2008-2009 by Andi Clemens <andi dot clemens at gmail dot com>
10  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_HISTOGRAM_BOX_H
26 #define DIGIKAM_HISTOGRAM_BOX_H
27 
28 // Qt includes
29 
30 #include <QWidget>
31 
32 // Local includes
33 
34 #include "digikam_debug.h"
35 #include "digikam_export.h"
36 #include "digikam_globals.h"
37 
38 class QColor;
39 
40 namespace Digikam
41 {
42 
43 class HistogramWidget;
44 
45 class DIGIKAM_EXPORT HistogramBox : public QWidget
46 {
47  Q_OBJECT
48 
49 public:
50 
51  explicit HistogramBox(QWidget* const parent = nullptr,
53  bool selectMode = false);
54  ~HistogramBox() override;
55 
56  void setHistogramType(HistogramBoxType type);
57  void setHistogramMargin(int);
58 
59  void setGradientColors(const QColor& from, const QColor& to);
60  void setGradientVisible(bool visible);
61 
62  ChannelType channel() const;
63  void setChannelEnabled(bool enabled);
64 
65  void setStatisticsVisible(bool b);
66 
67  HistogramScale scale() const;
68 
69  HistogramWidget* histogram() const;
70 
71 Q_SIGNALS:
72 
75 
76 public Q_SLOTS:
77 
78  void setChannel(ChannelType channel);
79  void setScale(HistogramScale scale);
80 
81 protected Q_SLOTS:
82 
83  void slotChannelChanged();
84  void slotScaleChanged();
85 
86 private:
87 
88  class Private;
89  Private* const d;
90 };
91 
92 } // namespace Digikam
93 
94 #endif // DIGIKAM_HISTOGRAM_BOX_H
Definition: histogrambox.h:46
void signalScaleChanged(HistogramScale scale)
void signalChannelChanged(ChannelType channel)
Definition: histogramwidget.h:48
Definition: datefolderview.cpp:43
ChannelType
Definition: digikam_globals.h:159
HistogramBoxType
Definition: digikam_globals.h:135
@ LRGB
Definition: digikam_globals.h:138
HistogramScale
Definition: digikam_globals.h:145