aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/libgamma-method.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-28 15:32:01 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-28 15:32:01 +0200
commit5a9b82bc5b9c5973ac9bda6c0ec4701c7fb88271 (patch)
tree20524d8a1fd61ef466b792e335434727fa352016 /src/lib/libgamma-method.h
parentinfo: ramps => ramps16 (diff)
downloadlibgamma-5a9b82bc5b9c5973ac9bda6c0ec4701c7fb88271.tar.gz
libgamma-5a9b82bc5b9c5973ac9bda6c0ec4701c7fb88271.tar.bz2
libgamma-5a9b82bc5b9c5973ac9bda6c0ec4701c7fb88271.tar.xz
add 8-bit ramps (good for software gamma)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/lib/libgamma-method.h74
1 files changed, 72 insertions, 2 deletions
diff --git a/src/lib/libgamma-method.h b/src/lib/libgamma-method.h
index b549a5d..c342b43 100644
--- a/src/lib/libgamma-method.h
+++ b/src/lib/libgamma-method.h
@@ -862,6 +862,44 @@ typedef struct libgamma_crtc_information
/**
+ * Gamma ramp structure for 8-bit gamma ramps.
+ */
+typedef struct libgamma_gamma_ramps8
+{
+ /**
+ * The size of `red`.
+ */
+ size_t red_size;
+
+ /**
+ * The size of `green`.
+ */
+ size_t green_size;
+
+ /**
+ * The size of `blue`.
+ */
+ size_t blue_size;
+
+ /**
+ * The gamma ramp for the red channel.
+ */
+ uint8_t* red;
+
+ /**
+ * The gamma ramp for the green channel.
+ */
+ uint8_t* green;
+
+ /**
+ * The gamma ramp for the blue channel.
+ */
+ uint8_t* blue;
+
+} libgamma_gamma_ramps8_t;
+
+
+/**
* Gamma ramp structure for 16-bit gamma ramps.
*/
typedef struct libgamma_gamma_ramps16
@@ -1062,11 +1100,43 @@ typedef struct libgamma_gamma_rampsd
* @param this The gamma ramps.
* @return Zero on success, -1 on allocation error, `errno` will be set accordingly.
*/
+int libgamma_gamma_ramps8_initialise(libgamma_gamma_ramps8_t* restrict this);
+
+/**
+ * Release resources that are held by a gamma ramp strcuture that
+ * has been allocated by `libgamma_gamma_ramps8_initialise` or otherwise
+ * initialises in the proper manner.
+ *
+ * @param this The gamma ramps.
+ */
+void libgamma_gamma_ramps8_destroy(libgamma_gamma_ramps8_t* restrict this);
+
+/**
+ * Release resources that are held by a gamma ramp strcuture that
+ * has been allocated by `libgamma_gamma_ramps8_initialise` or otherwise
+ * initialises in the proper manner, as well as release the pointer
+ * to the structure.
+ *
+ * @param this The gamma ramps.
+ */
+void libgamma_gamma_ramps8_free(libgamma_gamma_ramps8_t* restrict this);
+
+
+/**
+ * Initialise a gamma ramp in the proper way that allows all adjustment
+ * methods to read from and write to it without causing segmentation violation.
+ *
+ * The input must have `red_size`, `green_size` and `blue_size` set to the
+ * sizes of the gamma ramps that should be allocated.
+ *
+ * @param this The gamma ramps.
+ * @return Zero on success, -1 on allocation error, `errno` will be set accordingly.
+ */
int libgamma_gamma_ramps16_initialise(libgamma_gamma_ramps16_t* restrict this);
/**
* Release resources that are held by a gamma ramp strcuture that
- * has been allocated by `libgamma_gamma_ramps_initialise` or otherwise
+ * has been allocated by `libgamma_gamma_ramps16_initialise` or otherwise
* initialises in the proper manner.
*
* @param this The gamma ramps.
@@ -1075,7 +1145,7 @@ void libgamma_gamma_ramps16_destroy(libgamma_gamma_ramps16_t* restrict this);
/**
* Release resources that are held by a gamma ramp strcuture that
- * has been allocated by `libgamma_gamma_ramps_initialise` or otherwise
+ * has been allocated by `libgamma_gamma_ramps16_initialise` or otherwise
* initialises in the proper manner, as well as release the pointer
* to the structure.
*