Krita Source Code Documentation
Loading...
Searching...
No Matches
KisMultiSurfaceStateManager.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KISMULTISURFACESTATEMANAGER_H
7#define KISMULTISURFACESTATEMANAGER_H
8
9#include <kis_config.h>
10#include <KisDisplayConfig.h>
12
13#include <config-use-surface-color-management-api.h>
14
15#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
16
17#include <QPointer>
19
20#endif /* KRITA_USE_SURFACE_COLOR_MANAGEMENT_API */
21
22
23
52{
53public:
54 struct State {
55 bool isCanvasOpenGL = false;
60
61 bool operator==(const State& other) const {
62 // TODO: check actual content of proofingConfig
63 return isCanvasOpenGL == other.isCanvasOpenGL &&
65 surfaceMode == other.surfaceMode &&
67 multiConfig == other.multiConfig;
68 }
69
70 bool operator!=(const State& other) const {
71 return !(*this == other);
72 }
73 };
74
75public:
78
79#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
80 void setRootSurfaceInfoProxy(KisRootSurfaceInfoProxy *proxy);
81#endif /* KRITA_USE_SURFACE_COLOR_MANAGEMENT_API */
82
83 State createInitializingConfig(bool isCanvasOpenGL, int screenId, KisProofingConfigurationSP proofingConfig) const;
84
85 State onCanvasSurfaceFormatChanged(const State &oldState,
86 const KisDisplayConfig &canvasConfig) const;
87
88 State onGuiSurfaceFormatChanged(const State &oldState,
89 const KoColorProfile *uiProfile) const;
90
91 State onProofingChanged(const State &oldState, KisProofingConfigurationSP proofingConfig) const;
92
93 State onConfigChanged(const State &oldState,
94 int screenId,
96 const KisDisplayConfig::Options &options) const;
97
98 State onScreenChanged(const State &oldState, int screenId) const;
99
100private:
102
103private:
104#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
105 QPointer<KisRootSurfaceInfoProxy> m_rootSurfaceInfoProxy;
106#endif /* KRITA_USE_SURFACE_COLOR_MANAGEMENT_API */
107};
108
109
110#endif /* KISMULTISURFACESTATEMANAGER_H */
KisDisplayConfig This class keeps track of the color management configuration for image to display....
std::pair< KoColorConversionTransformation::Intent, KoColorConversionTransformation::ConversionFlags > Options
State createInitializingConfig(bool isCanvasOpenGL, int screenId, KisProofingConfigurationSP proofingConfig) const
KisDisplayConfig::Options overriddenWithProofingConfig(const KisDisplayConfig::Options &options, KisProofingConfigurationSP proofingConfig) const
State onCanvasSurfaceFormatChanged(const State &oldState, const KisDisplayConfig &canvasConfig) const
State onConfigChanged(const State &oldState, int screenId, KisConfig::CanvasSurfaceMode surfaceMode, const KisDisplayConfig::Options &options) const
State onScreenChanged(const State &oldState, int screenId) const
State onGuiSurfaceFormatChanged(const State &oldState, const KoColorProfile *uiProfile) const
State onProofingChanged(const State &oldState, KisProofingConfigurationSP proofingConfig) const
bool operator!=(const State &other) const
bool operator==(const State &other) const