aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/libgamma-facade.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libgamma-facade.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/lib/libgamma-facade.h b/src/lib/libgamma-facade.h
index cfcf085..92a2b42 100644
--- a/src/lib/libgamma-facade.h
+++ b/src/lib/libgamma-facade.h
@@ -31,6 +31,14 @@
/**
+ * Mapping function from [0, 1] float encoding value to [0, 2⁸ − 1] integer output value.
+ *
+ * @param encoding [0, 1] float encoding value.
+ * @return [0, 2⁸ − 1] integer output value.
+ */
+typedef uint8_t libgamma_gamma_ramps8_fun(float encoding);
+
+/**
* Mapping function from [0, 1] float encoding value to [0, 2¹⁶ − 1] integer output value.
*
* @param encoding [0, 1] float encoding value.
@@ -316,6 +324,29 @@ unsigned char* libgamma_unhex_edid(const char* restrict edid);
/**
+ * Get current the gamma ramps for a CRTC, 8-bit gamma-depth version.
+ *
+ * @param this The CRTC state.
+ * @param ramps The gamma ramps to fill with the current values
+ * @return Zero on success, otherwise (negative) the value of an
+ * error identifier provided by this library.
+ */
+int libgamma_crtc_get_gamma_ramps8(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps8_t* restrict ramps);
+
+/**
+ * Set the gamma ramps for a CRTC, 8-bit gamma-depth version.
+ *
+ * @param this The CRTC state.
+ * @param ramps The gamma ramps to apply.
+ * @return Zero on success, otherwise (negative) the value of an
+ * error identifier provided by this library.
+ */
+int libgamma_crtc_set_gamma_ramps8(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps8_t ramps) __attribute__((hot));
+
+
+/**
* Get current the gamma ramps for a CRTC, 16-bit gamma-depth version.
*
* @param this The CRTC state.
@@ -431,6 +462,23 @@ int libgamma_crtc_set_gamma_rampsd(libgamma_crtc_state_t* restrict this,
/**
+ * Set the gamma ramps for a CRTC, 8-bit gamma-depth function version.
+ *
+ * Note that this will probably involve the library allocating temporary data.
+ *
+ * @param this The CRTC state.
+ * @param red_function The function that generates the the gamma ramp for the red channel.
+ * @param green_function The function that generates the the gamma ramp for the green channel.
+ * @param blue_function The function that generates the the gamma ramp for the blue channel.
+ * @return Zero on success, otherwise (negative) the value of an
+ * error identifier provided by this library.
+ */
+int libgamma_crtc_set_gamma_ramps8_f(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps8_fun* red_function,
+ libgamma_gamma_ramps8_fun* green_function,
+ libgamma_gamma_ramps8_fun* blue_function) __attribute__((cold));
+
+/**
* Set the gamma ramps for a CRTC, 16-bit gamma-depth function version.
*
* Note that this will probably involve the library allocating temporary data.