KWin
Loading...
Searching...
No Matches
frog_colormanagement_v1.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6#pragma once
7
8#include "core/colorspace.h"
9#include "wayland/qwayland-server-frog-color-management-v1.h"
10
11#include <QObject>
12#include <QPointer>
13
14namespace KWin
15{
16
17class Display;
18class SurfaceInterface;
19
20class FrogColorManagementV1 : public QObject, private QtWaylandServer::frog_color_management_factory_v1
21{
22 Q_OBJECT
23public:
24 explicit FrogColorManagementV1(Display *display, QObject *parent);
25 ~FrogColorManagementV1() override;
26
27private:
28 void frog_color_management_factory_v1_get_color_managed_surface(Resource *resource, wl_resource *surface, uint32_t callback) override;
29 void frog_color_management_factory_v1_destroy(Resource *resource) override;
30};
31
32class FrogColorManagementSurfaceV1 : public QObject, private QtWaylandServer::frog_color_managed_surface
33{
34 Q_OBJECT
35public:
36 explicit FrogColorManagementSurfaceV1(SurfaceInterface *surface, wl_client *client, uint32_t id);
38
39 void setPreferredColorDescription(const ColorDescription &colorDescription);
40
41private:
42 void frog_color_managed_surface_set_known_transfer_function(Resource *resource, uint32_t transfer_function) override;
43 void frog_color_managed_surface_set_known_container_color_volume(Resource *resource, uint32_t primaries) override;
44 void frog_color_managed_surface_set_render_intent(Resource *resource, uint32_t render_intent) override;
45 void frog_color_managed_surface_set_hdr_metadata(Resource *resource, uint32_t mastering_display_primary_red_x, uint32_t mastering_display_primary_red_y,
46 uint32_t mastering_display_primary_green_x, uint32_t mastering_display_primary_green_y,
47 uint32_t mastering_display_primary_blue_x, uint32_t mastering_display_primary_blue_y,
48 uint32_t mastering_white_point_x, uint32_t mastering_white_point_y,
49 uint32_t max_display_mastering_luminance, uint32_t min_display_mastering_luminance,
50 uint32_t max_cll, uint32_t max_fall) override;
51 void frog_color_managed_surface_destroy(Resource *resource) override;
52 void frog_color_managed_surface_destroy_resource(Resource *resource) override;
53 void updateColorDescription();
54
55 const QPointer<SurfaceInterface> m_surface;
58 float m_maxFrameAverageBrightness = 0;
59 float m_maxPeakBrightness = 0;
60};
61
62}
Class holding the Wayland server display loop.
Definition display.h:34
void setPreferredColorDescription(const ColorDescription &colorDescription)
FrogColorManagementSurfaceV1(SurfaceInterface *surface, wl_client *client, uint32_t id)
FrogColorManagementV1(Display *display, QObject *parent)
Resource representing a wl_surface.
Definition surface.h:80
NamedColorimetry
Definition colorspace.h:17
NamedTransferFunction
Definition colorspace.h:90
struct _XDisplay Display