Krita Source Code Documentation
Loading...
Searching...
No Matches
bristle.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2008 Lukas Tvrdy <lukast.dev@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include "bristle.h"
8
9Bristle::Bristle(float x, float y, float length)
10 : m_x(x)
11 , m_y(y)
12 , m_prevX(x)
13 , m_prevY(y)
14 , m_length(length)
15{}
16
20
22{
24}
25
26
31
36
37void Bristle::setInkAmount(float inkAmount)
38{
39 if (inkAmount > 1.0f) {
40 inkAmount = 1.0f;
41 }
42 else if (inkAmount < -1.0f) {
43 inkAmount = -1.0f;
44 }
45
47}
48
49void Bristle::setColor(const KoColor &color)
50{
51 m_color = color;
52}
53
54
55void Bristle::setEnabled(bool enabled)
56{
58}
qreal length(const QPointF &vec)
Definition Ellipse.cc:82
float value(const T *src, size_t ch)
void addInk(float value)
Definition bristle.cpp:27
bool m_enabled
Definition bristle.h:104
float m_length
Definition bristle.h:97
const KoColor & color() const
Definition bristle.h:41
bool enabled() const
Definition bristle.h:76
~Bristle()
Definition bristle.cpp:17
void setLength(float length)
Definition bristle.cpp:21
float length() const
Definition bristle.h:37
Bristle()=default
void setInkAmount(float inkAmount)
Definition bristle.cpp:37
void setEnabled(bool enabled)
Definition bristle.cpp:55
float inkAmount() const
Definition bristle.h:53
void setColor(const KoColor &color)
Definition bristle.cpp:49
void removeInk(float value)
Definition bristle.cpp:32
float m_inkAmount
Definition bristle.h:99
KoColor m_color
Definition bristle.h:98