Krita Source Code Documentation
Loading...
Searching...
No Matches
KisWaylandDebugInfoFetcher Class Reference

#include <KisWaylandDebugInfoFetcher.h>

+ Inheritance diagram for KisWaylandDebugInfoFetcher:

Signals

void sigDebugInfoReady (const QString &report)
 

Public Member Functions

bool isReady () const
 
 KisWaylandDebugInfoFetcher (QObject *parent=nullptr)
 
QString report () const
 
 ~KisWaylandDebugInfoFetcher ()
 

Private Member Functions

QString generateReport ()
 
void reinitialize ()
 

Private Attributes

bool m_isReady {false}
 
QString m_report
 
std::shared_ptr< KisWaylandAPIColorManagerm_waylandManager
 

Detailed Description

Definition at line 13 of file KisWaylandDebugInfoFetcher.h.

Constructor & Destructor Documentation

◆ KisWaylandDebugInfoFetcher()

KisWaylandDebugInfoFetcher::KisWaylandDebugInfoFetcher ( QObject * parent = nullptr)

◆ ~KisWaylandDebugInfoFetcher()

KisWaylandDebugInfoFetcher::~KisWaylandDebugInfoFetcher ( )

Definition at line 30 of file KisWaylandDebugInfoFetcher.cpp.

31{
32}

Member Function Documentation

◆ generateReport()

QString KisWaylandDebugInfoFetcher::generateReport ( )
private

Definition at line 56 of file KisWaylandDebugInfoFetcher.cpp.

57{
58 QString report;
59
60 QDebug s(&report);
61
62 s << "Wayland color management plugin report" << Qt::endl;
63 s << Qt::endl;
64
65 if (!m_waylandManager) {
66 s << "Wayland manager is not initialized." << Qt::endl;
67 return report;
68 }
69
70 s << "Supported Features:" << Qt::endl;
71 const std::map<QtWayland::wp_color_manager_v1::feature, QString> featureNames = {
72 {QtWayland::wp_color_manager_v1::feature_icc_v2_v4, "feature_icc_v2_v4"},
73 {QtWayland::wp_color_manager_v1::feature_parametric, "feature_parametric"},
74 {QtWayland::wp_color_manager_v1::feature_set_primaries, "feature_set_primaries"},
75 {QtWayland::wp_color_manager_v1::feature_set_tf_power, "feature_set_tf_power"},
76 {QtWayland::wp_color_manager_v1::feature_set_luminances, "feature_set_luminances"},
77 {QtWayland::wp_color_manager_v1::feature_set_mastering_display_primaries, "feature_set_mastering_display_primaries"},
78 {QtWayland::wp_color_manager_v1::feature_extended_target_volume, "feature_extended_target_volume"},
79 {QtWayland::wp_color_manager_v1::feature_windows_scrgb, "feature_windows_scrgb"}
80 };
81 for (const auto &[feature, name] : featureNames) {
82 s.noquote().nospace() << " " << name << ": " << (m_waylandManager->isFeatureSupported(feature) ? "yes" : "no") << Qt::endl;
83 }
84
85 s << Qt::endl;
86 s << "Supported Render Intents:" << Qt::endl;
87 const std::map<QtWayland::wp_color_manager_v1::render_intent, QString> intentNames = {
88 {QtWayland::wp_color_manager_v1::render_intent_perceptual, "render_intent_perceptual"},
89 {QtWayland::wp_color_manager_v1::render_intent_relative, "render_intent_relative"},
90 {QtWayland::wp_color_manager_v1::render_intent_saturation, "render_intent_saturation"},
91 {QtWayland::wp_color_manager_v1::render_intent_absolute, "render_intent_absolute"},
92 {QtWayland::wp_color_manager_v1::render_intent_relative_bpc, "render_intent_relative_bpc"}
93 };
94 for (const auto &[intent, name] : intentNames) {
95 s.noquote().nospace() << " " << name << ": " << (m_waylandManager->isIntentSupported(intent) ? "yes" : "no") << Qt::endl;
96 }
97
98 s << Qt::endl;
99 s << "Supported Transfer Functions:" << Qt::endl;
100 const std::map<QtWayland::wp_color_manager_v1::transfer_function, QString> tfNames = {
101 {QtWayland::wp_color_manager_v1::transfer_function_bt1886, "transfer_function_bt1886"},
102 {QtWayland::wp_color_manager_v1::transfer_function_gamma22, "transfer_function_gamma22"},
103 {QtWayland::wp_color_manager_v1::transfer_function_gamma28, "transfer_function_gamma28"},
104 {QtWayland::wp_color_manager_v1::transfer_function_st240, "transfer_function_st240"},
105 {QtWayland::wp_color_manager_v1::transfer_function_ext_linear, "transfer_function_ext_linear"},
106 {QtWayland::wp_color_manager_v1::transfer_function_log_100, "transfer_function_log_100"},
107 {QtWayland::wp_color_manager_v1::transfer_function_log_316, "transfer_function_log_316"},
108 {QtWayland::wp_color_manager_v1::transfer_function_xvycc, "transfer_function_xvycc"},
109 {QtWayland::wp_color_manager_v1::transfer_function_srgb, "transfer_function_srgb"},
110 {QtWayland::wp_color_manager_v1::transfer_function_ext_srgb, "transfer_function_ext_srgb"},
111 {QtWayland::wp_color_manager_v1::transfer_function_st2084_pq, "transfer_function_st2084_pq"},
112 {QtWayland::wp_color_manager_v1::transfer_function_st428, "transfer_function_st428"},
113 {QtWayland::wp_color_manager_v1::transfer_function_hlg, "transfer_function_hlg"}
114 };
115 for (const auto &[tf, name] : tfNames) {
116 s.noquote().nospace() << " " << name << ": " << (m_waylandManager->isTransferFunctionNamedSupported(tf) ? "yes" : "no") << Qt::endl;
117 }
118
119 s << Qt::endl;
120 s << "Supported Primaries:" << Qt::endl;
121 const std::map<QtWayland::wp_color_manager_v1::primaries, QString> primaryNames = {
122 {QtWayland::wp_color_manager_v1::primaries_srgb, "primaries_srgb"},
123 {QtWayland::wp_color_manager_v1::primaries_pal_m, "primaries_pal_m"},
124 {QtWayland::wp_color_manager_v1::primaries_pal, "primaries_pal"},
125 {QtWayland::wp_color_manager_v1::primaries_ntsc, "primaries_ntsc"},
126 {QtWayland::wp_color_manager_v1::primaries_generic_film, "primaries_generic_film"},
127 {QtWayland::wp_color_manager_v1::primaries_bt2020, "primaries_bt2020"},
128 {QtWayland::wp_color_manager_v1::primaries_cie1931_xyz, "primaries_cie1931_xyz"},
129 {QtWayland::wp_color_manager_v1::primaries_dci_p3, "primaries_dci_p3"},
130 {QtWayland::wp_color_manager_v1::primaries_display_p3, "primaries_display_p3"},
131 {QtWayland::wp_color_manager_v1::primaries_adobe_rgb, "primaries_adobe_rgb"}
132 };
133 for (const auto &[primary, name] : primaryNames) {
134 s.noquote().nospace() << " " << name << ": " << (m_waylandManager->isPrimariesNamedSupported(primary) ? "yes" : "no") << Qt::endl;
135 }
136
137 return report;
138}
const char * name(StandardAction id)

