digiKam
histogrampainter.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 : 2009-10-26
7  * Description : a class that manages painting histograms
8  *
9  * Copyright (C) 2009 by Johannes Wienke <languitar at semipol dot de>
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) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_HISTOGRAM_PAINTER_H
25 #define DIGIKAM_HISTOGRAM_PAINTER_H
26 
27 // Qt includes
28 
29 #include <QObject>
30 #include <QWidget>
31 
32 // Local includes
33 
34 #include "imagehistogram.h"
35 #include "digikam_globals.h"
36 #include "dcolor.h"
37 
38 namespace Digikam
39 {
40 
47 class HistogramPainter : public QObject
48 {
49  Q_OBJECT
50 
51 public:
52 
58  explicit HistogramPainter(QObject* const parent);
59 
63  ~HistogramPainter() override;
64 
71  void setHistogram(ImageHistogram* const histogram);
72 
78  void setScale(HistogramScale scale);
79 
85  void setChannelType(ChannelType channelType);
86 
93  void setHighlightSelection(bool highlightSelection);
94 
105  void setSelection(double selectionMin, double selectionMax);
106 
113  void setRenderXGrid(bool renderXGrid);
114 
121  void enableHistogramGuideByColor(const DColor& color);
122 
126  void disableHistogramGuide();
127 
136  void initFrom(QWidget* const widget);
137 
147  void render(QPixmap& paintDevice);
148 
149 private:
150 
151  class Private;
152  Private* const d;
153 };
154 
155 } // namespace Digikam
156 
157 #endif // DIGIKAM_HISTOGRAM_PAINTER_H
Definition: dcolor.h:43
Definition: histogrampainter.h:48
void setRenderXGrid(bool renderXGrid)
Definition: histogrampainter.cpp:582
void setScale(HistogramScale scale)
Definition: histogrampainter.cpp:549
void setChannelType(ChannelType channelType)
Definition: histogrampainter.cpp:554
HistogramPainter(QObject *const parent)
Definition: histogrampainter.cpp:533
void setHighlightSelection(bool highlightSelection)
Definition: histogrampainter.cpp:559
void setSelection(double selectionMin, double selectionMax)
Definition: histogrampainter.cpp:564
void setHistogram(ImageHistogram *const histogram)
Definition: histogrampainter.cpp:544
void render(QPixmap &paintDevice)
Definition: histogrampainter.cpp:603
void initFrom(QWidget *const widget)
Definition: histogrampainter.cpp:598
~HistogramPainter() override
Definition: histogrampainter.cpp:539
void disableHistogramGuide()
Definition: histogrampainter.cpp:593
void enableHistogramGuideByColor(const DColor &color)
Definition: histogrampainter.cpp:587
Definition: imagehistogram.h:44
Definition: datefolderview.cpp:43
ChannelType
Definition: digikam_globals.h:159
HistogramScale
Definition: digikam_globals.h:145