Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_utils.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2009 Boudewijn Rempt <boud@valdyas.org>
3 * SPDX-FileCopyrightText: 2018 Emmet & Eoin O'Neill <emmetoneill.pdx@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef KIS_TOOL_UTILS_H
9#define KIS_TOOL_UTILS_H
10
11#include <kis_types.h>
12#include <kritaui_export.h>
13
14class QPoint;
15class KoColor;
16class KoCanvasBase;
17class QPainterPath;
18
19namespace KisToolUtils {
20
21struct KRITAUI_EXPORT ColorSamplerConfig {
23
29 int radius;
30 int blend;
31
32 void save() const;
33 void load();
34private:
35 static const QString CONFIG_GROUP_NAME;
36};
37
51bool KRITAUI_EXPORT sampleColor(KoColor &out_color, KisPaintDeviceSP dev, const QPoint &pos,
52 KoColor const *const blendColor = nullptr, int radius = 1,
53 int blend = 100, bool pure = false);
54
58KisNodeSP KRITAUI_EXPORT findNode(KisNodeSP node, const QPoint &point, bool wholeGroup, bool editableOnly = true);
59
60KisNodeList KRITAUI_EXPORT findNodes(KisNodeSP node, const QPoint &point, bool wholeGroup,
61 bool includeGroups = true, bool editableOnly = true);
62
69QString KRITAUI_EXPORT nodeEditableMessage(KisNodeSP node, bool blockedNoIndirectPainting = false);
70
81QPainterPath KRITAUI_EXPORT shapeHoverInfoCrossLayer(KoCanvasBase *canvas, const QPointF &point,
82 QString &shapeType, bool *isHorizontal = nullptr, bool skipCurrentShapes = true);
92bool KRITAUI_EXPORT selectShapeCrossLayer(KoCanvasBase *canvas, const QPointF &point,
93 const QString &shapeType = QString(), bool skipCurrentShapes = true);
94
95
100bool KRITAUI_EXPORT clearImage(KisImageSP image, KisNodeList nodes, KisSelectionSP selection);
101
108void KRITAUI_EXPORT setCursorPos(const QPoint &point);
109
110void KRITAUI_EXPORT showBrushSizeFloatingMessage(KoCanvasBase *canvas, qreal size);
111
112class KRITAUI_EXPORT StandardBrushSizes {
113public:
114 StandardBrushSizes(int minSize, int maxSize);
115
116 int increaseBrushSize(qreal size);
117 int decreaseBrushSize(qreal size);
118
119private:
120 std::vector<int> m_sizes;
121};
122}
123
124#endif // KIS_TOOL_UTILS_H
void KRITAUI_EXPORT showBrushSizeFloatingMessage(KoCanvasBase *canvas, qreal size)
bool selectShapeCrossLayer(KoCanvasBase *canvas, const QPointF &point, const QString &shapeType, bool skipCurrentShapes)
selectShapeCrossLayer Tries to select a shape under the cursor regardless of which layer it is on,...
bool clearImage(KisImageSP image, KisNodeList nodes, KisSelectionSP selection)
void KRITAUI_EXPORT setCursorPos(const QPoint &point)
KisNodeList findNodes(KisNodeSP node, const QPoint &point, bool wholeGroup, bool includeGroups, bool editableOnly)
QString nodeEditableMessage(KisNodeSP node, bool blockedNoIndirectPainting)
nodeEditableMessage
QPainterPath shapeHoverInfoCrossLayer(KoCanvasBase *canvas, const QPointF &point, QString &shapeType, bool *isHorizontal, bool skipCurrentShapes)
shapeHoverInfoCrossLayer get hover info of shapes on all layers.
KisNodeSP findNode(KisNodeSP node, const QPoint &point, bool wholeGroup, bool editableOnly)
bool sampleColor(KoColor &out_color, KisPaintDeviceSP dev, const QPoint &pos, KoColor const *const blendColor, int radius, int blend, bool pure)
static const QString CONFIG_GROUP_NAME