Mercurial > hg > xemacs-beta
comparison src/glyphs-x.c @ 392:1f50e6fe4f3f r21-2-11
Import from CVS: tag r21-2-11
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:10:50 +0200 |
parents | aabb7f5b1c81 |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
391:e50d8e68d7a5 | 392:1f50e6fe4f3f |
---|---|
122 { | 122 { |
123 Display *dpy; | 123 Display *dpy; |
124 Colormap cmap; | 124 Colormap cmap; |
125 Visual *vis; | 125 Visual *vis; |
126 XImage *outimg; | 126 XImage *outimg; |
127 int depth, bitmap_pad, byte_cnt, i, j; | 127 int depth, bitmap_pad, bits_per_pixel, byte_cnt, i, j; |
128 int rd,gr,bl,q; | 128 int rd,gr,bl,q; |
129 unsigned char *data, *ip, *dp; | 129 unsigned char *data, *ip, *dp; |
130 quant_table *qtable = 0; | 130 quant_table *qtable = 0; |
131 union { | 131 union { |
132 FOUR_BYTE_TYPE val; | 132 FOUR_BYTE_TYPE val; |
147 } | 147 } |
148 | 148 |
149 bitmap_pad = ((depth > 16) ? 32 : | 149 bitmap_pad = ((depth > 16) ? 32 : |
150 (depth > 8) ? 16 : | 150 (depth > 8) ? 16 : |
151 8); | 151 8); |
152 byte_cnt = bitmap_pad >> 3; | |
153 | 152 |
154 outimg = XCreateImage (dpy, vis, | 153 outimg = XCreateImage (dpy, vis, |
155 depth, ZPixmap, 0, 0, width, height, | 154 depth, ZPixmap, 0, 0, width, height, |
156 bitmap_pad, 0); | 155 bitmap_pad, 0); |
157 if (!outimg) return NULL; | 156 if (!outimg) return NULL; |
157 | |
158 bits_per_pixel = outimg->bits_per_pixel; | |
159 byte_cnt = bits_per_pixel >> 3; | |
158 | 160 |
159 data = (unsigned char *) xmalloc (outimg->bytes_per_line * height); | 161 data = (unsigned char *) xmalloc (outimg->bytes_per_line * height); |
160 if (!data) | 162 if (!data) |
161 { | 163 { |
162 XDestroyImage (outimg); | 164 XDestroyImage (outimg); |