Krita Source Code Documentation
Loading...
Searching...
No Matches
KisOutputColorInfoInterface Class Referenceabstract

#include <KisOutputColorInfoInterface.h>

+ Inheritance diagram for KisOutputColorInfoInterface:

Signals

void sigOutputDescriptionChanged (QScreen *screen, const KisSurfaceColorimetry::SurfaceDescription &desc)
 
void sigReadyChanged (bool isReady)
 

Public Member Functions

virtual bool isReady () const =0
 
 KisOutputColorInfoInterface (QObject *parent=nullptr)
 
virtual std::optional< KisSurfaceColorimetry::SurfaceDescriptionoutputDescription (const QScreen *screen) const =0
 
virtual ~KisOutputColorInfoInterface ()
 

Protected Attributes

QWindow * m_window
 

Detailed Description

A basic interface for fetching colorimetry information from a QScreen object.

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 KisOutputColorInfoInterface is created, it is created in a "not ready" state. isReady() will return false and outputDescription() for any screen may (or may not) return std::nullopt.

2) Then the screens will asynchronously initialize. The interface will emit sigOutputDescriptionChanged() for each known interfrace.

3) When all known screens are initialized (and all sigOutputDescriptionChanged() signals are emitted), the interface emits sigReadyChanged() with argument set to true. At this point outputDescription() will return a correct description for every known 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 43 of file KisOutputColorInfoInterface.h.

Constructor & Destructor Documentation

◆ KisOutputColorInfoInterface()

KisOutputColorInfoInterface::KisOutputColorInfoInterface ( QObject * parent = nullptr)

Definition at line 9 of file KisOutputColorInfoInterface.cpp.

10 : QObject(parent)
11{
12}

◆ ~KisOutputColorInfoInterface()

KisOutputColorInfoInterface::~KisOutputColorInfoInterface ( )
virtual

Definition at line 14 of file KisOutputColorInfoInterface.cpp.

15{
16}

Member Function Documentation

◆ isReady()

virtual bool KisOutputColorInfoInterface::isReady ( ) const
pure virtual
Returns
true when the interface is considered as "fully initialized", i.e. when all screen descriptions are ready.

Implemented in KisWaylandOutputColorInfo.

◆ outputDescription()

virtual std::optional< KisSurfaceColorimetry::SurfaceDescription > KisOutputColorInfoInterface::outputDescription ( const QScreen * screen) const
pure virtual
Returns
a color space description for the specified screen

When isReady() is set to false may or may not return std::nullopt, wait for sigReadyChanged() to make sure all screens are initialized.

Implemented in KisWaylandOutputColorInfo.

◆ sigOutputDescriptionChanged

void KisOutputColorInfoInterface::sigOutputDescriptionChanged ( QScreen * screen,
const KisSurfaceColorimetry::SurfaceDescription & desc )
signal

Emits when a screen has changed its color description, e.g. when the user assigned a new color profile to this screen in the compositor

Please note that during the initialization process this signal is emitted for every screen before sigReadyChanged(true).

◆ sigReadyChanged

void KisOutputColorInfoInterface::sigReadyChanged ( bool isReady)
signal

Emits when the interface transitions between ready and non-ready states.

The interface becomes ready when the connection to the compositor is established and information about all screens is fetched.

The interface may become non-ready at any moment of time when the connection to the compositor is lost. You should wait for sigReadyChanged(true) in such a case.

Member Data Documentation

◆ m_window

QWindow* KisOutputColorInfoInterface::m_window
protected

Definition at line 87 of file KisOutputColorInfoInterface.h.


The documentation for this class was generated from the following files: