libgimpcolor, plugin: Remove gimp_rgb_luminance ()

This patch removes the two instances of
gimp_rgb_luminance_uchar () and one
instance of gimp_rgb_luminance () from
the codebase.
* plug-ins/common/checkerboard.c:
 Use gegl_color_get_pixel () to get the
 luminance value at the same time we're
 getting the RGBA value from the GeglColor.
 * plug-ins/gradient-flare/gradient-flare.c:
 Replace with GIMP_RGB_LUMINANCE ()
 macro, which does not use GimpRGB.
This commit is contained in:
Alx Sa 2024-09-02 02:41:47 +00:00
parent fd091bc005
commit b44687eb2f
5 changed files with 28 additions and 62 deletions

View file

@ -82,8 +82,6 @@ EXPORTS
gimp_rgb_composite
gimp_rgb_get_type
gimp_rgb_get_uchar
gimp_rgb_luminance
gimp_rgb_luminance_uchar
gimp_rgb_max
gimp_rgb_min
gimp_rgb_multiply

View file

@ -197,42 +197,6 @@ gimp_rgb_clamp (GimpRGB *rgb)
rgb->a = CLAMP (rgb->a, 0.0, 1.0);
}
/**
* gimp_rgb_luminance:
* @rgb: a #GimpRGB struct
*
* Returns: the luminous intensity of the range from 0.0 to 1.0.
*
* Since: 2.4
**/
gdouble
gimp_rgb_luminance (const GimpRGB *rgb)
{
gdouble luminance;
g_return_val_if_fail (rgb != NULL, 0.0);
luminance = GIMP_RGB_LUMINANCE (rgb->r, rgb->g, rgb->b);
return CLAMP (luminance, 0.0, 1.0);
}
/**
* gimp_rgb_luminance_uchar:
* @rgb: a #GimpRGB struct
*
* Returns: the luminous intensity in the range from 0 to 255.
*
* Since: 2.4
**/
guchar
gimp_rgb_luminance_uchar (const GimpRGB *rgb)
{
g_return_val_if_fail (rgb != NULL, 0);
return ROUND (gimp_rgb_luminance (rgb) * 255.0);
}
void
gimp_rgb_composite (GimpRGB *color1,
const GimpRGB *color2,

View file

@ -78,9 +78,6 @@ gdouble gimp_rgb_max (const GimpRGB *rgb);
gdouble gimp_rgb_min (const GimpRGB *rgb);
void gimp_rgb_clamp (GimpRGB *rgb);
gdouble gimp_rgb_luminance (const GimpRGB *rgb);
guchar gimp_rgb_luminance_uchar (const GimpRGB *rgb);
void gimp_rgb_composite (GimpRGB *color1,
const GimpRGB *color2,
GimpRGBCompositeMode mode);