示例#1
0
/**
 * gimp_rgb_intensity:
 * @rgb:
 *
 * This function is deprecated! Use gimp_rgb_luminance() instead.
 *
 * Return value: the intensity in the range from 0.0 to 1.0.
 **/
gdouble
gimp_rgb_intensity (const GimpRGB *rgb)
{
  gdouble intensity;

  g_return_val_if_fail (rgb != NULL, 0.0);

  intensity = GIMP_RGB_INTENSITY (rgb->r, rgb->g, rgb->b);

  return CLAMP (intensity, 0.0, 1.0);
}
示例#2
0
static VALUE
rb_GIMP_RGB_INTENSITY (VALUE self,
                       VALUE r,
                       VALUE g,
                       VALUE b)
{
  gdouble result;
  result = GIMP_RGB_INTENSITY((gdouble)NUM2DBL(r),
                              (gdouble)NUM2DBL(g),
                              (gdouble)NUM2DBL(b));

  return rb_float_new(result);
}