1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
4
This software is provided AS-IS with no warranty, either express or
7
This software is distributed under license and may not be copied, modified
8
or distributed except as expressly authorized under the terms of that
9
license. Refer to licensing information at http://www.artifex.com/
10
or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
11
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
14
/* $Id: gdevplnx.h 8022 2007-06-05 22:23:38Z giles $*/
15
/* Definitions and API for plane extraction device */
16
/* Requires gxdevcli.h */
18
#ifndef gdevplnx_INCLUDED
19
# define gdevplnx_INCLUDED
24
* A plane-extraction device appears to its client to be a color-capable
25
* device, like its target; but it actually extracts a single color plane
26
* for rendering to yet another device, called the plane device (normally,
27
* but not necessarily, a memory device). Clients must know the pixel
28
* representation in detail, since the plane is specified as a particular
29
* group of bits within the pixel.
31
* The original purpose of plane-extraction devices is for band list
32
* rendering for plane-oriented color printers. Each per-plane rasterizing
33
* pass over the band list sends the output to a plane-extraction device for
34
* the plane being printed. There is one special optimization to support
35
* this: on the theory that even bands containing output for multiple bands
36
* are likely to have many objects that only write white into that band, we
37
* remember whether any (non-white) marks have been made on the page so far,
38
* and if not, we simply skip any rendering operations that write white.
40
* The depth of the plane_extract device and its target are limited to 32
41
* bits; the depth of each plane is limited to 8 bits. We could raise these
42
* without too much trouble if necessary, as long as each plane didn't
46
typedef struct gx_device_plane_extract_s {
47
gx_device_forward_common;
48
/* The following are set by the client before opening the device. */
49
gx_device *plane_dev; /* the drawing device for the plane */
50
gx_render_plane_t plane;
51
/* The following are set by open_device. */
52
gx_color_index plane_white;
54
bool plane_dev_is_memory;
55
/* The following change dynamically. */
57
} gx_device_plane_extract;
58
extern_st(st_device_plane_extract);
59
#define public_st_device_plane_extract() /* in gdevplnx.c */\
60
gs_public_st_complex_only(st_device_plane_extract, gx_device_plane_extract,\
61
"gx_device_plane_extract", 0, device_plane_extract_enum_ptrs,\
62
device_plane_extract_reloc_ptrs, gx_device_finalize)
64
/* Initialize a plane extraction device. */
65
int plane_device_init(gx_device_plane_extract *edev, gx_device *target,
67
const gx_render_plane_t *render_plane, bool clear);
69
#endif /* gdevplnx_INCLUDED */