comparison src/glyphs-x.c @ 298:70ad99077275 r21-0b47

Import from CVS: tag r21-0b47
author cvs
date Mon, 13 Aug 2007 10:39:40 +0200
parents c9fe270a4101
children c6de09ad3017
comparison
equal deleted inserted replaced
297:deca3c1083ac 298:70ad99077275
196 { 196 {
197 rd = *ip++; 197 rd = *ip++;
198 gr = *ip++; 198 gr = *ip++;
199 bl = *ip++; 199 bl = *ip++;
200 conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)]; 200 conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)];
201 #ifdef WORDS_BIGENDIAN 201 if (outimg->byte_order == MSBFirst)
202 for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q]; 202 for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
203 #else 203 else
204 for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q]; 204 for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
205 #endif
206 } 205 }
207 } 206 }
208 xfree(qtable); 207 xfree(qtable);
209 } else { 208 } else {
210 unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk; 209 unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk;
265 bl = *ip++ << (bbits - 8); 264 bl = *ip++ << (bbits - 8);
266 else 265 else
267 bl = *ip++ >> (8 - bbits); 266 bl = *ip++ >> (8 - bbits);
268 267
269 conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift); 268 conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift);
270 #ifdef WORDS_BIGENDIAN 269 if (outimg->byte_order == MSBFirst)
271 for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q]; 270 for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
272 #else 271 else
273 for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q]; 272 for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
274 #endif
275 } 273 }
276 } 274 }
277 } 275 }
278 return outimg; 276 return outimg;
279 } 277 }