Some more gtkdocs.

2003-10-14  Dave Neary  <bolsh@gimp.org>

        * libgimpcolor/gimpcolorspace.c: Some more gtkdocs.
This commit is contained in:
Dave Neary 2003-10-14 21:54:42 +00:00 committed by David Neary
parent 0eb7e92a15
commit 4cfb8d3dcd
2 changed files with 91 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2003-10-14 Dave Neary <bolsh@gimp.org>
* libgimpcolor/gimpcolorspace.c: Some more gtkdocs.
2003-10-14 Sven Neumann <sven@gimp.org> 2003-10-14 Sven Neumann <sven@gimp.org>
* app/composite/gimp-composite.h: don't use gtk-doc style comments * app/composite/gimp-composite.h: don't use gtk-doc style comments

View File

@ -182,7 +182,7 @@ gimp_hsv_to_rgb (const GimpHSV *hsv,
* @rgb: A color value in the RGB colorspace * @rgb: A color value in the RGB colorspace
* @hsl: The value converted to HSL * @hsl: The value converted to HSL
* *
* Convert an RGB color value to a HSL (Hue, Saturation, Luminosity) color * Convert an RGB color value to a HSL (Hue, Saturation, Lightness) color
* value. * value.
**/ **/
void void
@ -401,6 +401,21 @@ gimp_cmyk_to_rgb (const GimpCMYK *cmyk,
* be defined as 0 in situations where only unsigned numbers are desired. * be defined as 0 in situations where only unsigned numbers are desired.
*****************************************************************************/ *****************************************************************************/
/**
* gimp_rgb_to_hwb:
* @rgb: A color value in the RGB colorspace
* @hue: The hue value of the above color, in the range 0 to 6
* @whiteness: The whiteness value of the above color, in the range 0 to 1
* @blackness: The blackness value of the above color, in the range 0 to 1
*
* Theoretically, hue 0 (pure red) is identical to hue 6 in these transforms.
* Pure red always maps to 6 in this implementation. Therefore UNDEFINED can
* be defined as 0 in situations where only unsigned numbers are desired.
*
* RGB are each on [0, 1]. Whiteness and Blackness are returned in the
* range [0, 1] and H is returned in the range [0, 6]. If W == 1 - B, H is
* undefined.
**/
void void
gimp_rgb_to_hwb (const GimpRGB *rgb, gimp_rgb_to_hwb (const GimpRGB *rgb,
gdouble *hue, gdouble *hue,
@ -435,6 +450,16 @@ gimp_rgb_to_hwb (const GimpRGB *rgb,
} }
} }
/**
* gimp_hwb_to_rgb:
* @hue: A hue value, in the range 0 to 6
* @whiteness: A whiteness value, in the range 0 to 1
* @blackness: A blackness value, in the range 0 to 1
* @rgb: The above color converted to the RGB colorspace
*
* H is defined in the range [0, 6] or UNDEFINED, B and W are both in the
* range [0, 1]. The returned RGB values are all in the range [0, 1].
**/
void void
gimp_hwb_to_rgb (gdouble hue, gimp_hwb_to_rgb (gdouble hue,
gdouble whiteness, gdouble whiteness,
@ -491,6 +516,19 @@ gimp_hwb_to_rgb (gdouble hue,
/* gint functions */ /* gint functions */
/**
* gimp_rgb_to_hsv_int:
* @red: The red channel value, returns the Hue channel
* @green: The green channel value, returns the Saturation channel
* @blue: The blue channel value, returns the Value channel
*
* The arguments are pointers to int representing channel values in the
* RGB colorspace, and the values pointed to are all in the range [0, 255].
*
* The function changes the arguments to point to the HSV value corresponding,
* with the returned values in the following
* ranges: H [0, 360], S [0, 255], V [0, 255].
**/
void void
gimp_rgb_to_hsv_int (gint *red, gimp_rgb_to_hsv_int (gint *red,
gint *green, gint *green,
@ -545,6 +583,18 @@ gimp_rgb_to_hsv_int (gint *red,
*blue = ROUND (v); *blue = ROUND (v);
} }
/**
* gimp_hsv_to_rgb_int:
* @hue: The hue channel, returns the red channel
* @saturation: The saturation channel, returns the green channel
* @value: The value channel, returns the blue channel
*
* The arguments are pointers to int, with the values pointed to in the
* following ranges: H [0, 360], S [0, 255], V [0, 255].
*
* The function changes the arguments to point to the RGB value
* corresponding, with the returned values all in the range [0, 255].
**/
void void
gimp_hsv_to_rgb_int (gint *hue, gimp_hsv_to_rgb_int (gint *hue,
gint *saturation, gint *saturation,
@ -619,6 +669,19 @@ gimp_hsv_to_rgb_int (gint *hue,
} }
} }
/**
* gimp_rgb_to_hls_int:
* @red: Red channel, returns Hue channel
* @green: Green channel, returns Lightness channel
* @blue: Blue channel, returns Saturation channel
*
* The arguments are pointers to int representing channel values in the
* RGB colorspace, and the values pointed to are all in the range [0, 255].
*
* The function changes the arguments to point to the corresponding HLS
* value with the values pointed to in the following ranges: H [0, 360],
* L [0, 255], S [0, 255].
**/
void void
gimp_rgb_to_hls_int (gint *red, gimp_rgb_to_hls_int (gint *red,
gint *green, gint *green,
@ -680,6 +743,17 @@ gimp_rgb_to_hls_int (gint *red,
*blue = ROUND (s); *blue = ROUND (s);
} }
/**
* gimp_rgb_to_l_int:
* @red: Red channel
* @green: Green channel
* @blue: Blue channel
*
* Calculates the luminance value of an RGB triplet with the formula
* L = (max(R, G, B) + min (R, G, B)) / 2
*
* Return value: Luminance vaue corresponding to the input RGB value
**/
gint gint
gimp_rgb_to_l_int (gint red, gimp_rgb_to_l_int (gint red,
gint green, gint green,
@ -725,6 +799,18 @@ gimp_hls_value (gdouble n1,
return ROUND (value * 255.0); return ROUND (value * 255.0);
} }
/**
* gimp_hls_to_rgb_int:
* @hue: Hue channel, returns Red channel
* @lightness: Lightness channel, returns Green channel
* @saturation: Saturation channel, returns Blue channel
*
* The arguments are pointers to int, with the values pointed to in the
* following ranges: H [0, 360], L [0, 255], S [0, 255].
*
* The function changes the arguments to point to the RGB value
* corresponding, with the returned values all in the range [0, 255].
**/
void void
gimp_hls_to_rgb_int (gint *hue, gimp_hls_to_rgb_int (gint *hue,
gint *lightness, gint *lightness,