![]() | ![]() | ![]() | GIMP Color Library Reference Manual | ![]() |
---|
GimpColorSpace — Utility functions which convert colors between different color models.
struct GimpHSL; void gimp_rgb_to_hsv (const GimpRGB *rgb, GimpHSV *hsv); void gimp_rgb_to_hsl (const GimpRGB *rgb, GimpHSL *hsl); void gimp_rgb_to_cmyk (const GimpRGB *rgb, gdouble pullout, GimpCMYK *cmyk); void gimp_hsv_to_rgb (const GimpHSV *hsv, GimpRGB *rgb); void gimp_hsl_to_rgb (const GimpHSL *hsl, GimpRGB *rgb); void gimp_cmyk_to_rgb (const GimpCMYK *cmyk, GimpRGB *rgb); void gimp_rgb_to_hwb (const GimpRGB *rgb, gdouble *hue, gdouble *whiteness, gdouble *blackness); void gimp_hwb_to_rgb (gdouble hue, gdouble whiteness, gdouble blackness, GimpRGB *rgb); void gimp_rgb_to_hsv_int (gint *red, gint *green, gint *blue); void gimp_hsv_to_rgb_int (gint *hue, gint *saturation, gint *value); void gimp_rgb_to_hls_int (gint *red, gint *green, gint *blue); void gimp_rgb_to_cmyk_int (gint *red, gint *green, gint *blue, gint *pullout); void gimp_cmyk_to_rgb_int (gint *cyan, gint *magenta, gint *yellow, gint *black); gint gimp_rgb_to_l_int (gint red, gint green, gint blue); void gimp_hls_to_rgb_int (gint *hue, gint *lightness, gint *saturation); void gimp_rgb_to_hsv4 (guchar *rgb, gdouble *hue, gdouble *saturation, gdouble *value); void gimp_hsv_to_rgb4 (guchar *rgb, gdouble hue, gdouble saturation, gdouble value);
When programming pixel data manipulation functions you will often use algorithms operating on a color model different from the one GIMP uses. This file provides utility functions to concert colors between different color spaces.
void gimp_rgb_to_cmyk (const GimpRGB *rgb, gdouble pullout, GimpCMYK *cmyk);
rgb : | |
pullout : | |
cmyk : |
void gimp_rgb_to_hwb (const GimpRGB *rgb, gdouble *hue, gdouble *whiteness, gdouble *blackness);
rgb : | |
hue : | |
whiteness : | |
blackness : |
void gimp_hwb_to_rgb (gdouble hue, gdouble whiteness, gdouble blackness, GimpRGB *rgb);
hue : | |
whiteness : | |
blackness : | |
rgb : |
void gimp_rgb_to_hsv_int (gint *red, gint *green, gint *blue);
red : | |
green : | |
blue : |
void gimp_hsv_to_rgb_int (gint *hue, gint *saturation, gint *value);
hue : | |
saturation : | |
value : |
void gimp_rgb_to_hls_int (gint *red, gint *green, gint *blue);
red : | |
green : | |
blue : |
void gimp_rgb_to_cmyk_int (gint *red, gint *green, gint *blue, gint *pullout);
Does a naive conversion from RGB to CMYK colorspace. A simple formula that doesn't take any color-profiles into account is used. The amount of black pullout how can be controlled via the pullout parameter. A pullout value of 0 makes this a conversion to CMY. A value of 100 causes the maximum amount of black to be pulled out.
red : | the red channel; returns the cyan value (0-255) |
green : | the green channel; returns the magenta value (0-255) |
blue : | the blue channel; returns the yellow value (0-255) |
pullout : | the percentage of black to pull out (0-100); returns the black value (0-255) |
void gimp_cmyk_to_rgb_int (gint *cyan, gint *magenta, gint *yellow, gint *black);
cyan : | |
magenta : | |
yellow : | |
black : |
gint gimp_rgb_to_l_int (gint red, gint green, gint blue);
red : | |
green : | |
blue : | |
Returns : |
void gimp_hls_to_rgb_int (gint *hue, gint *lightness, gint *saturation);
hue : | |
lightness : | |
saturation : |
void gimp_rgb_to_hsv4 (guchar *rgb, gdouble *hue, gdouble *saturation, gdouble *value);
rgb : | |
hue : | |
saturation : | |
value : |
<< GimpCMYK | GimpAdaptiveSupersample >> |