xref: /plan9/sys/src/cmd/gs/src/gsiparm4.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved.
2 
3   This software is provided AS-IS with no warranty, either express or
4   implied.
5 
6   This software is distributed under license and may not be copied,
7   modified or distributed except as expressly authorized under the terms
8   of the license contained in the file LICENSE in this distribution.
9 
10   For more information about licensing, please refer to
11   http://www.ghostscript.com/licensing/. For information on
12   commercial licensing, go to http://www.artifex.com/licensing/ or
13   contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14   San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15 */
16 
17 /* $Id: gsiparm4.h,v 1.5 2002/06/16 08:45:42 lpd Exp $ */
18 /* ImageType 4 image parameter definition */
19 
20 #ifndef gsiparm4_INCLUDED
21 #  define gsiparm4_INCLUDED
22 
23 #include "gsiparam.h"
24 
25 /*
26  * See Section 4.3 of the Adobe PostScript Version 3010 Supplement
27  * for a definition of ImageType 4 images.
28  */
29 
30 typedef struct gs_image4_s {
31     gs_pixel_image_common;
32     /*
33      * If MaskColor_is_range is false, the first N elements of
34      * MaskColor are sample values; if MaskColor_is_range is true,
35      * the first 2*N elements are ranges of sample values.
36      *
37      * Currently, the largest sample values supported by the library are 12
38      * bits, but eventually we want to support DevicePixel images with
39      * samples up to 32 bits as well.
40      */
41     bool MaskColor_is_range;
42     uint MaskColor[GS_IMAGE_MAX_COMPONENTS * 2];
43 } gs_image4_t;
44 
45 #define private_st_gs_image4()	/* in gximage4.c */\
46   extern_st(st_gs_pixel_image);\
47   gs_private_st_suffix_add0(st_gs_image4, gs_image4_t, "gs_image4_t",\
48     image4_enum_ptrs, image4_reloc_ptrs, st_gs_pixel_image)
49 
50 /*
51  * Initialize an ImageType 4 image.  Defaults:
52  *      MaskColor_is_range = false
53  */
54 void gs_image4_t_init(gs_image4_t * pim, const gs_color_space * color_space);
55 
56 #endif /* gsiparm4_INCLUDED */
57