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
73QPainterPath KRITAUI_EXPORT shapeHoverInfoCrossLayer(KoCanvasBase *canvas, const QPointF &point,
74 QString &shapeType, bool *isHorizontal = nullptr, bool skipCurrentShapes = true);
84bool KRITAUI_EXPORT selectShapeCrossLayer(KoCanvasBase *canvas, const QPointF &point,
85 const QString &shapeType = QString(), bool skipCurrentShapes = true);
86
87
92bool KRITAUI_EXPORT clearImage(KisImageSP image, KisNodeList nodes, KisSelectionSP selection);
93
100void KRITAUI_EXPORT setCursorPos(const QPoint &point);
101}
102
103#endif // KIS_TOOL_UTILS_H
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)
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