2003-07-15 04:15:43 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
2000-01-03 06:30:20 +08:00
|
|
|
*
|
2000-01-03 09:58:43 +08:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
2003-07-15 04:15:43 +08:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-01-03 09:58:43 +08:00
|
|
|
* Library General Public License for more details.
|
2000-01-03 06:30:20 +08:00
|
|
|
*
|
2000-01-03 09:58:43 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
2000-01-03 06:30:20 +08:00
|
|
|
*/
|
|
|
|
|
2001-01-02 02:35:09 +08:00
|
|
|
#ifndef __GIMP_COLOR_SPACE_H__
|
|
|
|
#define __GIMP_COLOR_SPACE_H__
|
2000-01-03 06:30:20 +08:00
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_BEGIN_DECLS
|
2000-05-31 07:38:46 +08:00
|
|
|
|
|
|
|
/* For information look into the C source or the html documentation */
|
|
|
|
|
|
|
|
|
2000-01-03 06:30:20 +08:00
|
|
|
/* Color conversion routines */
|
|
|
|
|
2000-12-31 22:58:08 +08:00
|
|
|
|
2001-01-02 02:35:09 +08:00
|
|
|
/* GimpRGB function */
|
|
|
|
|
2003-07-15 04:15:43 +08:00
|
|
|
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,
|
|
|
|
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);
|
2001-01-02 02:35:09 +08:00
|
|
|
|
|
|
|
|
2000-12-31 22:58:08 +08:00
|
|
|
/* gint functions */
|
|
|
|
|
|
|
|
void gimp_rgb_to_hsv_int (gint *red /* returns hue */,
|
2000-02-05 06:18:50 +08:00
|
|
|
gint *green /* returns saturation */,
|
|
|
|
gint *blue /* returns value */);
|
2000-12-31 22:58:08 +08:00
|
|
|
void gimp_hsv_to_rgb_int (gint *hue /* returns red */,
|
2000-02-05 06:18:50 +08:00
|
|
|
gint *saturation /* returns green */,
|
|
|
|
gint *value /* returns blue */);
|
|
|
|
|
2003-07-15 04:15:43 +08:00
|
|
|
void gimp_rgb_to_cmyk_int (gint *red /* returns cyan */,
|
|
|
|
gint *green /* returns magenta */,
|
|
|
|
gint *blue /* returns yellow */,
|
|
|
|
gint *black /* ignored as input */);
|
|
|
|
void gimp_cmyk_to_rgb_int (gint *cyan /* returns red */,
|
|
|
|
gint *magenta /* returns green */,
|
|
|
|
gint *yellow /* returns blue */,
|
|
|
|
gint *black /* not changed */);
|
|
|
|
|
2000-12-31 22:58:08 +08:00
|
|
|
void gimp_rgb_to_hls_int (gint *red /* returns hue */,
|
2000-02-05 06:18:50 +08:00
|
|
|
gint *green /* returns lightness */,
|
|
|
|
gint *blue /* returns saturation */);
|
2000-12-31 22:58:08 +08:00
|
|
|
gint gimp_rgb_to_l_int (gint red,
|
2000-02-05 06:18:50 +08:00
|
|
|
gint green,
|
|
|
|
gint blue);
|
2000-12-31 22:58:08 +08:00
|
|
|
void gimp_hls_to_rgb_int (gint *hue /* returns red */,
|
2000-02-05 06:18:50 +08:00
|
|
|
gint *lightness /* returns green */,
|
|
|
|
gint *saturation /* returns blue */);
|
|
|
|
|
2000-12-31 22:58:08 +08:00
|
|
|
|
|
|
|
/* gdouble functions */
|
|
|
|
|
2003-07-15 04:15:43 +08:00
|
|
|
void gimp_rgb_to_hsv4 (guchar *rgb,
|
|
|
|
gdouble *hue,
|
|
|
|
gdouble *saturation,
|
2002-11-01 19:30:58 +08:00
|
|
|
gdouble *value);
|
2000-02-05 06:18:50 +08:00
|
|
|
void gimp_hsv_to_rgb4 (guchar *rgb,
|
|
|
|
gdouble hue,
|
|
|
|
gdouble saturation,
|
|
|
|
gdouble value);
|
2000-01-03 06:30:20 +08:00
|
|
|
|
2000-01-31 07:56:04 +08:00
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_END_DECLS
|
2000-05-31 07:38:46 +08:00
|
|
|
|
2001-01-02 02:35:09 +08:00
|
|
|
#endif /* __GIMP_COLOR_SPACE_H__ */
|