Krita Source Code Documentation
Loading...
Searching...
No Matches
KisHistogramView.h
Go to the documentation of this file.
1/*
2 * This file is part of Krita
3 *
4 * SPDX-FileCopyrightText: 2021 Deif Lou <ginoba@gmail.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KIS_HISTOGRAM_VIEW_H
10#define KIS_HISTOGRAM_VIEW_H
11
12#include <QScopedPointer>
13#include <QWidget>
14
15#include "kritaui_export.h"
16
17class KisHistogram;
18class KoColorSpace;
19
25class KRITAUI_EXPORT KisHistogramView : public QWidget
26{
27 Q_OBJECT
28
29public:
30 KisHistogramView(QWidget *parent);
32
55 void setup(const QVector<KisHistogram*> &histograms,
56 const QVector<const KoColorSpace*> &colorSpaces,
57 const QVector<QVector<int>> &channels = {});
64 const QVector<int>& channels() const;
73 QColor defaultColor() const;
82 qreal scale() const;
89 bool isLogarithmic() const;
90
91public Q_SLOTS:
100 void setChannel(int channel, int histogramIndex = 0);
110 void setChannels(const QVector<int> &channels, int histogramIndex = 0);
115 void clearChannels();
121 void setDefaultColor(const QColor &newDefaultColor);
129 void setScale(qreal newScale);
139 void setScaleToFit();
151 void setScaleToCutLongPeaks();
158 void setLogarithmic(bool logarithmic);
159
160protected:
161 void paintEvent(QPaintEvent *e) override;
162 void mouseDoubleClickEvent(QMouseEvent *e) override;
163 void mousePressEvent(QMouseEvent *e) override;
164 void mouseMoveEvent(QMouseEvent *e) override;
165
166private:
167 class Private;
168 QScopedPointer<Private> m_d;
169};
170
171#endif
A widget that can display different KisHistograms. It renders a somewhat smooth shape with different ...
QScopedPointer< Private > m_d