gxcie.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* Copyright (C) 1999 Aladdin Enterprises. All rights reserved.
  2. This file is part of AFPL Ghostscript.
  3. AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  4. distributor accepts any responsibility for the consequences of using it, or
  5. for whether it serves any particular purpose or works at all, unless he or
  6. she says so in writing. Refer to the Aladdin Free Public License (the
  7. "License") for full details.
  8. Every copy of AFPL Ghostscript must include a copy of the License, normally
  9. in a plain ASCII text file named PUBLIC. The License grants you the right
  10. to copy, modify and redistribute AFPL Ghostscript, but only under certain
  11. conditions described in the License. Among other things, the License
  12. requires that the copyright notice and this notice be preserved on all
  13. copies.
  14. */
  15. /*$Id: gxcie.h,v 1.3 2001/03/17 01:15:42 raph Exp $ */
  16. /* Internal definitions for CIE color implementation */
  17. /* Requires gxcspace.h */
  18. #ifndef gxcie_INCLUDED
  19. # define gxcie_INCLUDED
  20. #include "gscie.h"
  21. /*
  22. * These color space implementation procedures are defined in gscie.c or
  23. * gsciemap.c, and referenced from the color space structures in gscscie.c.
  24. */
  25. /*
  26. * We use CIExxx rather than CIEBasedxxx in some places because
  27. * gcc under VMS only retains 23 characters of procedure names,
  28. * and DEC C truncates all identifiers at 31 characters.
  29. */
  30. /* Defined in gscie.c */
  31. cs_proc_init_color(gx_init_CIE);
  32. cs_proc_restrict_color(gx_restrict_CIEDEFG);
  33. cs_proc_install_cspace(gx_install_CIEDEFG);
  34. cs_proc_restrict_color(gx_restrict_CIEDEF);
  35. cs_proc_install_cspace(gx_install_CIEDEF);
  36. cs_proc_restrict_color(gx_restrict_CIEABC);
  37. cs_proc_install_cspace(gx_install_CIEABC);
  38. cs_proc_restrict_color(gx_restrict_CIEA);
  39. cs_proc_install_cspace(gx_install_CIEA);
  40. /* Defined in gsciemap.c */
  41. /*
  42. * Test whether a CIE rendering has been defined; ensure that the joint
  43. * caches are loaded. Note that the procedure may return if no rendering
  44. * has been defined, and returns if an error occurs.
  45. */
  46. #define CIE_CHECK_RENDERING(pcs, pconc, pis, do_exit) \
  47. BEGIN \
  48. if (pis->cie_render == 0) { \
  49. /* No rendering has been defined yet: return black. */ \
  50. pconc[0] = pconc[1] = pconc[2] = frac_0; \
  51. do_exit; \
  52. } \
  53. if (pis->cie_joint_caches->status != CIE_JC_STATUS_COMPLETED) { \
  54. int code = gs_cie_jc_complete(pis, pcs); \
  55. \
  56. if (code < 0) \
  57. return code; \
  58. } \
  59. END
  60. /*
  61. * Do the common remapping operation for CIE color spaces. Returns the numver
  62. * of components of the concrete color space (3 if RGB, 4 if CMYK).
  63. */
  64. extern int gx_cie_remap_finish( P4( cie_cached_vector3,
  65. frac *,
  66. const gs_imager_state *,
  67. const gs_color_space * ) );
  68. cs_proc_concretize_color(gx_concretize_CIEDEFG);
  69. cs_proc_concretize_color(gx_concretize_CIEDEF);
  70. cs_proc_concretize_color(gx_concretize_CIEABC);
  71. cs_proc_remap_color(gx_remap_CIEABC);
  72. cs_proc_concretize_color(gx_concretize_CIEA);
  73. /* Defined in gscscie.c */
  74. /* GC routines exported for gsicc.c */
  75. extern_st(st_cie_common);
  76. extern_st(st_cie_common_elements_t);
  77. /* set up the common default values for a CIE color space */
  78. extern void gx_set_common_cie_defaults( P2( gs_cie_common *,
  79. void * client_data ) );
  80. /* Load the common caches for a CIE color space */
  81. extern void gx_cie_load_common_cache(P2(gs_cie_common *, gs_state *));
  82. /* Complete loading of the common caches */
  83. extern void gx_cie_common_complete(P1(gs_cie_common *));
  84. /* "indirect" color space installation procedure */
  85. cs_proc_install_cspace(gx_install_CIE);
  86. /* allocate and initialize the common part of a cie color space */
  87. extern void * gx_build_cie_space( P4( gs_color_space ** ppcspace,
  88. const gs_color_space_type * pcstype,
  89. gs_memory_type_ptr_t stype,
  90. gs_memory_t * pmem ) );
  91. /*
  92. * Determine the concrete space which underlies a CIE based space. For all
  93. * device independent color spaces, this is dependent on the current color
  94. * rendering dictionary, rather than the current color space. This procedure
  95. * is exported for use by gsicc.c to implement ICCBased color spaces.
  96. */
  97. cs_proc_concrete_space(gx_concrete_space_CIE);
  98. #endif /* gxcie_INCLUDED */