Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_resources_snapshot.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2011 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_RESOURCES_SNAPSHOT_H
8#define __KIS_RESOURCES_SNAPSHOT_H
9
10#include "kis_shared.h"
11#include "kis_shared_ptr.h"
12#include "kis_types.h"
13#include "kritaui_export.h"
14#include "kis_painter.h"
15#include "kis_default_bounds.h"
16
18class KoCompositeOp;
19class KisPainter;
21class KoPattern;
23
30class KRITAUI_EXPORT KisResourcesSnapshot : public KisShared
31{
32public:
33 KisResourcesSnapshot(KisImageSP image, KisNodeSP currentNode, KoCanvasResourceProvider *resourceManager, KisDefaultBoundsBaseSP bounds = 0, KisNodeList selectedNodes = KisNodeList(), KisPaintOpPresetSP presetOverride = 0);
36
37 void setupPainter(KisPainter *painter);
38 void setupMaskingBrushPainter(KisPainter *painter);
39
40 KisPostExecutionUndoAdapter* postExecutionUndoAdapter() const;
41 void setCurrentNode(KisNodeSP node);
42 void setStrokeStyle(KisPainter::StrokeStyle strokeStyle);
43 void setFillStyle(KisPainter::FillStyle fillStyle);
44 void setFillTransform(QTransform transform);
45
46 KisNodeList selectedNodes() const;
47 KisNodeSP currentNode() const;
48 KisImageSP image() const;
49 bool needsIndirectPainting() const;
50 QString indirectPaintingCompositeOp() const;
51
52 bool needsMaskingBrushRendering() const;
53
60 KisSelectionSP activeSelection() const;
61
62 bool needsAirbrushing() const;
63 qreal airbrushingInterval() const;
64
65 bool needsSpacingUpdates() const;
66
67 void setOpacity(qreal opacity);
68 void setMirroring(bool horizontal, bool vertical);
69 qreal opacity() const;
70 QString compositeOpId() const;
71
72 KoPatternSP currentPattern() const;
73 KoColor currentFgColor() const;
74 KoColor currentBgColor() const;
75 KisPaintOpPresetSP currentPaintOpPreset() const;
76 KoAbstractGradientSP currentGradient() const;
77 KisFilterConfigurationSP currentGenerator() const;
78 bool isUsingOtherColor() const;
79
80 QTransform fillTransform() const;
81
83 QBitArray channelLockFlags() const;
84
85 qreal effectiveZoom() const;
86 bool presetAllowsLod() const;
87 bool presetNeedsAsynchronousUpdates() const;
88
89 void setFGColorOverride(const KoColor &color);
90 void setBGColorOverride(const KoColor &color);
91 void setSelectionOverride(KisSelectionSP selection);
92 void setBrush(const KisPaintOpPresetSP &brush);
93
94private:
95 struct Private;
96 Private * const m_d;
97};
98
100
101
102#endif /* __KIS_RESOURCES_SNAPSHOT_H */
FillStyle
This enum contains the styles with which we can fill things like polygons and ellipses.
StrokeStyle
The style of the brush stroke around polygons and so.
The KisResourcesSnapshot class takes a snapshot of the various resources like colors and settings use...
Write API docs here.
Definition KoPattern.h:21
#define bounds(x, a, b)
KisSharedPtr< KisResourcesSnapshot > KisResourcesSnapshotSP
QList< KisNodeSP > KisNodeList
Definition kis_types.h:264