GimpColorSpace

GimpColorSpace — Utility functions which convert colors between different color models.

Synopsis




void        gimp_rgb_to_hsv                 (const GimpRGB *rgb,
                                             GimpHSV *hsv);
void        gimp_rgb_to_hsl                 (const GimpRGB *rgb,
                                             gdouble *hue,
                                             gdouble *saturation,
                                             gdouble *lightness);
void        gimp_hsv_to_rgb                 (const GimpHSV *hsv,
                                             GimpRGB *rgb);
void        gimp_hsl_to_rgb                 (gdouble hue,
                                             gdouble saturation,
                                             gdouble lightness,
                                             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);
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_hsv_double          (gdouble *red,
                                             gdouble *green,
                                             gdouble *blue);
void        gimp_hsv_to_rgb_double          (gdouble *hue,
                                             gdouble *saturation,
                                             gdouble *value);
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);

Description

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.

Details

gimp_rgb_to_hsv ()

void        gimp_rgb_to_hsv                 (const GimpRGB *rgb,
                                             GimpHSV *hsv);

rgb :
hsv :

gimp_rgb_to_hsl ()

void        gimp_rgb_to_hsl                 (const GimpRGB *rgb,
                                             gdouble *hue,
                                             gdouble *saturation,
                                             gdouble *lightness);

rgb :
hue :
saturation :
lightness :

gimp_hsv_to_rgb ()

void        gimp_hsv_to_rgb                 (const GimpHSV *hsv,
                                             GimpRGB *rgb);

hsv :
rgb :

gimp_hsl_to_rgb ()

void        gimp_hsl_to_rgb                 (gdouble hue,
                                             gdouble saturation,
                                             gdouble lightness,
                                             GimpRGB *rgb);

hue :
saturation :
lightness :
rgb :

gimp_rgb_to_hwb ()

void        gimp_rgb_to_hwb                 (const GimpRGB *rgb,
                                             gdouble *hue,
                                             gdouble *whiteness,
                                             gdouble *blackness);

rgb :
hue :
whiteness :
blackness :

gimp_hwb_to_rgb ()

void        gimp_hwb_to_rgb                 (gdouble hue,
                                             gdouble whiteness,
                                             gdouble blackness,
                                             GimpRGB *rgb);

hue :
whiteness :
blackness :
rgb :

gimp_rgb_to_hsv_int ()

void        gimp_rgb_to_hsv_int             (gint *red,
                                             gint *green,
                                             gint *blue);

red :
green :
blue :

gimp_hsv_to_rgb_int ()

void        gimp_hsv_to_rgb_int             (gint *hue,
                                             gint *saturation,
                                             gint *value);

hue :
saturation :
value :

gimp_rgb_to_hls_int ()

void        gimp_rgb_to_hls_int             (gint *red,
                                             gint *green,
                                             gint *blue);

red :
green :
blue :

gimp_rgb_to_l_int ()

gint        gimp_rgb_to_l_int               (gint red,
                                             gint green,
                                             gint blue);

red :
green :
blue :
Returns :

gimp_hls_to_rgb_int ()

void        gimp_hls_to_rgb_int             (gint *hue,
                                             gint *lightness,
                                             gint *saturation);

hue :
lightness :
saturation :

gimp_rgb_to_hsv_double ()

void        gimp_rgb_to_hsv_double          (gdouble *red,
                                             gdouble *green,
                                             gdouble *blue);

red :
green :
blue :

gimp_hsv_to_rgb_double ()

void        gimp_hsv_to_rgb_double          (gdouble *hue,
                                             gdouble *saturation,
                                             gdouble *value);

hue :
saturation :
value :

gimp_rgb_to_hsv4 ()

void        gimp_rgb_to_hsv4                (guchar *rgb,
                                             gdouble *hue,
                                             gdouble *saturation,
                                             gdouble *value);

rgb :
hue :
saturation :
value :

gimp_hsv_to_rgb4 ()

void        gimp_hsv_to_rgb4                (guchar *rgb,
                                             gdouble hue,
                                             gdouble saturation,
                                             gdouble value);

rgb :
hue :
saturation :
value :