]> git.sesse.net Git - rdpsrv/blob - Xserver/include/extensions/lbximage.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / include / extensions / lbximage.h
1 /* $XConsortium: lbximage.h /main/6 1996/11/04 16:48:27 rws $ */
2
3 /******************************************************************************
4
5 Copyright (c) 1994  X Consortium
6
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:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
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.
23
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.
27
28 ******************************************************************************/
29
30 #ifndef _LBX_IMAGE_H_
31 #define _LBX_IMAGE_H_
32
33 typedef struct _LbxBitmapCompMethod {
34
35     char *methodName;
36     int inited;
37     int methodOpCode;   /* to be filled on reply from server */
38
39     int (*compInit)(
40 #if NeedFunctionPrototypes
41         void
42 #endif
43     );
44
45     int (*compFunc)(
46 #if NeedFunctionPrototypes
47         unsigned char *         /* inbuf */,
48         unsigned char *         /* outbuf */,
49         int                     /* outbufSize */,
50         int                     /* image_bytes */,
51         int                     /* pixels_per_line */,
52         int                     /* padded_bytes_per_scanline */,
53         int                     /* reverse_bits */,
54         int *                   /* bytesCompressed */
55 #endif
56     );
57
58     int (*decompFunc)(
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 */
66 #endif
67     );
68
69 } LbxBitmapCompMethod;
70
71
72 #define LBX_MAX_DEPTHS 5
73
74 typedef struct _LbxPixmapCompMethod {
75
76     char *methodName;
77     unsigned formatMask;
78     int depthCount;
79     int depths[LBX_MAX_DEPTHS];
80     int inited;
81     int methodOpCode;   /* to be filled on reply from server */
82
83     int (*compInit)(
84 #if NeedFunctionPrototypes
85         void
86 #endif
87     );
88
89     int (*compFunc)(
90 #if NeedFunctionPrototypes
91         char *                  /* inbuf */,
92         char *                  /* outbuf */,
93         int                     /* outbufSize */,
94         int                     /* format */,
95         int                     /* depth */,
96         int                     /* num_scan_lines */,
97         int                     /* scan_line_size */,
98         int *                   /* bytesCompressed */
99 #endif
100     );
101
102     int (*decompFunc)(
103 #if NeedFunctionPrototypes
104         char *                  /* inbuf */,
105         char *                  /* outbuf */,
106         int                     /* num_scan_lines */,
107         int                     /* scan_line_size */
108 #endif
109     );
110
111 } LbxPixmapCompMethod;
112
113
114
115 extern int LbxImageEncodePackBits (
116 #if NeedFunctionPrototypes
117 char *                  /* inbuf */,
118 char *                  /* outbuf */,
119 int                     /* outbufSize */,
120 int                     /* format */,
121 int                     /* depth */,
122 int                     /* num_scan_lines */,
123 int                     /* scan_line_size */,
124 int *                   /* bytesCompressed */
125 #endif
126 );
127
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 */
138 #endif
139 );
140
141 extern int LbxImageDecodePackBits (
142 #if NeedFunctionPrototypes
143 char *                  /* inbuf */,
144 char *                  /* outbuf */,
145 int                     /* num_scan_lines */,
146 int                     /* scan_line_size */
147 #endif
148 );
149
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 */
158 #endif
159 );
160
161
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
166
167 #endif /* _LBX_IMAGE_H_ */