aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/defs.h9
-rw-r--r--include/kde_night_light.h11
2 files changed, 18 insertions, 2 deletions
diff --git a/include/defs.h b/include/defs.h
index b868148..4bb10d8 100644
--- a/include/defs.h
+++ b/include/defs.h
@@ -27,8 +27,17 @@ typedef enum {
} gsr_monitor_rotation;
typedef struct {
+ float red_x, red_y;
+ float green_x, green_y;
+ float blue_x, blue_y;
+ float white_x, white_y;
+} gsr_color_chromaticities;
+
+typedef struct {
float sdr_white_luminance; /* cd/m² (nits) */
float max_peak_luminance; /* cd/m² (nits) */
+ gsr_color_chromaticities primaries; /* The color volume that the monitor image is encoded in, valid when |primaries_valid| is true */
+ bool primaries_valid;
} gsr_monitor_hdr_info;
typedef enum {
diff --git a/include/kde_night_light.h b/include/kde_night_light.h
index ed12f1d..c9b65af 100644
--- a/include/kde_night_light.h
+++ b/include/kde_night_light.h
@@ -1,13 +1,20 @@
#ifndef GSR_KDE_NIGHT_LIGHT_H
#define GSR_KDE_NIGHT_LIGHT_H
+#include "defs.h"
#include <stdbool.h>
typedef struct gsr_kde_night_light gsr_kde_night_light;
+typedef enum {
+ GSR_NIGHT_LIGHT_COMPENSATION_TINT, /* The captured image contains the night light tint, including its luminance dimming */
+ GSR_NIGHT_LIGHT_COMPENSATION_TINT_KEEP_LUMINANCE /* The captured image contains the tint and the luminance dimming is normalized away by the compositors reference luminance */
+} gsr_night_light_compensation;
+
gsr_kde_night_light* gsr_kde_night_light_create(void);
void gsr_kde_night_light_destroy(gsr_kde_night_light *self);
-/* Returns true when night light is active. |inverse_matrix| is filled with the row major 3x3 matrix that removes the night light tint from linear rgb values */
-bool gsr_kde_night_light_get_inverse_matrix(gsr_kde_night_light *self, float inverse_matrix[9]);
+/* Returns true when night light is active. |inverse_matrix| is filled with the row major 3x3 matrix that removes the night light color change from linear rgb values.
+ |container_primaries| is the color volume that the captured image is encoded in, or NULL for sRGB */
+bool gsr_kde_night_light_get_inverse_matrix(gsr_kde_night_light *self, gsr_night_light_compensation compensation, const gsr_color_chromaticities *container_primaries, float inverse_matrix[9]);
#endif /* GSR_KDE_NIGHT_LIGHT_H */