aboutsummaryrefslogtreecommitdiffstats
path: root/libred.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-10-10 12:11:54 +0200
committerMattias Andrée <maandree@kth.se>2019-10-10 12:11:54 +0200
commita9a38b5d18bddcc25cb616275cb163afe3c1ed5e (patch)
tree8a447aeeeee04df335c48b77e9d406a301cb0f81 /libred.h
parentReference radharc (diff)
downloadlibred-1.0.1.tar.gz
libred-1.0.1.tar.bz2
libred-1.0.1.tar.xz
More documentation1.0.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libred.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/libred.h b/libred.h
index 57b17c7..3a52388 100644
--- a/libred.h
+++ b/libred.h
@@ -176,13 +176,38 @@ int libred_check_timetravel(void);
/**
* Get the [0, 1] sRGB values of a colour temperature
*
+ * libred has a table of colour temperature values, this
+ * function interpolates values that are missing. If you
+ * don't want any interpolation the `temp` parameter can
+ * be specified in one of the following ways:
+ *
+ * - floor:
+ * (temp - LIBRED_LOWEST_TEMPERATURE) /
+ * LIBRED_DELTA_TEMPERATURE *
+ * LIBRED_DELTA_TEMPERATURE +
+ * LIBRED_LOWEST_TEMPERATURE
+ *
+ * - ceiling:
+ * (temp - LIBRED_LOWEST_TEMPERATURE +
+ * LIBRED_DELTA_TEMPERATURE - 1) /
+ * LIBRED_DELTA_TEMPERATURE *
+ * LIBRED_DELTA_TEMPERATURE +
+ * LIBRED_LOWEST_TEMPERATURE
+ *
+ * - round to nearest:
+ * (temp - LIBRED_LOWEST_TEMPERATURE +
+ * LIBRED_DELTA_TEMPERATURE / 2) /
+ * LIBRED_DELTA_TEMPERATURE *
+ * LIBRED_DELTA_TEMPERATURE +
+ * LIBRED_LOWEST_TEMPERATURE
+ *
* @param temp The desired colour temperature
* @param r Output parameter for the “red” value
* @param g Output parameter for the green value
* @param b Output parameter for the blue value
* @return 0 on succeess, -1 on error
*
- * @throws EDOM The selected temperature is below 1000 K
+ * @throws EDOM The selected temperature is below 1000K
*/
int libred_get_colour(long int, double *, double *, double *);