20 case QtWayland::wp_color_manager_v1::transfer_function_bt1886:
23 case QtWayland::wp_color_manager_v1::transfer_function_gamma22:
26 case QtWayland::wp_color_manager_v1::transfer_function_gamma28:
29 case QtWayland::wp_color_manager_v1::transfer_function_st240:
32 case QtWayland::wp_color_manager_v1::transfer_function_ext_linear:
35 case QtWayland::wp_color_manager_v1::transfer_function_log_100:
38 case QtWayland::wp_color_manager_v1::transfer_function_log_316:
41 case QtWayland::wp_color_manager_v1::transfer_function_xvycc:
44 case QtWayland::wp_color_manager_v1::transfer_function_srgb:
47 case QtWayland::wp_color_manager_v1::transfer_function_ext_srgb:
50 case QtWayland::wp_color_manager_v1::transfer_function_st2084_pq:
53 case QtWayland::wp_color_manager_v1::transfer_function_st428:
56 case QtWayland::wp_color_manager_v1::transfer_function_hlg:
67 case QtWayland::wp_color_manager_v1::primaries_srgb:
70 case QtWayland::wp_color_manager_v1::primaries_pal_m:
73 case QtWayland::wp_color_manager_v1::primaries_pal:
76 case QtWayland::wp_color_manager_v1::primaries_ntsc:
79 case QtWayland::wp_color_manager_v1::primaries_generic_film:
82 case QtWayland::wp_color_manager_v1::primaries_bt2020:
85 case QtWayland::wp_color_manager_v1::primaries_cie1931_xyz:
88 case QtWayland::wp_color_manager_v1::primaries_dci_p3:
91 case QtWayland::wp_color_manager_v1::primaries_display_p3:
94 case QtWayland::wp_color_manager_v1::primaries_adobe_rgb:
113 }
else if (std::holds_alternative<KisSurfaceColorimetry::Colorimetry>(description.
colorSpace.
primaries)) {
117 case QtWayland::wp_color_manager_v1::primaries_srgb:
120 case QtWayland::wp_color_manager_v1::primaries_pal_m:
123 case QtWayland::wp_color_manager_v1::primaries_pal:
126 case QtWayland::wp_color_manager_v1::primaries_ntsc:
129 case QtWayland::wp_color_manager_v1::primaries_generic_film:
132 case QtWayland::wp_color_manager_v1::primaries_bt2020:
135 case QtWayland::wp_color_manager_v1::primaries_cie1931_xyz:
138 case QtWayland::wp_color_manager_v1::primaries_dci_p3:
141 case QtWayland::wp_color_manager_v1::primaries_display_p3:
144 case QtWayland::wp_color_manager_v1::primaries_adobe_rgb:
214 dbg.nospace() << Qt::fixed << qSetRealNumberPrecision(5) <<
"KisColorPrimaries("
215 <<
"red: " << points.
red <<
", "
216 <<
"green: " << points.
green <<
", "
217 <<
"blue: " << points.
blue <<
", "
218 <<
"white: " << points.
white
226 dbg.nospace() <<
"WaylandSurfaceDescription(";
228 auto printOptionalTag = [&dbg](
const char *tag,
const auto &
value) {
229 dbg.nospace() << tag <<
": ";
231 dbg << *
value <<
", ";
233 dbg <<
"none" <<
", ";
237 printOptionalTag(
"tfGamma", data.
tfGamma);
238 printOptionalTag(
"tfNamed", data.
tfNamed);
239 printOptionalTag(
"container", data.
container);
241 printOptionalTag(
"target", data.
target);
242 printOptionalTag(
"luminances", data.
luminances);
249 dbg.nospace() <<
")";
257 using primaries_type = QtWayland::wp_color_manager_v1::primaries;
261 return primaries_type::primaries_srgb;
263 return primaries_type::primaries_bt2020;
265 return primaries_type::primaries_dci_p3;
267 return primaries_type::primaries_display_p3;
269 return primaries_type::primaries_adobe_rgb;
271 Q_ASSERT(0 &&
"trying to set unknown named primary to the surface");
273 return primaries_type::primaries_srgb;
279 using transfer_function_type = QtWayland::wp_color_manager_v1::transfer_function;
281 switch (transferFunction) {
283 return transfer_function_type::transfer_function_bt1886;
285 return transfer_function_type::transfer_function_gamma22;
287 return transfer_function_type::transfer_function_gamma28;
289 return transfer_function_type::transfer_function_ext_linear;
291 return transfer_function_type::transfer_function_srgb;
293 return transfer_function_type::transfer_function_ext_srgb;
295 return transfer_function_type::transfer_function_st2084_pq;
297 return transfer_function_type::transfer_function_st428;
299 Q_ASSERT(0 &&
"trying to set unknown named transfer function to the surface");
301 return transfer_function_type::transfer_function_srgb;
310 return QtWayland::wp_color_manager_v1::render_intent::render_intent_perceptual;
312 return QtWayland::wp_color_manager_v1::render_intent::render_intent_relative;
314 return QtWayland::wp_color_manager_v1::render_intent::render_intent_saturation;
316 return QtWayland::wp_color_manager_v1::render_intent::render_intent_absolute;
318 return QtWayland::wp_color_manager_v1::render_intent::render_intent_relative_bpc;
320 Q_ASSERT(
false &&
"Unknown RenderIntent value");
321 return QtWayland::wp_color_manager_v1::render_intent::render_intent_perceptual;
332QDebug
operator<<(QDebug debug, QtWayland::wp_color_manager_v1::primaries
p)
334 QDebugStateSaver saver(debug);
336 case QtWayland::wp_color_manager_v1::primaries_srgb:
339 case QtWayland::wp_color_manager_v1::primaries_pal_m:
342 case QtWayland::wp_color_manager_v1::primaries_pal:
345 case QtWayland::wp_color_manager_v1::primaries_ntsc:
348 case QtWayland::wp_color_manager_v1::primaries_generic_film:
349 debug <<
"generic_film";
351 case QtWayland::wp_color_manager_v1::primaries_bt2020:
354 case QtWayland::wp_color_manager_v1::primaries_cie1931_xyz:
355 debug <<
"cie1931_xyz";
357 case QtWayland::wp_color_manager_v1::primaries_dci_p3:
360 case QtWayland::wp_color_manager_v1::primaries_display_p3:
361 debug <<
"display_p3";
363 case QtWayland::wp_color_manager_v1::primaries_adobe_rgb:
364 debug <<
"adobe_rgb";
367 debug <<
"Unknown primaries:" <<
static_cast<int>(
p);
373QDebug
operator<<(QDebug debug, QtWayland::wp_color_manager_v1::feature f)
375 QDebugStateSaver saver(debug);
377 case QtWayland::wp_color_manager_v1::feature_icc_v2_v4:
378 debug <<
"icc_v2_v4";
380 case QtWayland::wp_color_manager_v1::feature_parametric:
381 debug <<
"parametric";
383 case QtWayland::wp_color_manager_v1::feature_set_primaries:
384 debug <<
"set_primaries";
386 case QtWayland::wp_color_manager_v1::feature_set_tf_power:
387 debug <<
"set_tf_power";
389 case QtWayland::wp_color_manager_v1::feature_set_luminances:
390 debug <<
"set_luminances";
392 case QtWayland::wp_color_manager_v1::feature_set_mastering_display_primaries:
393 debug <<
"set_mastering_display_primaries";
395 case QtWayland::wp_color_manager_v1::feature_extended_target_volume:
396 debug <<
"extended_target_volume";
398 case QtWayland::wp_color_manager_v1::feature_windows_scrgb:
399 debug <<
"windows_scrgb";
402 debug <<
"Unknown feature:" <<
static_cast<int>(f);
408QDebug
operator<<(QDebug debug, QtWayland::wp_color_manager_v1::render_intent ri)
410 QDebugStateSaver saver(debug);
412 case QtWayland::wp_color_manager_v1::render_intent_perceptual:
413 debug <<
"perceptual";
415 case QtWayland::wp_color_manager_v1::render_intent_relative:
418 case QtWayland::wp_color_manager_v1::render_intent_saturation:
419 debug <<
"saturation";
421 case QtWayland::wp_color_manager_v1::render_intent_absolute:
424 case QtWayland::wp_color_manager_v1::render_intent_relative_bpc:
425 debug <<
"relative_bpc";
428 debug <<
"Unknown render intent:" <<
static_cast<int>(ri);
434QDebug
operator<<(QDebug debug, QtWayland::wp_color_manager_v1::transfer_function tf)
436 QDebugStateSaver saver(debug);
438 case QtWayland::wp_color_manager_v1::transfer_function_bt1886:
441 case QtWayland::wp_color_manager_v1::transfer_function_gamma22:
444 case QtWayland::wp_color_manager_v1::transfer_function_gamma28:
447 case QtWayland::wp_color_manager_v1::transfer_function_st240:
450 case QtWayland::wp_color_manager_v1::transfer_function_ext_linear:
451 debug <<
"ext_linear";
453 case QtWayland::wp_color_manager_v1::transfer_function_log_100:
456 case QtWayland::wp_color_manager_v1::transfer_function_log_316:
459 case QtWayland::wp_color_manager_v1::transfer_function_xvycc:
462 case QtWayland::wp_color_manager_v1::transfer_function_srgb:
465 case QtWayland::wp_color_manager_v1::transfer_function_ext_srgb:
468 case QtWayland::wp_color_manager_v1::transfer_function_st2084_pq:
469 debug <<
"st2084_pq";
471 case QtWayland::wp_color_manager_v1::transfer_function_st428:
474 case QtWayland::wp_color_manager_v1::transfer_function_hlg:
478 debug <<
"Unknown transfer function:" <<
static_cast<int>(tf);
float value(const T *src, size_t ch)
QDebug operator<<(QDebug debug, QtWayland::wp_color_manager_v1::primaries p)
static const Colorimetry GenericFilm
static const Colorimetry PAL
static const Colorimetry NTSC
static const Colorimetry PAL_M
static const Colorimetry AdobeRGB
static const Colorimetry BT709
static const Colorimetry CIEXYZ
static const Colorimetry DisplayP3
static const Colorimetry BT2020
static const Colorimetry DCIP3
QDebug operator<<(QDebug debug, const xy &value)
@ render_intent_perceptual
@ render_intent_saturation
@ render_intent_relative_bpc
QtWayland::wp_color_manager_v1::render_intent renderIntentKritaToWayland(KisSurfaceColorimetry::RenderIntent intent)
QtWayland::wp_color_manager_v1::primaries primariesKritaToWayland(KisSurfaceColorimetry::NamedPrimaries primaries)
QtWayland::wp_color_manager_v1::transfer_function transferFunctionKritaToWayland(KisSurfaceColorimetry::NamedTransferFunction transferFunction)
@ transfer_function_st428
@ transfer_function_bt1886
@ transfer_function_unknown
@ transfer_function_st2084_pq
@ transfer_function_gamma22
@ transfer_function_ext_linear
@ transfer_function_gamma28
@ transfer_function_ext_srgb
std::optional< Luminance > luminance
std::variant< NamedPrimaries, Colorimetry > primaries
std::variant< NamedTransferFunction, uint32_t > transferFunction
std::optional< uint32_t > maxCll
std::optional< uint32_t > maxFall
MasteringLuminance luminance
static MasteringLuminance fromLuminance(const Luminance &rhs)
std::optional< MasteringInfo > masteringInfo
static WaylandPrimaries fromColorimetry(const Colorimetry &colorimetry)
std::optional< KisSurfaceColorimetry::Luminance > luminances
std::optional< uint32_t > targetMaxFALL
std::optional< WaylandPrimaries > target
std::optional< KisSurfaceColorimetry::MasteringLuminance > masteringLuminance
std::optional< transfer_function > tfNamed
std::optional< uint32_t > targetMaxCLL
std::optional< WaylandPrimaries > container
std::optional< uint32_t > tfGamma
static WaylandSurfaceDescription fromSurfaceDescription(const SurfaceDescription &desc)
SurfaceDescription toSurfaceDescription() const
std::optional< primaries > namedContainer