aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libgamma-facade.c174
-rw-r--r--src/libgamma-facade.h54
2 files changed, 115 insertions, 113 deletions
diff --git a/src/libgamma-facade.c b/src/libgamma-facade.c
index c50e7fa..e957fc2 100644
--- a/src/libgamma-facade.c
+++ b/src/libgamma-facade.c
@@ -819,54 +819,6 @@ unsigned char* libgamma_unhex_edid(const char* restrict edid)
/**
- * Set the gamma ramps for a CRTC, 16-bit gamma-depth version
- *
- * @param this The CRTC state
- * @parma 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_ramps(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps_t ramps)
-{
-#ifdef HAVE_NO_GAMMA_METHODS
- (void) ramps;
-#endif
-
- switch (this->partition->site->method)
- {
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
- return libgamma_dummy_crtc_set_gamma_ramps(this, ramps);
-#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
- return libgamma_randr_crtc_set_gamma_ramps(this, ramps);
-#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
- return libgamma_vidmode_crtc_set_gamma_ramps(this, ramps);
-#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
- return libgamma_drm_crtc_set_gamma_ramps(this, ramps);
-#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
- return libgamma_w32gdi_crtc_set_gamma_ramps(this, ramps);
-#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
- return libgamma_quartz_cg_crtc_set_gamma_ramps(this, ramps);
-#endif
-
- default:
- return LIBGAMMA_NO_SUCH_ADJUSTMENT_METHOD;
- }
-}
-
-
-/**
* Get current the gamma ramps for a CRTC, 16-bit gamma-depth version
*
* @param this The CRTC state
@@ -914,17 +866,16 @@ int libgamma_crtc_get_gamma_ramps(libgamma_crtc_state_t* restrict this,
}
-
/**
- * Set the gamma ramps for a CRTC, 32-bit gamma-depth version
+ * Set the gamma ramps for a CRTC, 16-bit gamma-depth version
*
* @param this The CRTC state
* @parma 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_ramps32(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps32_t ramps)
+int libgamma_crtc_set_gamma_ramps(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps_t ramps)
{
#ifdef HAVE_NO_GAMMA_METHODS
(void) ramps;
@@ -934,27 +885,27 @@ int libgamma_crtc_set_gamma_ramps32(libgamma_crtc_state_t* restrict this,
{
#ifdef HAVE_GAMMA_METHOD_DUMMY
case GAMMA_METHOD_DUMMY:
- return libgamma_dummy_crtc_set_gamma_ramps32(this, ramps);
+ return libgamma_dummy_crtc_set_gamma_ramps(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_X_RANDR
case GAMMA_METHOD_X_RANDR:
- return libgamma_randr_crtc_set_gamma_ramps32(this, ramps);
+ return libgamma_randr_crtc_set_gamma_ramps(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
case GAMMA_METHOD_X_VIDMODE:
- return libgamma_vidmode_crtc_set_gamma_ramps32(this, ramps);
+ return libgamma_vidmode_crtc_set_gamma_ramps(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
case GAMMA_METHOD_LINUX_DRM:
- return libgamma_drm_crtc_set_gamma_ramps32(this, ramps);
+ return libgamma_drm_crtc_set_gamma_ramps(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_W32_GDI
case GAMMA_METHOD_W32_GDI:
- return libgamma_w32gdi_crtc_set_gamma_ramps32(this, ramps);
+ return libgamma_w32gdi_crtc_set_gamma_ramps(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
- return libgamma_quartz_cg_crtc_set_gamma_ramps32(this, ramps);
+ return libgamma_quartz_cg_crtc_set_gamma_ramps(this, ramps);
#endif
default:
@@ -963,6 +914,7 @@ int libgamma_crtc_set_gamma_ramps32(libgamma_crtc_state_t* restrict this,
}
+
/**
* Get current the gamma ramps for a CRTC, 32-bit gamma-depth version
*
@@ -1012,15 +964,15 @@ int libgamma_crtc_get_gamma_ramps32(libgamma_crtc_state_t* restrict this,
/**
- * Set the gamma ramps for a CRTC, 64-bit gamma-depth version
+ * Set the gamma ramps for a CRTC, 32-bit gamma-depth version
*
* @param this The CRTC state
* @parma 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_ramps64(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps64_t ramps)
+int libgamma_crtc_set_gamma_ramps32(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps32_t ramps)
{
#ifdef HAVE_NO_GAMMA_METHODS
(void) ramps;
@@ -1030,27 +982,27 @@ int libgamma_crtc_set_gamma_ramps64(libgamma_crtc_state_t* restrict this,
{
#ifdef HAVE_GAMMA_METHOD_DUMMY
case GAMMA_METHOD_DUMMY:
- return libgamma_dummy_crtc_set_gamma_ramps64(this, ramps);
+ return libgamma_dummy_crtc_set_gamma_ramps32(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_X_RANDR
case GAMMA_METHOD_X_RANDR:
- return libgamma_randr_crtc_set_gamma_ramps64(this, ramps);
+ return libgamma_randr_crtc_set_gamma_ramps32(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
case GAMMA_METHOD_X_VIDMODE:
- return libgamma_vidmode_crtc_set_gamma_ramps64(this, ramps);
+ return libgamma_vidmode_crtc_set_gamma_ramps32(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
case GAMMA_METHOD_LINUX_DRM:
- return libgamma_drm_crtc_set_gamma_ramps64(this, ramps);
+ return libgamma_drm_crtc_set_gamma_ramps32(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_W32_GDI
case GAMMA_METHOD_W32_GDI:
- return libgamma_w32gdi_crtc_set_gamma_ramps64(this, ramps);
+ return libgamma_w32gdi_crtc_set_gamma_ramps32(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
- return libgamma_quartz_cg_crtc_set_gamma_ramps64(this, ramps);
+ return libgamma_quartz_cg_crtc_set_gamma_ramps32(this, ramps);
#endif
default:
@@ -1059,6 +1011,7 @@ int libgamma_crtc_set_gamma_ramps64(libgamma_crtc_state_t* restrict this,
}
+
/**
* Get current the gamma ramps for a CRTC, 64-bit gamma-depth version
*
@@ -1107,17 +1060,16 @@ int libgamma_crtc_get_gamma_ramps64(libgamma_crtc_state_t* restrict this,
}
-
/**
- * Set the gamma ramps for a CRTC, `float` version
+ * Set the gamma ramps for a CRTC, 64-bit gamma-depth version
*
* @param this The CRTC state
* @parma 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_rampsf(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_rampsf_t ramps)
+int libgamma_crtc_set_gamma_ramps64(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps64_t ramps)
{
#ifdef HAVE_NO_GAMMA_METHODS
(void) ramps;
@@ -1127,27 +1079,27 @@ int libgamma_crtc_set_gamma_rampsf(libgamma_crtc_state_t* restrict this,
{
#ifdef HAVE_GAMMA_METHOD_DUMMY
case GAMMA_METHOD_DUMMY:
- return libgamma_dummy_crtc_set_gamma_rampsf(this, ramps);
+ return libgamma_dummy_crtc_set_gamma_ramps64(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_X_RANDR
case GAMMA_METHOD_X_RANDR:
- return libgamma_randr_crtc_set_gamma_rampsf(this, ramps);
+ return libgamma_randr_crtc_set_gamma_ramps64(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
case GAMMA_METHOD_X_VIDMODE:
- return libgamma_vidmode_crtc_set_gamma_rampsf(this, ramps);
+ return libgamma_vidmode_crtc_set_gamma_ramps64(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
case GAMMA_METHOD_LINUX_DRM:
- return libgamma_drm_crtc_set_gamma_rampsf(this, ramps);
+ return libgamma_drm_crtc_set_gamma_ramps64(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_W32_GDI
case GAMMA_METHOD_W32_GDI:
- return libgamma_w32gdi_crtc_set_gamma_rampsf(this, ramps);
+ return libgamma_w32gdi_crtc_set_gamma_ramps64(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
- return libgamma_quartz_cg_crtc_set_gamma_rampsf(this, ramps);
+ return libgamma_quartz_cg_crtc_set_gamma_ramps64(this, ramps);
#endif
default:
@@ -1156,6 +1108,7 @@ int libgamma_crtc_set_gamma_rampsf(libgamma_crtc_state_t* restrict this,
}
+
/**
* Get current the gamma ramps for a CRTC, `float` version
*
@@ -1205,15 +1158,15 @@ int libgamma_crtc_get_gamma_rampsf(libgamma_crtc_state_t* restrict this,
/**
- * Set the gamma ramps for a CRTC, `double` version
+ * Set the gamma ramps for a CRTC, `float` version
*
* @param this The CRTC state
* @parma 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_rampsd(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_rampsd_t ramps)
+int libgamma_crtc_set_gamma_rampsf(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_rampsf_t ramps)
{
#ifdef HAVE_NO_GAMMA_METHODS
(void) ramps;
@@ -1223,27 +1176,27 @@ int libgamma_crtc_set_gamma_rampsd(libgamma_crtc_state_t* restrict this,
{
#ifdef HAVE_GAMMA_METHOD_DUMMY
case GAMMA_METHOD_DUMMY:
- return libgamma_dummy_crtc_set_gamma_rampsd(this, ramps);
+ return libgamma_dummy_crtc_set_gamma_rampsf(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_X_RANDR
case GAMMA_METHOD_X_RANDR:
- return libgamma_randr_crtc_set_gamma_rampsd(this, ramps);
+ return libgamma_randr_crtc_set_gamma_rampsf(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
case GAMMA_METHOD_X_VIDMODE:
- return libgamma_vidmode_crtc_set_gamma_rampsd(this, ramps);
+ return libgamma_vidmode_crtc_set_gamma_rampsf(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
case GAMMA_METHOD_LINUX_DRM:
- return libgamma_drm_crtc_set_gamma_rampsd(this, ramps);
+ return libgamma_drm_crtc_set_gamma_rampsf(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_W32_GDI
case GAMMA_METHOD_W32_GDI:
- return libgamma_w32gdi_crtc_set_gamma_rampsd(this, ramps);
+ return libgamma_w32gdi_crtc_set_gamma_rampsf(this, ramps);
#endif
#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
- return libgamma_quartz_cg_crtc_set_gamma_rampsd(this, ramps);
+ return libgamma_quartz_cg_crtc_set_gamma_rampsf(this, ramps);
#endif
default:
@@ -1252,6 +1205,7 @@ int libgamma_crtc_set_gamma_rampsd(libgamma_crtc_state_t* restrict this,
}
+
/**
* Get current the gamma ramps for a CRTC, `double` version
*
@@ -1300,6 +1254,54 @@ int libgamma_crtc_get_gamma_rampsd(libgamma_crtc_state_t* restrict this,
}
+/**
+ * Set the gamma ramps for a CRTC, `double` version
+ *
+ * @param this The CRTC state
+ * @parma 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_rampsd(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_rampsd_t ramps)
+{
+#ifdef HAVE_NO_GAMMA_METHODS
+ (void) ramps;
+#endif
+
+ switch (this->partition->site->method)
+ {
+#ifdef HAVE_GAMMA_METHOD_DUMMY
+ case GAMMA_METHOD_DUMMY:
+ return libgamma_dummy_crtc_set_gamma_rampsd(this, ramps);
+#endif
+#ifdef HAVE_GAMMA_METHOD_X_RANDR
+ case GAMMA_METHOD_X_RANDR:
+ return libgamma_randr_crtc_set_gamma_rampsd(this, ramps);
+#endif
+#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
+ case GAMMA_METHOD_X_VIDMODE:
+ return libgamma_vidmode_crtc_set_gamma_rampsd(this, ramps);
+#endif
+#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
+ case GAMMA_METHOD_LINUX_DRM:
+ return libgamma_drm_crtc_set_gamma_rampsd(this, ramps);
+#endif
+#ifdef HAVE_GAMMA_METHOD_W32_GDI
+ case GAMMA_METHOD_W32_GDI:
+ return libgamma_w32gdi_crtc_set_gamma_rampsd(this, ramps);
+#endif
+#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+ return libgamma_quartz_cg_crtc_set_gamma_rampsd(this, ramps);
+#endif
+
+ default:
+ return LIBGAMMA_NO_SUCH_ADJUSTMENT_METHOD;
+ }
+}
+
+
#ifdef HAVE_NO_GAMMA_METHODS
# pragma GCC diagnostic pop
#endif
diff --git a/src/libgamma-facade.h b/src/libgamma-facade.h
index f974206..8aae48f 100644
--- a/src/libgamma-facade.h
+++ b/src/libgamma-facade.h
@@ -240,17 +240,6 @@ unsigned char* libgamma_unhex_edid(const char* restrict edid);
/**
- * Set the gamma ramps for a CRTC, 16-bit gamma-depth version
- *
- * @param this The CRTC state
- * @parma 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_ramps(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps_t ramps);
-
-/**
* Get current the gamma ramps for a CRTC, 16-bit gamma-depth version
*
* @param this The CRTC state
@@ -261,17 +250,17 @@ int libgamma_crtc_set_gamma_ramps(libgamma_crtc_state_t* restrict this,
int libgamma_crtc_get_gamma_ramps(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_t* restrict ramps);
-
/**
- * Set the gamma ramps for a CRTC, 32-bit gamma-depth version
+ * Set the gamma ramps for a CRTC, 16-bit gamma-depth version
*
* @param this The CRTC state
* @parma 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_ramps32(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps32_t ramps);
+int libgamma_crtc_set_gamma_ramps(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps_t ramps);
+
/**
* Get current the gamma ramps for a CRTC, 32-bit gamma-depth version
@@ -284,17 +273,17 @@ int libgamma_crtc_set_gamma_ramps32(libgamma_crtc_state_t* restrict this,
int libgamma_crtc_get_gamma_ramps32(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps32_t* restrict ramps);
-
/**
- * Set the gamma ramps for a CRTC, 64-bit gamma-depth version
+ * Set the gamma ramps for a CRTC, 32-bit gamma-depth version
*
* @param this The CRTC state
* @parma 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_ramps64(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps64_t ramps);
+int libgamma_crtc_set_gamma_ramps32(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps32_t ramps);
+
/**
* Get current the gamma ramps for a CRTC, 64-bit gamma-depth version
@@ -307,6 +296,17 @@ int libgamma_crtc_set_gamma_ramps64(libgamma_crtc_state_t* restrict this,
int libgamma_crtc_get_gamma_ramps64(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps64_t* restrict ramps);
+/**
+ * Set the gamma ramps for a CRTC, 64-bit gamma-depth version
+ *
+ * @param this The CRTC state
+ * @parma 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_ramps64(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_ramps64_t ramps);
+
/**
* Set the gamma ramps for a CRTC, `float` version
@@ -332,26 +332,26 @@ int libgamma_crtc_get_gamma_rampsf(libgamma_crtc_state_t* restrict this,
/**
- * Set the gamma ramps for a CRTC, `double` version
+ * Get current the gamma ramps for a CRTC, `double` version
*
* @param this The CRTC state
- * @parma ramps The gamma ramps to apply
+ * @parma 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_set_gamma_rampsd(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_rampsd_t ramps);
+int libgamma_crtc_get_gamma_rampsd(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_rampsd_t* restrict ramps);
/**
- * Get current the gamma ramps for a CRTC, `double` version
+ * Set the gamma ramps for a CRTC, `double` version
*
* @param this The CRTC state
- * @parma ramps The gamma ramps to fill with the current values
+ * @parma 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_get_gamma_rampsd(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_rampsd_t* restrict ramps);
+int libgamma_crtc_set_gamma_rampsd(libgamma_crtc_state_t* restrict this,
+ libgamma_gamma_rampsd_t ramps);
#endif