aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/gamma-helper.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-03-02 18:11:58 +0100
committerMattias Andrée <maandree@kth.se>2021-03-02 18:11:58 +0100
commitd615f10762649507aebee9419147246bb1dc2a93 (patch)
tree4b3196b0bb70b6be4dd720c4be533517634b7f7e /src/lib/gamma-helper.h
parentX RAndR: Fix connection failure detection (diff)
downloadlibgamma-d615f10762649507aebee9419147246bb1dc2a93.tar.gz
libgamma-d615f10762649507aebee9419147246bb1dc2a93.tar.bz2
libgamma-d615f10762649507aebee9419147246bb1dc2a93.tar.xz
Change license + change style + misc
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/lib/gamma-helper.h')
-rw-r--r--src/lib/gamma-helper.h182
1 files changed, 78 insertions, 104 deletions
diff --git a/src/lib/gamma-helper.h b/src/lib/gamma-helper.h
index 9ccc183..38d678d 100644
--- a/src/lib/gamma-helper.h
+++ b/src/lib/gamma-helper.h
@@ -1,20 +1,4 @@
-/**
- * libgamma -- Display server abstraction layer for gamma ramp adjustments
- * Copyright (C) 2014, 2015 Mattias Andrée (maandree@member.fsf.org)
- *
- * This library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
+/* See LICENSE file for copyright and license details. */
#ifndef LIBGAMMA_GAMMA_HELPER_H
#define LIBGAMMA_GAMMA_HELPER_H
@@ -23,148 +7,138 @@
/**
- * Gamma ramp structure union for different depths.
+ * Gamma ramp structure union for different depths
*/
-typedef union libgamma_gamma_ramps_any
-{
- /**
- * 8-bit gamma ramps.
- */
- libgamma_gamma_ramps8_t bits8;
-
- /**
- * 16-bit gamma ramps.
- */
- libgamma_gamma_ramps16_t bits16;
-
- /**
- * 32-bit gamma ramps.
- */
- libgamma_gamma_ramps32_t bits32;
-
- /**
- * 64-bit gamma ramps.
- */
- libgamma_gamma_ramps64_t bits64;
-
- /**
- * Single precision float gamma ramps.
- */
- libgamma_gamma_rampsf_t float_single;
-
- /**
- * Double precision float gamma ramps.
- */
- libgamma_gamma_rampsd_t float_double;
-
+typedef union libgamma_gamma_ramps_any {
+ /**
+ * 8-bit gamma ramps
+ */
+ libgamma_gamma_ramps8_t bits8;
+
+ /**
+ * 16-bit gamma ramps
+ */
+ libgamma_gamma_ramps16_t bits16;
+
+ /**
+ * 32-bit gamma ramps
+ */
+ libgamma_gamma_ramps32_t bits32;
+
+ /**
+ * 64-bit gamma ramps
+ */
+ libgamma_gamma_ramps64_t bits64;
+
+ /**
+ * Single precision float gamma ramps
+ */
+ libgamma_gamma_rampsf_t float_single;
+
+ /**
+ * Double precision float gamma ramps
+ */
+ libgamma_gamma_rampsd_t float_double;
+
} libgamma_gamma_ramps_any_t;
/**
- * A function for reading the gamma ramps from a CRTC.
+ * A function for reading the gamma ramps from a CRTC
*
- * @param this The CRTC state.
- * @param ramps The store for the gamma ramps.
+ * @param this The CRTC state
+ * @param ramps The store for the gamma ramps
* @return Zero on success, otherwise (negative) the value of an
- * error identifier provided by this library.
+ * error identifier provided by this library
*/
-typedef int libgamma_get_ramps_any_fun(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps_any_t* restrict ramps);
+typedef int libgamma_get_ramps_any_fun(libgamma_crtc_state_t *restrict, libgamma_gamma_ramps_any_t *restrict);
/**
- * A function for writing the gamma ramps to a CRTC.
+ * A function for writing the gamma ramps to a CRTC
*
- * @param this The CRTC state.
- * @param ramps The gamma ramps.
+ * @param this The CRTC state
+ * @param ramps The gamma ramps
* @return Zero on success, otherwise (negative) the value of an
- * error identifier provided by this library.
+ * error identifier provided by this library
*/
-typedef int libgamma_set_ramps_any_fun(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps_any_t ramps);
+typedef int libgamma_set_ramps_any_fun(libgamma_crtc_state_t *restrict, libgamma_gamma_ramps_any_t);
/**
- * Get the current gamma ramps for a CRTC, re-encoding versio.n
+ * Get the current gamma ramps for a CRTC, re-encoding version
*
- * @param this The CRTC state.
- * @param ramps The gamma ramps to fill with the current values.
+ * @param this The CRTC state
+ * @param ramps The gamma ramps to fill with the current values
* @param depth_user The depth of the gamma ramps that are provided by the user,
- * `-1` for `float`, `-2` for `double`.
+ * `-1` for `float`, `-2` for `double`
* @param depth_system The depth of the gamma ramps as required by the adjustment method,
- * `-1` for `float`, `-2` for `double`.
+ * `-1` for `float`, `-2` for `double`
* @param fun Function that is to be used read the ramps, its parameters have
* the same function as those of this function with the same names,
- * and the return value too is identical.
+ * and the return value too is identical
* @return Zero on success, otherwise (negative) the value of an
- * error identifier provided by this library.
+ * error identifier provided by this library
*/
-#define libgamma_translated_ramp_get(this, ramps, depth_user, depth_system, fun) \
- libgamma_translated_ramp_get_(this, ramps, depth_user, depth_system, \
- (libgamma_get_ramps_any_fun*)(fun))
+#define libgamma_translated_ramp_get(this, ramps, depth_user, depth_system, fun)\
+ libgamma_translated_ramp_get_((this), (ramps), (depth_user), (depth_system), (libgamma_get_ramps_any_fun *)(fun))
/**
* Set the gamma ramps for a CRTC, re-encoding version
*
- * @param this The CRTC state.
- * @param ramps The gamma ramps to apply.
+ * @param this The CRTC state
+ * @param ramps The gamma ramps to apply
* @param depth_user The depth of the gamma ramps that are provided by the user,
- * `-1` for `float`, `-2` for `double`.
+ * `-1` for `float`, `-2` for `double`
* @param depth_system The depth of the gamma ramps as required by the adjustment method,
- * `-1` for `float`, `-2` for `double`.
+ * `-1` for `float`, `-2` for `double`
* @param fun Function that is to be used write the ramps, its parameters have
* the same function as those of this function with the same names,
- * and the return value too is identical.
+ * and the return value too is identical
* @return Zero on success, otherwise (negative) the value of an
- * error identifier provided by this library.
+ * error identifier provided by this library
*/
-#define libgamma_translated_ramp_set(this, ramps, depth_user, depth_system, fun) \
- libgamma_translated_ramp_set_(this, ramps, depth_user, depth_system, \
- (libgamma_set_ramps_any_fun*)(fun))
+#define libgamma_translated_ramp_set(this, ramps, depth_user, depth_system, fun)\
+ libgamma_translated_ramp_set_((this), (ramps), (depth_user), (depth_system), (libgamma_set_ramps_any_fun *)fun)
/**
- * Get the current gamma ramps for a CRTC, re-encoding version.
+ * Get the current gamma ramps for a CRTC, re-encoding version
*
- * @param this The CRTC state.
- * @param ramps The gamma ramps to fill with the current values.
+ * @param this The CRTC state
+ * @param ramps The gamma ramps to fill with the current values
* @param depth_user The depth of the gamma ramps that are provided by the user,
- * `-1` for `float`, `-2` for `double`.
+ * `-1` for `float`, `-2` for `double`
* @param depth_system The depth of the gamma ramps as required by the adjustment method,
- * `-1` for `float`, `-2` for `double`.
+ * `-1` for `float`, `-2` for `double`
* @param fun Function that is to be used read the ramps, its parameters have
* the same function as those of this function with the same names,
- * and the return value too is identical.
+ * and the return value too is identical
* @return Zero on success, otherwise (negative) the value of an
- * error identifier provided by this library.
+ * error identifier provided by this library
*/
-int libgamma_translated_ramp_get_(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps_any_t* restrict ramps,
- signed depth_user, signed depth_system,
- libgamma_get_ramps_any_fun* fun);
+int libgamma_translated_ramp_get_(libgamma_crtc_state_t *restrict, libgamma_gamma_ramps_any_t *restrict,
+ signed, signed, libgamma_get_ramps_any_fun *);
/**
- * Set the gamma ramps for a CRTC, re-encoding version.
+ * Set the gamma ramps for a CRTC, re-encoding version
*
- * @param this The CRTC state.
- * @param ramps The gamma ramps to apply.
+ * @param this The CRTC state
+ * @param ramps The gamma ramps to apply
* @param depth_user The depth of the gamma ramps that are provided by the user,
- * `-1` for `float`, `-2` for `double`.
+ * `-1` for `float`, `-2` for `double`
* @param depth_system The depth of the gamma ramps as required by the adjustment method,
- * `-1` for `float`, `-2` for `double`.
+ * `-1` for `float`, `-2` for `double`
* @param fun Function that is to be used write the ramps, its parameters have
* the same function as those of this function with the same names,
- * and the return value too is identical.
+ * and the return value too is identical
* @return Zero on success, otherwise (negative) the value of an
- * error identifier provided by this library.
+ * error identifier provided by this library
*/
-int libgamma_translated_ramp_set_(libgamma_crtc_state_t* restrict this,
- libgamma_gamma_ramps_any_t ramps,
- signed depth_user, signed depth_system,
- libgamma_set_ramps_any_fun* fun);
+int libgamma_translated_ramp_set_(libgamma_crtc_state_t *restrict, libgamma_gamma_ramps_any_t,
+ signed, signed, libgamma_set_ramps_any_fun *);
#endif
-