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);
35protected:
36
37 int grids(double val) const;
38 void drawGrid();
39 void resizeEvent(QResizeEvent* event) override;
40 void paintEvent(QPaintEvent*) override;
41
42private:
43
44 void updatePixmap();
45 void mapPoint(QPointF & xy);
46 void biasedLine(int x1, int y1, int x2, int y2);
47 void biasedText(int x, int y, const QString& txt);
48private :
49
50 class Private;
51 Private* const d {nullptr};
52};
53
54#endif /* KIS_TONECURVEWIDGET_H */