2003-07-14 20:15:43 +00:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
2000-01-02 22:30:20 +00:00
|
|
|
*
|
2000-01-03 01:58:43 +00: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-14 20:15:43 +00: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 01:58:43 +00:00
|
|
|
* Library General Public License for more details.
|
2000-01-02 22:30:20 +00:00
|
|
|
*
|
2000-01-03 01:58:43 +00: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-02 22:30:20 +00:00
|
|
|
*/
|
|
|
|
|
2001-01-01 18:35:09 +00:00
|
|
|
#ifndef __GIMP_COLOR_SPACE_H__
|
|
|
|
#define __GIMP_COLOR_SPACE_H__
|
2000-01-02 22:30:20 +00:00
|
|
|
|
2001-11-22 23:46:13 +00:00
|
|
|
G_BEGIN_DECLS
|
2000-05-30 23:38:46 +00:00
|
|
|
|
|
|
|
/* For information look into the C source or the html documentation */
|
|
|
|
|
|
|
|
|
2000-01-02 22:30:20 +00:00
|
|
|
/* Color conversion routines */
|
|
|
|
|
2000-12-31 14:58:08 +00:00
|
|
|
|
2001-01-01 18:35:09 +00:00
|
|
|
/* GimpRGB function */
|
|
|
|
|
2003-07-14 20:15:43 +00:00
|
|
|
void gimp_rgb_to_hsv (const GimpRGB *rgb,
|
2006-04-12 10:53:28 +00:00
|
|
|
GimpHSV *hsv);
|
2003-07-14 20:15:43 +00:00
|
|
|
void gimp_rgb_to_hsl (const GimpRGB *rgb,
|
2006-04-12 10:53:28 +00:00
|
|
|
GimpHSL *hsl);
|
2003-07-14 20:15:43 +00:00
|
|
|
void gimp_rgb_to_cmyk (const GimpRGB *rgb,
|
2003-09-02 22:52:25 +00:00
|
|
|
gdouble pullout,
|
2003-07-14 20:15:43 +00:00
|
|
|
GimpCMYK *cmyk);
|
|
|
|
|
|
|
|
void gimp_hsv_to_rgb (const GimpHSV *hsv,
|
2006-04-12 10:53:28 +00:00
|
|
|
GimpRGB *rgb);
|
2003-07-14 20:15:43 +00:00
|
|
|
void gimp_hsl_to_rgb (const GimpHSL *hsl,
|
2006-04-12 10:53:28 +00:00
|
|
|
GimpRGB *rgb);
|
2003-07-14 20:15:43 +00:00
|
|
|
void gimp_cmyk_to_rgb (const GimpCMYK *cmyk,
|
|
|
|
GimpRGB *rgb);
|
|
|
|
|
|
|
|
void gimp_rgb_to_hwb (const GimpRGB *rgb,
|
2006-04-12 10:53:28 +00:00
|
|
|
gdouble *hue,
|
|
|
|
gdouble *whiteness,
|
|
|
|
gdouble *blackness);
|
2003-07-14 20:15:43 +00:00
|
|
|
void gimp_hwb_to_rgb (gdouble hue,
|
2006-04-12 10:53:28 +00:00
|
|
|
gdouble whiteness,
|
|
|
|
gdouble blackness,
|
|
|
|
GimpRGB *rgb);
|
2001-01-01 18:35:09 +00:00
|
|
|
|
|
|
|
|
2000-12-31 14:58:08 +00:00
|
|
|
/* gint functions */
|
|
|
|
|
2006-06-21 15:26:45 +00:00
|
|
|
void gimp_rgb_to_hsv_int (gint *red /* returns hue */,
|
2006-04-12 10:53:28 +00:00
|
|
|
gint *green /* returns saturation */,
|
|
|
|
gint *blue /* returns value */);
|
2006-06-21 15:26:45 +00:00
|
|
|
void gimp_hsv_to_rgb_int (gint *hue /* returns red */,
|
2006-04-12 10:53:28 +00:00
|
|
|
gint *saturation /* returns green */,
|
|
|
|
gint *value /* returns blue */);
|
2000-02-04 22:18:50 +00:00
|
|
|
|
2003-07-14 20:15:43 +00:00
|
|
|
void gimp_rgb_to_cmyk_int (gint *red /* returns cyan */,
|
|
|
|
gint *green /* returns magenta */,
|
|
|
|
gint *blue /* returns yellow */,
|
2003-09-02 22:52:25 +00:00
|
|
|
gint *pullout /* returns black */);
|
2003-07-14 20:15:43 +00:00
|
|
|
void gimp_cmyk_to_rgb_int (gint *cyan /* returns red */,
|
|
|
|
gint *magenta /* returns green */,
|
|
|
|
gint *yellow /* returns blue */,
|
|
|
|
gint *black /* not changed */);
|
|
|
|
|
2006-06-21 15:26:45 +00:00
|
|
|
void gimp_rgb_to_hsl_int (gint *red /* returns hue */,
|
2006-04-12 10:53:28 +00:00
|
|
|
gint *green /* returns saturation */,
|
|
|
|
gint *blue /* returns lightness */);
|
2006-06-21 15:26:45 +00:00
|
|
|
gint gimp_rgb_to_l_int (gint red,
|
2006-04-12 10:53:28 +00:00
|
|
|
gint green,
|
|
|
|
gint blue);
|
2006-06-21 15:26:45 +00:00
|
|
|
void gimp_hsl_to_rgb_int (gint *hue /* returns red */,
|
2006-04-12 10:53:28 +00:00
|
|
|
gint *saturation /* returns green */,
|
|
|
|
gint *lightness /* returns blue */);
|
2000-02-04 22:18:50 +00:00
|
|
|
|
2000-12-31 14:58:08 +00:00
|
|
|
|
|
|
|
/* gdouble functions */
|
|
|
|
|
2006-06-06 08:35:55 +00:00
|
|
|
void gimp_rgb_to_hsv4 (const guchar *rgb,
|
|
|
|
gdouble *hue,
|
|
|
|
gdouble *saturation,
|
|
|
|
gdouble *value);
|
|
|
|
void gimp_hsv_to_rgb4 (guchar *rgb,
|
|
|
|
gdouble hue,
|
|
|
|
gdouble saturation,
|
|
|
|
gdouble value);
|
2000-01-02 22:30:20 +00:00
|
|
|
|
2000-01-30 23:56:04 +00:00
|
|
|
|
2001-11-22 23:46:13 +00:00
|
|
|
G_END_DECLS
|
2000-05-30 23:38:46 +00:00
|
|
|
|
2001-01-01 18:35:09 +00:00
|
|
|
#endif /* __GIMP_COLOR_SPACE_H__ */
|