From: Jehan Date: Tue, 6 Dec 2022 20:00:54 +0000 (+0100) Subject: Issue #83: improve babl_space_get_rgb_luminance() docs. X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2^2~46 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8a671a8f0eb6926faad80588613696c7d3c418b9;p=babl.git Issue #83: improve babl_space_get_rgb_luminance() docs. 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. --- diff --git a/babl/babl.h b/babl/babl.h index 51be1dd..a9b47a3 100644 --- a/babl/babl.h +++ b/babl/babl.h @@ -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,