Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tone_curve_widget.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * Based on the Digikam CIE Tongue widget
5 * SPDX-FileCopyrightText: 2006-2013 Gilles Caulier <caulier dot gilles at gmail dot com>
6 *
7 * Any source code are inspired from lprof project and
8 * SPDX-FileCopyrightText: 1998-2001 Marti Maria
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 **/
12
13#ifndef KIS_TONECURVEWIDGET_H
14#define KIS_TONECURVEWIDGET_H
15
16#include <QWidget>
17#include <QColor>
18#include <QPaintEvent>
19
20#include <kritaui_export.h>
21
22class KRITAUI_EXPORT KisToneCurveWidget : public QWidget
23{
24 Q_OBJECT
25
26public:
27
28 KisToneCurveWidget(QWidget *parent = nullptr);
29 ~KisToneCurveWidget() override;
30
31 void setGreyscaleCurve(QPolygonF poly);
32 void setRGBCurve(QPolygonF red, QPolygonF green, QPolygonF blue);
33 void setCMYKCurve(QPolygonF cyan, QPolygonF magenta, QPolygonF yellow, QPolygonF key);
34 void setProfileDataAvailable(bool dataAvailable);
35 void setXAxisValues(const QStringList &values, const int offset = 20);
36 void setYAxisValues(const QStringList &values, const int offset = 32);
37protected:
38
39 int grids(double val) const;
40 void drawGrid();
41 void resizeEvent(QResizeEvent* event) override;
42 void paintEvent(QPaintEvent*) override;
43
44private:
45
46 void updatePixmap();
47 void mapPoint(QPointF & xy);
48 void biasedLine(int x1, int y1, int x2, int y2);
49 void biasedText(int x, int y, const QString& txt);
50private :
51
52 class Private;
53 Private* const d {nullptr};
54};
55
56#endif /* KIS_TONECURVEWIDGET_H */