|
Krita Source Code Documentation
|
#include <KisSurfaceColorManagerInterface.h>
Inheritance diagram for KisSurfaceColorManagerInterface:Signals | |
| void | sigPreferredSurfaceDescriptionChanged (const KisSurfaceColorimetry::SurfaceDescription &desc) |
| void | sigReadyChanged (bool value) |
Public Member Functions | |
| virtual bool | isReady () const =0 |
| KisSurfaceColorManagerInterface (QWindow *window, QObject *parent=nullptr) | |
| virtual std::optional< KisSurfaceColorimetry::SurfaceDescription > | preferredSurfaceDescription () const =0 |
| virtual std::optional< KisSurfaceColorimetry::RenderIntent > | renderingIntent () const =0 |
| virtual QFuture< bool > | setSurfaceDescription (const KisSurfaceColorimetry::SurfaceDescription &desc, KisSurfaceColorimetry::RenderIntent intent)=0 |
| virtual bool | supportsRenderIntent (const KisSurfaceColorimetry::RenderIntent &intent)=0 |
| virtual bool | supportsSurfaceDescription (const KisSurfaceColorimetry::SurfaceDescription &desc)=0 |
| virtual std::optional< KisSurfaceColorimetry::SurfaceDescription > | surfaceDescription () const =0 |
| virtual void | unsetSurfaceDescription ()=0 |
| virtual | ~KisSurfaceColorManagerInterface () |
Protected Attributes | |
| QWindow * | m_window |
An interface for fetching and setting the colorimetry information of a surface underlying a QWindow
Due to complications of some protocols (i.e. Wayland), the construction and initialization of the object may be not straight forward and may include several steps:
1) Initially, When KisSurfaceColorManagerInterface is created, it is created in a "not ready" state:
2) When initialization is completed, the interface emits sigReadyChanged() with argument set to true. At this moment all the functions of the interface are supposed to work and do what expected.
WARNING: Please take it into account that sigPreferredSurfaceDescriptionChanged() is not emitted during the initialization process. You should handle both the signals.
3) When the preferred surface color space is changed, the interface emits sigPreferredSurfaceDescriptionChanged(). This may happen when the QWindow is moved to a different screen or when the user changes the settings of the current screen.
When the connection to the compositor is lost, the interface first emits sigReadyChanged() with argument set to false, and restarts the initialization process.
Definition at line 52 of file KisSurfaceColorManagerInterface.h.
| KisSurfaceColorManagerInterface::KisSurfaceColorManagerInterface | ( | QWindow * | window, |
| QObject * | parent = nullptr ) |
Definition at line 9 of file KisSurfaceColorManagerInterface.cpp.
|
virtual |
Definition at line 15 of file KisSurfaceColorManagerInterface.cpp.
|
pure virtual |
Implemented in KisWaylandSurfaceColorManager.
|
pure virtual |
It can return std::nullopt only when the interface is not ready
Implemented in KisWaylandSurfaceColorManager.
|
pure virtual |
It can return std::nullopt if the surface description is unset or if the connection to the compositor has been lost.
Implemented in KisWaylandSurfaceColorManager.
|
pure virtual |
Sets the surface description of the linked QWindow
The operation may be asynchronous on some platforms, so you should handle a QFuture<bool> object to get the actual result.
WARNING: Please do NOT call future.waitForFinished() from the GUI thread. On some platforms (e.g. wayland) a signal from the even loop should be processed to actually set the surface description, so you'll get a deadlock if you try to wait for it in the event loop's thread.
Implemented in KisWaylandSurfaceColorManager.
|
signal |
|
signal |
|
pure virtual |
Test if the rendering intent is supported by the compositor
Implemented in KisWaylandSurfaceColorManager.
|
pure virtual |
Test if the surface description is supported by the compositor
Implemented in KisWaylandSurfaceColorManager.
|
pure virtual |
It can return std::nullopt if the surface description is unset or if the connection to the compositor has been lost.
Implemented in KisWaylandSurfaceColorManager.
|
pure virtual |
Unset the surface description of the underlying surface. In most of the compositors it means that the surface will be treated as sRGB.
Implemented in KisWaylandSurfaceColorManager.
|
protected |
Definition at line 126 of file KisSurfaceColorManagerInterface.h.