1 /* $XConsortium: lbximage.h /main/6 1996/11/04 16:48:27 rws $ */
3 /******************************************************************************
5 Copyright (c) 1994 X Consortium
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
28 ******************************************************************************/
33 typedef struct _LbxBitmapCompMethod {
37 int methodOpCode; /* to be filled on reply from server */
40 #if NeedFunctionPrototypes
46 #if NeedFunctionPrototypes
47 unsigned char * /* inbuf */,
48 unsigned char * /* outbuf */,
50 int /* image_bytes */,
51 int /* pixels_per_line */,
52 int /* padded_bytes_per_scanline */,
53 int /* reverse_bits */,
54 int * /* bytesCompressed */
59 #if NeedFunctionPrototypes
60 unsigned char * /* inbuf */,
61 unsigned char * /* outbuf */,
62 int /* image_bytes */,
63 int /* pixels_per_line */,
64 int /* padded_bytes_per_scanline */,
65 int /* reverse_bits */
69 } LbxBitmapCompMethod;
72 #define LBX_MAX_DEPTHS 5
74 typedef struct _LbxPixmapCompMethod {
79 int depths[LBX_MAX_DEPTHS];
81 int methodOpCode; /* to be filled on reply from server */
84 #if NeedFunctionPrototypes
90 #if NeedFunctionPrototypes
96 int /* num_scan_lines */,
97 int /* scan_line_size */,
98 int * /* bytesCompressed */
103 #if NeedFunctionPrototypes
106 int /* num_scan_lines */,
107 int /* scan_line_size */
111 } LbxPixmapCompMethod;
115 extern int LbxImageEncodePackBits (
116 #if NeedFunctionPrototypes
119 int /* outbufSize */,
122 int /* num_scan_lines */,
123 int /* scan_line_size */,
124 int * /* bytesCompressed */
128 extern int LbxImageEncodeFaxG42D (
129 #if NeedFunctionPrototypes
130 unsigned char * /* inbuf */,
131 unsigned char * /* outbuf */,
132 int /* outbufSize */,
133 int /* image_bytes */,
134 int /* pixels_per_line */,
135 int /* padded_bytes_per_scanline */,
136 int /* reverse_bits */,
137 int * /* bytesCompressed */
141 extern int LbxImageDecodePackBits (
142 #if NeedFunctionPrototypes
145 int /* num_scan_lines */,
146 int /* scan_line_size */
150 extern int LbxImageDecodeFaxG42D (
151 #if NeedFunctionPrototypes
152 unsigned char * /* inbuf */,
153 unsigned char * /* outbuf */,
154 int /* image_bytes */,
155 int /* pixels_per_line */,
156 int /* padded_bytes_per_scanline */,
157 int /* reverse_bits */
162 #define LBX_IMAGE_COMPRESS_SUCCESS 0
163 #define LBX_IMAGE_COMPRESS_NO_SUPPORT 1
164 #define LBX_IMAGE_COMPRESS_BAD_MALLOC 2
165 #define LBX_IMAGE_COMPRESS_NOT_WORTH_IT 3
167 #endif /* _LBX_IMAGE_H_ */