References m_waylandManager, and report().

◆ isReady()

bool KisWaylandDebugInfoFetcher::isReady ( ) const

Definition at line 34 of file KisWaylandDebugInfoFetcher.cpp.

References m_isReady.

◆ reinitialize()

void KisWaylandDebugInfoFetcher::reinitialize ( )
private

Definition at line 44 of file KisWaylandDebugInfoFetcher.cpp.

45{
46 if (m_waylandManager->isReady()) {
48 m_isReady = true;
50 } else {
51 m_isReady = false;
52 m_report = "";
53 }
54}
void sigDebugInfoReady(const QString &report)

References generateReport(), m_isReady, m_report, m_waylandManager, and sigDebugInfoReady().

◆ report()

QString KisWaylandDebugInfoFetcher::report ( ) const

Definition at line 39 of file KisWaylandDebugInfoFetcher.cpp.

40{
41 return m_report;
42}

References m_report.

◆ sigDebugInfoReady

void KisWaylandDebugInfoFetcher::sigDebugInfoReady ( const QString & report)
signal

Member Data Documentation

◆ m_isReady

bool KisWaylandDebugInfoFetcher::m_isReady {false}
private

Definition at line 32 of file KisWaylandDebugInfoFetcher.h.

32{false};

◆ m_report

QString KisWaylandDebugInfoFetcher::m_report
private

Definition at line 33 of file KisWaylandDebugInfoFetcher.h.

◆ m_waylandManager

std::shared_ptr<KisWaylandAPIColorManager> KisWaylandDebugInfoFetcher::m_waylandManager
private

Definition at line 31 of file KisWaylandDebugInfoFetcher.h.


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