|
Krita Source Code Documentation
|
#include <limits>#include <KoConfig.h>#include "kis_assert.h"#include <QPoint>#include <QPointF>#include <QStringConverter>#include <cmath>#include <QLineF>#include <QRect>#include "kis_pointer_utils.h"#include <type_traits>Go to the source code of this file.
Macros | |
| #define | INTENT_ABSOLUTE_COLORIMETRIC 3 |
| #define | INTENT_PERCEPTUAL 0 |
| #define | INTENT_RELATIVE_COLORIMETRIC 1 |
| #define | INTENT_SATURATION 2 |
| #define | M_PI 3.14159265358979323846 |
Functions | |
| qreal | bisectorAngle (qreal a, qreal b) |
| qreal | incrementInDirection (qreal a, qreal inc, qreal direction) |
| template<typename T > | |
| constexpr const T & | kisBoundFast (const T &min, const T &val, const T &max) |
| template<typename T > | |
| T | kisDegreesToRadians (T degrees) |
| qreal | kisDistance (const QPointF &pt1, const QPointF &pt2) |
| qreal | kisDistanceToLine (const QPointF &m, const QLineF &line) |
| QRect | kisEnsureInRect (QRect rc, const QRect &bounds) |
| template<class T , typename U > | |
| T | kisGrowRect (const T &rect, U offset) |
| QPointF | kisProjectOnVector (const QPointF &base, const QPointF &v) |
| template<typename T > | |
| T | kisRadiansToDegrees (T radians) |
| qreal | kisSquareDistance (const QPointF &pt1, const QPointF &pt2) |
| QRect | kisTrimLeft (int width, QRect &toTakeFrom) |
| QRectF | kisTrimLeft (int width, QRectF &toTakeFrom) |
| QRect | kisTrimTop (int height, QRect &toTakeFrom) |
| QRectF | kisTrimTop (int height, QRectF &toTakeFrom) |
| template<typename T > | |
| T | nextPowerOfTwo (T v) |
| template<typename T > | |
| std::enable_if< std::is_floating_point< T >::value, T >::type | normalizeAngle (T a) |
| template<typename T > | |
| std::enable_if< std::is_floating_point< T >::value, T >::type | normalizeAngleDegrees (T a) |
| template<typename T > | |
| T | pow2 (const T &x) |
| template<typename T > | |
| T | pow3 (const T &x) |
| qreal | shortestAngularDistance (qreal a, qreal b) |
| template<typename PointType > | |
| PointType | snapToClosestAxis (PointType P) |
| template<typename PointType > | |
| PointType | snapToClosestNiceAngle (PointType point, PointType startPoint, qreal angle=(2 *M_PI)/24) |
Variables | |
| constexpr const char * | currentUnderlyingStyleNameProperty = "currentUnderlyingStyleName" |
| const quint8 | MAX_SELECTED = std::numeric_limits<quint8>::max() |
| const quint8 | MIN_SELECTED = std::numeric_limits<quint8>::min() |
| const double | PRESSURE_DEFAULT = PRESSURE_MAX |
| const double | PRESSURE_MAX = 1.0 |
| const double | PRESSURE_MIN = 0.0 |
| const double | PRESSURE_THRESHOLD = 5.0 / 255.0 |
| const qint16 | qint16_MAX = std::numeric_limits<qint16>::max() |
| const qint16 | qint16_MIN = std::numeric_limits<qint16>::min() |
| const qint32 | qint32_MAX = std::numeric_limits<qint32>::max() |
| const qint32 | qint32_MIN = std::numeric_limits<qint32>::min() |
| const quint16 | quint16_MAX = std::numeric_limits<quint16>::max() |
| const quint8 | quint8_MAX = std::numeric_limits<quint8>::max() |
| const quint8 | SELECTION_THRESHOLD = 1 |
| #define INTENT_ABSOLUTE_COLORIMETRIC 3 |
Definition at line 106 of file kis_global.h.
| #define INTENT_PERCEPTUAL 0 |
Definition at line 103 of file kis_global.h.
| #define INTENT_RELATIVE_COLORIMETRIC 1 |
Definition at line 104 of file kis_global.h.
| #define INTENT_SATURATION 2 |
Definition at line 105 of file kis_global.h.
| #define M_PI 3.14159265358979323846 |
Definition at line 111 of file kis_global.h.
| enum CursorStyle |
Definition at line 62 of file kis_global.h.
| enum OldCursorStyle |
Definition at line 77 of file kis_global.h.
| enum OutlineStyle |
| Enumerator | |
|---|---|
| OUTLINE_NONE | |
| OUTLINE_CIRCLE | |
| OUTLINE_FULL | |
| OUTLINE_TILT | |
| N_OUTLINE_STYLE_SIZE | |
Definition at line 53 of file kis_global.h.
|
inline |
Definition at line 157 of file kis_global.h.
References incrementInDirection(), and shortestAngularDistance().
|
inline |
Definition at line 147 of file kis_global.h.
References shortestAngularDistance().
|
inlineconstexpr |
This is a fork of an old version of qBound. It has the following properties: 1) Does not have asserts (we cannot have them in blendmodes) 2) Does not have automatic type deduction. The user must explicitly type the common type in case of ambiguity.
Rules of thumb:
1) If you are writing time-critical code (e.g. blendmodes), use kisBoundFast() 2) Otherwise use qBound() or std::clamp (the latter may optionally have an assert as well)
Definition at line 37 of file kis_global.h.
|
inline |
Definition at line 176 of file kis_global.h.
References M_PI.
|
inline |
|
inline |
Definition at line 234 of file kis_global.h.
References A, B, C, distance(), p1, p2, pow2(), and qFuzzyCompare().
|
inline |
Definition at line 267 of file kis_global.h.
References bounds.
|
inline |
Definition at line 186 of file kis_global.h.
|
inline |
Definition at line 256 of file kis_global.h.
|
inline |
Definition at line 181 of file kis_global.h.
References M_PI.
|
inline |
Definition at line 194 of file kis_global.h.
References pow2().
|
inline |
Definition at line 297 of file kis_global.h.
References kisTrimLeft().
|
inline |
Definition at line 288 of file kis_global.h.
|
inline |
Definition at line 314 of file kis_global.h.
References kisTrimTop().
|
inline |
Definition at line 305 of file kis_global.h.
|
inline |
Definition at line 328 of file kis_global.h.
References v.
| std::enable_if< std::is_floating_point< T >::value, T >::type normalizeAngle | ( | T | a | ) |
| std::enable_if< std::is_floating_point< T >::value, T >::type normalizeAngleDegrees | ( | T | a | ) |
Definition at line 132 of file kis_global.h.
|
inline |
Definition at line 166 of file kis_global.h.
|
inline |
Definition at line 171 of file kis_global.h.
|
inline |
|
inline |
|
inline |
Definition at line 209 of file kis_global.h.
References kisDistance(), and M_PI.
|
constexpr |
Definition at line 116 of file kis_global.h.
| const quint8 MAX_SELECTED = std::numeric_limits<quint8>::max() |
Definition at line 32 of file kis_global.h.
| const quint8 MIN_SELECTED = std::numeric_limits<quint8>::min() |
Definition at line 33 of file kis_global.h.
| const double PRESSURE_DEFAULT = PRESSURE_MAX |
Definition at line 99 of file kis_global.h.
| const double PRESSURE_MAX = 1.0 |
Definition at line 98 of file kis_global.h.
| const double PRESSURE_MIN = 0.0 |
Definition at line 97 of file kis_global.h.
| const double PRESSURE_THRESHOLD = 5.0 / 255.0 |
Definition at line 100 of file kis_global.h.
| const qint16 qint16_MAX = std::numeric_limits<qint16>::max() |
Definition at line 28 of file kis_global.h.
| const qint16 qint16_MIN = std::numeric_limits<qint16>::min() |
Definition at line 27 of file kis_global.h.
| const qint32 qint32_MAX = std::numeric_limits<qint32>::max() |
Definition at line 29 of file kis_global.h.
| const qint32 qint32_MIN = std::numeric_limits<qint32>::min() |
Definition at line 30 of file kis_global.h.
| const quint16 quint16_MAX = std::numeric_limits<quint16>::max() |
Definition at line 25 of file kis_global.h.
| const quint8 quint8_MAX = std::numeric_limits<quint8>::max() |
Definition at line 24 of file kis_global.h.
| const quint8 SELECTION_THRESHOLD = 1 |
Definition at line 34 of file kis_global.h.