xref: /plan9/sys/src/cmd/gs/src/gsflip.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1996, 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: gsflip.h,v 1.5 2002/06/16 08:45:42 lpd Exp $ */
18 /* Interface to routines for "flipping" image data */
19 
20 #ifndef gsflip_INCLUDED
21 #  define gsflip_INCLUDED
22 
23 /*
24  * Convert planar (MultipleDataSource) input to chunky format.  The input
25  * data starts at planes[0] + offset ... planes[num_planes-1] + offset; the
26  * output is stored at buffer.  This procedure assumes that the input
27  * consists of an integral number of pixels; in particular, for 12-bit
28  * input, nbytes is rounded up to a multiple of 3.  num_planes must be >=0;
29  * bits_per_sample must be 1, 2, 4, 8, or 12.  Returns -1 if num_planes or
30  * bits_per_sample is invalid, otherwise 0.
31  */
32 extern int image_flip_planes(byte * buffer, const byte ** planes,
33 			     int offset, int nbytes,
34 			     int num_planes, int bits_per_sample);
35 
36 #endif /* gsflip_INCLUDED */
37