gscssub.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* Copyright (C) 1999 Aladdin Enterprises. All rights reserved.
  2. This software is provided AS-IS with no warranty, either express or
  3. implied.
  4. This software is distributed under license and may not be copied,
  5. modified or distributed except as expressly authorized under the terms
  6. of the license contained in the file LICENSE in this distribution.
  7. For more information about licensing, please refer to
  8. http://www.ghostscript.com/licensing/. For information on
  9. commercial licensing, go to http://www.artifex.com/licensing/ or
  10. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  12. */
  13. /* $Id: gscssub.h,v 1.5 2002/06/16 08:45:42 lpd Exp $ */
  14. /* Client interface to color space substitution */
  15. #ifndef gscssub_INCLUDED
  16. # define gscssub_INCLUDED
  17. #include "gscspace.h"
  18. /*
  19. * Color space substitution at the library level is similar to, but not
  20. * identical to, the operation of UseCIEColor in the PostScript language.
  21. * When the Boolean UseCIEColor parameter of the current device is false,
  22. * everything operates as normal. When UseCIEColor is true, the following
  23. * procedures may substitute another color space for the implied one:
  24. *
  25. * gs_setgray, gs_setrgbcolor, gs_sethsbcolor, gs_setcmykcolor
  26. * gs_current_Device{Gray,RGB,CMYK}_space
  27. *
  28. * Unlike the PostScript facility, the substitution *is* visible to
  29. * gs_currentcolorspace, and does *not* affect gs_setcolorspace, or the
  30. * ColorSpace members of images or shadings. However, the following
  31. * procedures recognize when substitution has occurred and return the
  32. * value(s) appropriate for the pre-substitution space:
  33. *
  34. * gs_currentgray, gs_currentrgbcolor, gs_currenthsbcolor,
  35. * gs_currentcmykcolor
  36. *
  37. * Thus gs_{current,set}{gray,{rgb,hsb,cmyk}color} are always mutually
  38. * consistent, concealing any substitution, and gs_{current,set}{colorspace}
  39. * are mutually consistent, reflecting any substitution.
  40. * gs_{current,set}color are consistent with the other color accessors,
  41. * since color space substitution doesn't affect color values.
  42. *
  43. * As in PostScript, color space substitutions are not affected by
  44. * (ordinary) grestore or by setgstate. Graphics states created by gsave or
  45. * gstate, or overwritten by currentgstate or copygstate, share
  46. * substitutions with the state from which they were copied.
  47. */
  48. /* If pcs is NULL, it means undo any substitution. */
  49. int gs_setsubstitutecolorspace(gs_state *pgs, gs_color_space_index csi,
  50. const gs_color_space *pcs);
  51. const gs_color_space *
  52. gs_currentsubstitutecolorspace(const gs_state *pgs,
  53. gs_color_space_index csi);
  54. /*
  55. * The following procedures are primarily for internal use, to provide
  56. * fast access to specific color spaces.
  57. */
  58. const gs_color_space *gs_current_DeviceGray_space(const gs_state *pgs);
  59. const gs_color_space *gs_current_DeviceRGB_space(const gs_state *pgs);
  60. const gs_color_space *gs_current_DeviceCMYK_space(const gs_state *pgs);
  61. #endif /* gscssub_INCLUDED */