Krita Source Code Documentation
Loading...
Searching...
No Matches
StrokePoint.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Riki
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef LIBKIS_STROKE_POINT_H
7#define LIBKIS_STROKE_POINT_H
8
9#include <QPointF>
10
11#include "kritalibkis_export.h"
12
20class KRITALIBKIS_EXPORT StrokePoint
21{
22public:
23 StrokePoint(const QPointF &position = QPointF(),
24 qreal pressure = 1.0,
25 qreal xTilt = 0.0,
26 qreal yTilt = 0.0,
27 qreal rotation = 0.0,
28 qreal tangentialPressure = 0.0,
29 qreal time = 0.0,
30 qreal speed = 0.0)
31 : m_position(position)
32 , m_pressure(pressure)
33 , m_xTilt(xTilt)
34 , m_yTilt(yTilt)
35 , m_rotation(rotation)
36 , m_tangentialPressure(tangentialPressure)
37 , m_time(time)
38 , m_speed(speed)
39 {
40 }
41
42 const QPointF &position() const { return m_position; }
43 qreal pressure() const { return m_pressure; }
44 qreal xTilt() const { return m_xTilt; }
45 qreal yTilt() const { return m_yTilt; }
46 qreal rotation() const { return m_rotation; }
47 qreal tangentialPressure() const { return m_tangentialPressure; }
48 qreal time() const { return m_time; }
49 qreal speed() const { return m_speed; }
50
51 void setPosition(const QPointF &value) { m_position = value; }
52 void setPressure(qreal value) { m_pressure = value; }
53 void setXTilt(qreal value) { m_xTilt = value; }
54 void setYTilt(qreal value) { m_yTilt = value; }
55 void setRotation(qreal value) { m_rotation = value; }
56 void setTangentialPressure(qreal value) { m_tangentialPressure = value; }
57 void setTime(qreal value) { m_time = value; }
58 void setSpeed(qreal value) { m_speed = value; }
59
60private:
61 QPointF m_position;
63 qreal m_xTilt;
64 qreal m_yTilt;
67 qreal m_time;
68 qreal m_speed;
69};
70
71#endif
float value(const T *src, size_t ch)
qreal m_rotation
Definition StrokePoint.h:65
qreal speed() const
Definition StrokePoint.h:49
qreal m_tangentialPressure
Definition StrokePoint.h:66
void setSpeed(qreal value)
Definition StrokePoint.h:58
void setXTilt(qreal value)
Definition StrokePoint.h:53
void setRotation(qreal value)
Definition StrokePoint.h:55
qreal yTilt() const
Definition StrokePoint.h:45
void setYTilt(qreal value)
Definition StrokePoint.h:54
qreal time() const
Definition StrokePoint.h:48
qreal xTilt() const
Definition StrokePoint.h:44
qreal m_speed
Definition StrokePoint.h:68
QPointF m_position
Definition StrokePoint.h:61
void setPosition(const QPointF &value)
Definition StrokePoint.h:51
const QPointF & position() const
Definition StrokePoint.h:42
StrokePoint(const QPointF &position=QPointF(), qreal pressure=1.0, qreal xTilt=0.0, qreal yTilt=0.0, qreal rotation=0.0, qreal tangentialPressure=0.0, qreal time=0.0, qreal speed=0.0)
Definition StrokePoint.h:23
qreal m_pressure
Definition StrokePoint.h:62
void setPressure(qreal value)
Definition StrokePoint.h:52
qreal m_yTilt
Definition StrokePoint.h:64
qreal m_xTilt
Definition StrokePoint.h:63
qreal tangentialPressure() const
Definition StrokePoint.h:47
void setTime(qreal value)
Definition StrokePoint.h:57
qreal pressure() const
Definition StrokePoint.h:43
void setTangentialPressure(qreal value)
Definition StrokePoint.h:56
qreal rotation() const
Definition StrokePoint.h:46