Krita Source Code Documentation
Loading...
Searching...
No Matches
KisCubicCurveQMLWrapper.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 Deif Lou <ginoba@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KISCUBICCURVEQML_H
7#define KISCUBICCURVEQML_H
8
9#include <QQmlEngine>
10#include <QPointF>
11
12#include <kis_cubic_curve.h>
13
14class KisCubicCurveQml : public QObject
15{
16 Q_OBJECT
17 QML_NAMED_ELEMENT(KisCubicCurve)
18
19 Q_PROPERTY(QList<QPointF> points READ points WRITE setPoints NOTIFY pointsChanged)
20 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
21
22public:
23 KisCubicCurveQml(QObject *parent = nullptr);
24
25 const QList<QPointF> points() const;
26 const QString& name() const;
27
28 Q_INVOKABLE qreal value(qreal x) const;
29 Q_INVOKABLE bool isIdentity() const;
30 Q_INVOKABLE bool isConstant(qreal c) const;
31 Q_INVOKABLE qreal interpolateLinear(qreal normalizedValue, const QList<qreal> &transfer) const;
32 Q_INVOKABLE QList<qreal> floatTransfer(int size) const;
33 Q_INVOKABLE QString toString() const;
34 Q_INVOKABLE void fromString(const QString&);
35
36public Q_SLOTS:
37 void setPoints(const QList<QPointF> points);
38 void setPoint(int idx, const QPointF &point);
39 int addPoint(const QPointF &point);
40 void removePoint(int idx);
41 void setName(const QString& name);
42
43Q_SIGNALS:
44 void pointsChanged(const QList<QPointF>&);
45 void nameChanged(const QString&);
46
47private:
49};
50
51#endif
Q_INVOKABLE QString toString() const
int addPoint(const QPointF &point)
Q_INVOKABLE void fromString(const QString &)
void pointsChanged(const QList< QPointF > &)
void setPoint(int idx, const QPointF &point)
Q_INVOKABLE QList< qreal > floatTransfer(int size) const
void setName(const QString &name)
Q_INVOKABLE bool isConstant(qreal c) const
Q_INVOKABLE qreal value(qreal x) const
Q_INVOKABLE qreal interpolateLinear(qreal normalizedValue, const QList< qreal > &transfer) const
void setPoints(const QList< QPointF > points)
void nameChanged(const QString &)
Q_INVOKABLE bool isIdentity() const