xref: /plan9/sys/src/cmd/gs/src/gzacpath.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1995, 1996 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: gzacpath.h,v 1.6 2003/08/21 14:55:14 igor Exp $ */
18 /* State and interface definitions for clipping path accumulator */
19 /* Requires gxdevice.h, gzcpath.h */
20 
21 #ifndef gzacpath_INCLUDED
22 #  define gzacpath_INCLUDED
23 
24 /*
25  * Device for accumulating a rectangle list.  This device can clip
26  * the list being accumulated with a clipping rectangle on the fly:
27  * we use this to clip clipping paths to band boundaries when
28  * rendering a band list.
29  */
30 typedef struct gx_device_cpath_accum_s {
31     gx_device_common;
32     gs_memory_t *list_memory;
33     gs_int_rect clip_box;
34     gs_int_rect bbox;
35     gx_clip_list list;
36 } gx_device_cpath_accum;
37 
38 /* Start accumulating a clipping path. */
39 void gx_cpath_accum_begin(gx_device_cpath_accum * padev, gs_memory_t * mem);
40 
41 /* Set the accumulator's clipping box. */
42 void gx_cpath_accum_set_cbox(gx_device_cpath_accum * padev,
43 			     const gs_fixed_rect * pbox);
44 
45 /* Finish accumulating a clipping path. */
46 /* Note that this releases the old contents of the clipping path. */
47 int gx_cpath_accum_end(const gx_device_cpath_accum * padev,
48 		       gx_clip_path * pcpath);
49 
50 /* Discard an accumulator in case of error. */
51 void gx_cpath_accum_discard(gx_device_cpath_accum * padev);
52 
53 /* Intersect two clipping paths using an accumulator. */
54 int gx_cpath_intersect_path_slow(gx_clip_path *, gx_path *, int,
55 					gs_imager_state *);
56 
57 #endif /* gzacpath_INCLUDED */
58