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,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpHSV *hsv);
|
2003-07-15 04:15:43 +08:00
|
|
|
void gimp_rgb_to_hsl (const GimpRGB *rgb,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpHSL *hsl);
|
2003-07-15 04:15:43 +08:00
|
|
|
void gimp_rgb_to_cmyk (const GimpRGB *rgb,
|
2003-09-03 06:52:25 +08:00
|
|
|
gdouble pullout,
|
2003-07-15 04:15:43 +08:00
|
|
|
GimpCMYK *cmyk);
|
|
|
|
|
|
|
|
void gimp_hsv_to_rgb (const GimpHSV *hsv,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpRGB *rgb);
|
2003-07-15 04:15:43 +08:00
|
|
|
void gimp_hsl_to_rgb (const GimpHSL *hsl,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpRGB *rgb);
|
2003-07-15 04:15:43 +08:00
|
|
|
void gimp_cmyk_to_rgb (const GimpCMYK *cmyk,
|
|
|
|
GimpRGB *rgb);
|
|
|
|
|
|
|
|
void gimp_rgb_to_hwb (const GimpRGB *rgb,
|
2006-04-12 18:53:28 +08:00
|
|
|
gdouble *hue,
|
|
|
|
gdouble *whiteness,
|
|
|
|
gdouble *blackness);
|
2003-07-15 04:15:43 +08:00
|
|
|
void gimp_hwb_to_rgb (gdouble hue,
|
2006-04-12 18:53:28 +08:00
|
|
|
gdouble whiteness,
|
|
|
|
gdouble blackness,
|
|
|
|
GimpRGB *rgb);
|
2001-01-02 02:35:09 +08:00
|
|
|
|
|
|
|
|
2000-12-31 22:58:08 +08:00
|
|
|
/* gint functions */
|
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
void gimp_rgb_to_hsv_int (gint *red /* returns hue */,
|
|
|
|
gint *green /* returns saturation */,
|
|
|
|
gint *blue /* returns value */);
|
|
|
|
void gimp_hsv_to_rgb_int (gint *hue /* returns red */,
|
|
|
|
gint *saturation /* returns green */,
|
|
|
|
gint *value /* returns blue */);
|
2000-02-05 06:18:50 +08:00
|
|
|
|
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 */,
|
2003-09-03 06:52:25 +08:00
|
|
|
gint *pullout /* returns black */);
|
2003-07-15 04:15:43 +08:00
|
|
|
void gimp_cmyk_to_rgb_int (gint *cyan /* returns red */,
|
|
|
|
gint *magenta /* returns green */,
|
|
|
|
gint *yellow /* returns blue */,
|
|
|
|
gint *black /* not changed */);
|
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
void gimp_rgb_to_hsl_int (gint *red /* returns hue */,
|
|
|
|
gint *green /* returns saturation */,
|
|
|
|
gint *blue /* returns lightness */);
|
|
|
|
gint gimp_rgb_to_l_int (gint red,
|
|
|
|
gint green,
|
|
|
|
gint blue);
|
|
|
|
void gimp_hsl_to_rgb_int (gint *hue /* returns red */,
|
|
|
|
gint *saturation /* returns green */,
|
|
|
|
gint *lightness /* returns blue */);
|
2000-02-05 06:18:50 +08:00
|
|
|
|
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,
|
2006-04-12 18:53:28 +08:00
|
|
|
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__ */
|