blob: 10627cf29e2ec967c3e3786b4077ec6ee017cb0c [file] [log] [blame]
David 'Digit' Turner1b0544d2014-03-27 13:51:24 +01001/* $Xorg: lbximage.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
2
3/******************************************************************************
4
5Copyright 1994, 1998 The Open Group
6
7Permission to use, copy, modify, distribute, and sell this software and its
8documentation for any purpose is hereby granted without fee, provided that
9the above copyright notice appear in all copies and that both that
10copyright notice and this permission notice appear in supporting
11documentation.
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23Except as contained in this notice, the name of The Open Group shall not be
24used in advertising or otherwise to promote the sale, use or other dealings
25in this Software without prior written authorization from The Open Group.
26
27******************************************************************************/
28/* $XFree86: xc/include/extensions/lbximage.h,v 1.4 2001/12/20 19:28:54 tsi Exp $ */
29
30#ifndef _LBX_IMAGE_H_
31#define _LBX_IMAGE_H_
32
33#include <X11/Xfuncproto.h>
34
35_XFUNCPROTOBEGIN
36
37typedef struct _LbxBitmapCompMethod {
38
39 char *methodName;
40 int inited;
41 int methodOpCode; /* to be filled on reply from server */
42
43 int (*compInit)(
44 void
45 );
46
47 int (*compFunc)(
48 unsigned char * /* inbuf */,
49 unsigned char * /* outbuf */,
50 int /* outbufSize */,
51 int /* image_bytes */,
52 int /* pixels_per_line */,
53 int /* padded_bytes_per_scanline */,
54 int /* reverse_bits */,
55 int * /* bytesCompressed */
56 );
57
58 int (*decompFunc)(
59 unsigned char * /* inbuf */,
60 unsigned char * /* outbuf */,
61 int /* image_bytes */,
62 int /* pixels_per_line */,
63 int /* padded_bytes_per_scanline */,
64 int /* reverse_bits */
65 );
66
67} LbxBitmapCompMethod;
68
69
70#define LBX_MAX_DEPTHS 5
71
72typedef struct _LbxPixmapCompMethod {
73
74 char *methodName;
75 unsigned formatMask;
76 int depthCount;
77 int depths[LBX_MAX_DEPTHS];
78 int inited;
79 int methodOpCode; /* to be filled on reply from server */
80
81 int (*compInit)(
82 void
83 );
84
85 int (*compFunc)(
86 char * /* inbuf */,
87 char * /* outbuf */,
88 int /* outbufSize */,
89 int /* format */,
90 int /* depth */,
91 int /* num_scan_lines */,
92 int /* scan_line_size */,
93 int * /* bytesCompressed */
94 );
95
96 int (*decompFunc)(
97 char * /* inbuf */,
98 char * /* outbuf */,
99 int /* num_scan_lines */,
100 int /* scan_line_size */
101 );
102
103} LbxPixmapCompMethod;
104
105
106extern int LbxImageEncodePackBits (
107char * /* inbuf */,
108char * /* outbuf */,
109int /* outbufSize */,
110int /* format */,
111int /* depth */,
112int /* num_scan_lines */,
113int /* scan_line_size */,
114int * /* bytesCompressed */
115);
116
117extern int LbxImageEncodeFaxG42D (
118unsigned char * /* inbuf */,
119unsigned char * /* outbuf */,
120int /* outbufSize */,
121int /* image_bytes */,
122int /* pixels_per_line */,
123int /* padded_bytes_per_scanline */,
124int /* reverse_bits */,
125int * /* bytesCompressed */
126);
127
128extern int LbxImageDecodePackBits (
129char * /* inbuf */,
130char * /* outbuf */,
131int /* num_scan_lines */,
132int /* scan_line_size */
133);
134
135extern int LbxImageDecodeFaxG42D (
136unsigned char * /* inbuf */,
137unsigned char * /* outbuf */,
138int /* image_bytes */,
139int /* pixels_per_line */,
140int /* padded_bytes_per_scanline */,
141int /* reverse_bits */
142);
143
144_XFUNCPROTOEND
145
146#define LBX_IMAGE_COMPRESS_SUCCESS 0
147#define LBX_IMAGE_COMPRESS_NO_SUPPORT 1
148#define LBX_IMAGE_COMPRESS_BAD_MALLOC 2
149#define LBX_IMAGE_COMPRESS_NOT_WORTH_IT 3
150
151#endif /* _LBX_IMAGE_H_ */