Krita Source Code Documentation
Loading...
Searching...
No Matches
KisStrokeCompatibilityInfo.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
7
9
10#include "kis_paintop_preset.h"
11#include "kis_node.h"
12
13namespace {
14
15inline KoResourceSignature lazySignature(KoResourceSP resource) {
16 return resource ? resource->signature() : KoResourceSignature();
17}
18
19} // namespace
20
24
26 : currentFgColor(resourcesSnapshot.currentFgColor())
27 , currentBgColor(resourcesSnapshot.currentBgColor())
28 , currentPattern(lazySignature(resourcesSnapshot.currentPattern()))
29 , currentGradient(lazySignature(resourcesSnapshot.currentGradient()))
30 , currentPreset(lazySignature(resourcesSnapshot.currentPaintOpPreset()))
31 , currentGeneratorXml(resourcesSnapshot.currentGenerator() ? resourcesSnapshot.currentGenerator()->toXML() : "")
32 , currentNode(resourcesSnapshot.currentNode() ? resourcesSnapshot.currentNode()->uuid() : QUuid())
33 , opacity(resourcesSnapshot.opacity())
34 , compositeOpId(resourcesSnapshot.compositeOpId())
35 , channelLockFlags(resourcesSnapshot.channelLockFlags())
36{
37}
38
40{
41 return
42 lhs.currentFgColor == rhs.currentFgColor &&
43 lhs.currentBgColor == rhs.currentBgColor &&
44 lhs.currentPattern == rhs.currentPattern &&
46 lhs.currentPreset == rhs.currentPreset &&
48 lhs.currentNode == rhs.currentNode &&
49 qFuzzyCompare(lhs.opacity, rhs.opacity) &&
50 lhs.compositeOpId == rhs.compositeOpId &&
52}
bool operator==(const KisStrokeCompatibilityInfo &lhs, const KisStrokeCompatibilityInfo &rhs)
The KisResourcesSnapshot class takes a snapshot of the various resources like colors and settings use...
A simple wrapper object for the main information about the resource.
static bool qFuzzyCompare(half p1, half p2)