1 /* $Xorg: lbximage.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ 2 3 /****************************************************************************** 4 5 Copyright 1994, 1998 The Open Group 6 7 Permission to use, copy, modify, distribute, and sell this software and its 8 documentation for any purpose is hereby granted without fee, provided that 9 the above copyright notice appear in all copies and that both that 10 copyright notice and this permission notice appear in supporting 11 documentation. 12 13 The above copyright notice and this permission notice shall be included in 14 all copies or substantial portions of the Software. 15 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 23 Except as contained in this notice, the name of The Open Group shall not be 24 used in advertising or otherwise to promote the sale, use or other dealings 25 in 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 37 typedef 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 72 typedef 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 106 extern int LbxImageEncodePackBits ( 107 char * /* inbuf */, 108 char * /* outbuf */, 109 int /* outbufSize */, 110 int /* format */, 111 int /* depth */, 112 int /* num_scan_lines */, 113 int /* scan_line_size */, 114 int * /* bytesCompressed */ 115 ); 116 117 extern int LbxImageEncodeFaxG42D ( 118 unsigned char * /* inbuf */, 119 unsigned char * /* outbuf */, 120 int /* outbufSize */, 121 int /* image_bytes */, 122 int /* pixels_per_line */, 123 int /* padded_bytes_per_scanline */, 124 int /* reverse_bits */, 125 int * /* bytesCompressed */ 126 ); 127 128 extern int LbxImageDecodePackBits ( 129 char * /* inbuf */, 130 char * /* outbuf */, 131 int /* num_scan_lines */, 132 int /* scan_line_size */ 133 ); 134 135 extern int LbxImageDecodeFaxG42D ( 136 unsigned char * /* inbuf */, 137 unsigned char * /* outbuf */, 138 int /* image_bytes */, 139 int /* pixels_per_line */, 140 int /* padded_bytes_per_scanline */, 141 int /* 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_ */ 152