gimpcolorspace.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* LIBGIMP - The GIMP Library
  2. * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  3. *
  4. * This library is free software: you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 3 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library. If not, see
  16. * <http://www.gnu.org/licenses/>.
  17. */
  18. #if !defined (__GIMP_COLOR_H_INSIDE__) && !defined (GIMP_COLOR_COMPILATION)
  19. #error "Only <libgimpcolor/gimpcolor.h> can be included directly."
  20. #endif
  21. #ifndef __GIMP_COLOR_SPACE_H__
  22. #define __GIMP_COLOR_SPACE_H__
  23. G_BEGIN_DECLS
  24. /* For information look into the C source or the html documentation */
  25. /* Color conversion routines */
  26. /* GimpRGB function */
  27. void gimp_rgb_to_hsv (const GimpRGB *rgb,
  28. GimpHSV *hsv);
  29. void gimp_rgb_to_hsl (const GimpRGB *rgb,
  30. GimpHSL *hsl);
  31. void gimp_rgb_to_cmyk (const GimpRGB *rgb,
  32. gdouble pullout,
  33. GimpCMYK *cmyk);
  34. void gimp_hsv_to_rgb (const GimpHSV *hsv,
  35. GimpRGB *rgb);
  36. void gimp_hsl_to_rgb (const GimpHSL *hsl,
  37. GimpRGB *rgb);
  38. void gimp_cmyk_to_rgb (const GimpCMYK *cmyk,
  39. GimpRGB *rgb);
  40. void gimp_rgb_to_hwb (const GimpRGB *rgb,
  41. gdouble *hue,
  42. gdouble *whiteness,
  43. gdouble *blackness);
  44. void gimp_hwb_to_rgb (gdouble hue,
  45. gdouble whiteness,
  46. gdouble blackness,
  47. GimpRGB *rgb);
  48. /* gint functions */
  49. void gimp_rgb_to_hsv_int (gint *red /* returns hue */,
  50. gint *green /* returns saturation */,
  51. gint *blue /* returns value */);
  52. void gimp_hsv_to_rgb_int (gint *hue /* returns red */,
  53. gint *saturation /* returns green */,
  54. gint *value /* returns blue */);
  55. void gimp_rgb_to_cmyk_int (gint *red /* returns cyan */,
  56. gint *green /* returns magenta */,
  57. gint *blue /* returns yellow */,
  58. gint *pullout /* returns black */);
  59. void gimp_cmyk_to_rgb_int (gint *cyan /* returns red */,
  60. gint *magenta /* returns green */,
  61. gint *yellow /* returns blue */,
  62. gint *black /* not changed */);
  63. void gimp_rgb_to_hsl_int (gint *red /* returns hue */,
  64. gint *green /* returns saturation */,
  65. gint *blue /* returns lightness */);
  66. gint gimp_rgb_to_l_int (gint red,
  67. gint green,
  68. gint blue);
  69. void gimp_hsl_to_rgb_int (gint *hue /* returns red */,
  70. gint *saturation /* returns green */,
  71. gint *lightness /* returns blue */);
  72. /* gdouble functions */
  73. void gimp_rgb_to_hsv4 (const guchar *rgb,
  74. gdouble *hue,
  75. gdouble *saturation,
  76. gdouble *value);
  77. void gimp_hsv_to_rgb4 (guchar *rgb,
  78. gdouble hue,
  79. gdouble saturation,
  80. gdouble value);
  81. G_END_DECLS
  82. #endif /* __GIMP_COLOR_SPACE_H__ */