Issue #83: improve babl_space_get_rgb_luminance() docs.
authorJehan <jehan@girinstud.io>
Tue, 6 Dec 2022 20:00:54 +0000 (21:00 +0100)
committerJehan <jehan@girinstud.io>
Tue, 6 Dec 2022 20:00:54 +0000 (21:00 +0100)
One of GIMP layer modes was using wrongfully these coefficients on
non-linear data (see gimp#3471). It was not clear from babl docs whether
babl was returning wrong coefficients for non-linear spaces, or whether
we were supposed to only ever use these coefficients on linear data.
This is the second case. So let's make the in-code docs clearer.

babl/babl.h

index 51be1ddaa6dd5e9ea3986f3430e28f1d820cc5f8..a9b47a30d6b3251373c313ddad1c8a4b1de0bac3 100644 (file)
@@ -636,6 +636,11 @@ void babl_space_get (const Babl *space,
  * @blue_luminance: (out) (optional): Location for the blue luminance factor.
  *
  * Retrieve the relevant RGB luminance constants for a babl space.
+ *
+ * Note: these luminance coefficients should only ever be used on linear data.
+ * If your input @space is non-linear, you should convert your pixel values to
+ * the linearized variant of @space before making any computation with these
+ * coefficients. See #83.
  */
 void
 babl_space_get_rgb_luminance (const Babl *space,