xref: /plan9/sys/src/cmd/gs/src/gdevmpla.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 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: gdevmpla.h,v 1.5 2002/06/16 07:25:26 lpd Exp $ */
18 /* Interface to planar memory devices. */
19 
20 #ifndef gdevmpla_INCLUDED
21 #  define gdevmpla_INCLUDED
22 
23 /*
24  * Planar memory devices store the bits by planes instead of by chunks.
25  * The plane corresponding to the least significant bits of the color index
26  * is stored first.  Each plane may store a different number of bits,
27  * but the depth of each plane must be an allowable one for a memory
28  * device and not greater than 16 (currently, 1, 2, 4, 8, or 16), and the
29  * total must not exceed the size of gx_color_index.
30  *
31  * Planar devices store the data for each plane contiguously, as though
32  * each plane were a separate device.  There is an array of line pointers
33  * for each plane (num_planes arrays in all).
34  */
35 
36 /*
37  * Set up a planar memory device, after calling gs_make_mem_device but
38  * before opening the device.  The pre-existing device provides the color
39  * mapping procedures, but not the drawing procedures.  Requires: num_planes
40  * > 0, plane_depths[0 ..  num_planes - 1] > 0, sum of plane_depths <=
41  * mdev->color_info.depth.
42  */
43 int gdev_mem_set_planar(gx_device_memory * mdev, int num_planes,
44 			const gx_render_plane_t *planes /*[num_planes]*/);
45 
46 #endif /* gdevmpla_INCLUDED */
47