1 /* Copyright (C) 1995, 1998, 1999 artofcode LLC. All rights reserved. 2 3 This program is free software; you can redistribute it and/or modify it 4 under the terms of the GNU General Public License as published by the 5 Free Software Foundation; either version 2 of the License, or (at your 6 option) any later version. 7 8 This program is distributed in the hope that it will be useful, but 9 WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along 14 with this program; if not, write to the Free Software Foundation, Inc., 15 59 Temple Place, Suite 330, Boston, MA, 02111-1307. 16 17 */ 18 19 /*$Id: icie.h,v 1.3.2.1.2.1 2003/01/17 00:49:04 giles Exp $ */ 20 /* Internal definitions for interpreter CIE color handling */ 21 22 #ifndef icie_INCLUDED 23 # define icie_INCLUDED 24 25 /* 26 * All of the routines below are exported by zcie.c for zcrd.c, 27 * except for cie_cache_joint which is exported by zcrd.c for zcie.c. 28 */ 29 30 /* ------ Parameter acquisition ------ */ 31 32 /* Get a range array parameter from a dictionary. */ 33 /* We know that count <= 4. */ 34 int dict_ranges_param(P4(const ref * pdref, const char *kstr, int count, 35 gs_range * prange)); 36 37 /* Get 3 ranges from a dictionary. */ 38 int dict_range3_param(P3(const ref *pdref, const char *kstr, 39 gs_range3 *prange3)); 40 41 /* Get a 3x3 matrix parameter from a dictionary. */ 42 int dict_matrix3_param(P3(const ref *pdref, const char *kstr, 43 gs_matrix3 *pmat3)); 44 45 /* Get an array of procedures from a dictionary. */ 46 /* We know count <= countof(empty_procs). */ 47 int dict_proc_array_param(P4(const ref * pdict, const char *kstr, 48 uint count, ref * pparray)); 49 50 /* Get 3 procedures from a dictionary. */ 51 int dict_proc3_param(P3(const ref *pdref, const char *kstr, ref proc3[3])); 52 53 /* Get WhitePoint and BlackPoint values. */ 54 int cie_points_param(P2(const ref * pdref, gs_cie_wb * pwb)); 55 56 /* Process a 3- or 4-dimensional lookup table from a dictionary. */ 57 /* The caller has set pclt->n and pclt->m. */ 58 /* ptref is known to be a readable array of size at least n+1. */ 59 int cie_table_param(P3(const ref * ptable, gx_color_lookup_table * pclt, 60 gs_memory_t * mem)); 61 62 /* ------ Internal routines ------ */ 63 64 int cie_set_finish(P5(i_ctx_t *, gs_color_space *, 65 const ref_cie_procs *, int, int)); 66 67 int cie_cache_push_finish(P4(i_ctx_t *i_ctx_p, op_proc_t finish_proc, 68 gs_ref_memory_t * imem, void *data)); 69 int cie_prepare_cache(P7(i_ctx_t *i_ctx_p, const gs_range * domain, 70 const ref * proc, cie_cache_floats * pcache, 71 void *container, gs_ref_memory_t * imem, 72 client_name_t cname)); 73 int cie_prepare_caches_4(P10(i_ctx_t *i_ctx_p, const gs_range * domains, 74 const ref * procs, 75 cie_cache_floats * pc0, 76 cie_cache_floats * pc1, 77 cie_cache_floats * pc2, 78 cie_cache_floats * pc3 /* may be 0 */, 79 void *container, 80 gs_ref_memory_t * imem, client_name_t cname)); 81 #define cie_prepare_cache3(p,d3,p3,c3,pcie,imem,cname)\ 82 cie_prepare_caches_4(p, (d3)->ranges, p3,\ 83 &(c3)->floats, &(c3)[1].floats, &(c3)[2].floats,\ 84 NULL, pcie, imem, cname) 85 #define cie_prepare_cache4(p,d4,p4,c4,pcie,imem,cname)\ 86 cie_prepare_caches_4(p, (d4)->ranges, p4,\ 87 &(c4)->floats, &(c4)[1].floats, &(c4)[2].floats,\ 88 &(c4)[3].floats, pcie, imem, cname) 89 90 int cie_cache_joint(P4(i_ctx_t *, const ref_cie_render_procs *, 91 const gs_cie_common *, gs_state *)); 92 93 #endif /* icie_INCLUDED */ 94