diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-05-21 07:43:09 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-05-21 07:43:09 +0200 |
commit | 35444bf35a56805029a090a408d5a51464803cae (patch) | |
tree | 4bd2c51ebfba4ab4a7ef6e47f034941146de9afb /src/libgamma-facade.h | |
parent | reorder functions (diff) | |
download | libgamma-35444bf35a56805029a090a408d5a51464803cae.tar.gz libgamma-35444bf35a56805029a090a408d5a51464803cae.tar.bz2 libgamma-35444bf35a56805029a090a408d5a51464803cae.tar.xz |
m + add gamma sets with mapping function rather than lookup tables
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/libgamma-facade.h')
-rw-r--r-- | src/libgamma-facade.h | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/src/libgamma-facade.h b/src/libgamma-facade.h index 8aae48f..a8e7636 100644 --- a/src/libgamma-facade.h +++ b/src/libgamma-facade.h @@ -25,6 +25,50 @@ #include <stdint.h> + +/** + * 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 uint16_t libgamma_gamma_ramps_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 + * @return [0, 2³² − 1] integer output value + */ +typedef uint32_t libgamma_gamma_ramps32_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 + * @return [0, 2⁶⁴ − 1] integer output value + */ +typedef uint64_t libgamma_gamma_ramps64_fun(float encoding); + +/** + * Mapping function from [0, 1] float encoding value to [0, 1] float output value + * + * @param encoding [0, 1] float encoding value + * @return [0, 1] float output value + */ +typedef float libgamma_gamma_rampsf_fun(float encoding); + +/** + * Mapping function from [0, 1] double precision float encoding + * value to [0, 1] double precision float output value + * + * @param encoding [0, 1] float encoding value + * @return [0, 1] float output value + */ +typedef double libgamma_gamma_rampsd_fun(double encoding); + + + /** * Return the capabilities of an adjustment method * @@ -354,5 +398,81 @@ int libgamma_crtc_set_gamma_rampsd(libgamma_crtc_state_t* restrict this, libgamma_gamma_rampsd_t ramps); +/** + * Set the gamma ramps for a CRTC, 16-bit gamma-depth function version + * + * Note that this will probably involve the library allocating temporary data + * + * @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_f(libgamma_crtc_state_t* restrict this, + libgamma_gamma_ramps_fun* red_function, + libgamma_gamma_ramps_fun* green_function, + libgamma_gamma_ramps_fun* blue_function); + +/** + * Set the gamma ramps for a CRTC, 32-bit gamma-depth function version + * + * Note that this will probably involve the library allocating temporary data + * + * @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_f(libgamma_crtc_state_t* restrict this, + libgamma_gamma_ramps32_fun* red_function, + libgamma_gamma_ramps32_fun* green_function, + libgamma_gamma_ramps32_fun* blue_function); + +/** + * Set the gamma ramps for a CRTC, 64-bit gamma-depth function version + * + * Note that this will probably involve the library allocating temporary data + * + * @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_f(libgamma_crtc_state_t* restrict this, + libgamma_gamma_ramps64_fun* red_function, + libgamma_gamma_ramps64_fun* green_function, + libgamma_gamma_ramps64_fun* blue_function); + +/** + * Set the gamma ramps for a CRTC, `float` function version + * + * Note that this will probably involve the library allocating temporary data + * + * @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_f(libgamma_crtc_state_t* restrict this, + libgamma_gamma_rampsf_fun* red_function, + libgamma_gamma_rampsf_fun* green_function, + libgamma_gamma_rampsf_fun* blue_function); + +/** + * Set the gamma ramps for a CRTC, `double` function version + * + * Note that this will probably involve the library allocating temporary data + * + * @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_f(libgamma_crtc_state_t* restrict this, + libgamma_gamma_rampsd_fun* red_function, + libgamma_gamma_rampsd_fun* green_function, + libgamma_gamma_rampsd_fun* blue_function); + + #endif |