comparison src/glyphs-x.c @ 304:c6de09ad3017 r21-0b50

Import from CVS: tag r21-0b50
author cvs
date Mon, 13 Aug 2007 10:41:12 +0200
parents 70ad99077275
children 33bdb3d4b97f
comparison
equal deleted inserted replaced
303:d02ffe1d75ed 304:c6de09ad3017
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 #if WORDS_BIGENDIAN
201 if (outimg->byte_order == MSBFirst) 202 if (outimg->byte_order == MSBFirst)
202 for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q]; 203 for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
203 else 204 else
205 for (q = 3; q >= 4-byte_cnt; q--) *dp++ = conv.cp[q];
206 #else
207 if (outimg->byte_order == MSBFirst)
208 for (q = byte_cnt-1; q >= 0; q--) *dp++ = conv.cp[q];
209 else
204 for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q]; 210 for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
211 #endif
205 } 212 }
206 } 213 }
207 xfree(qtable); 214 xfree(qtable);
208 } else { 215 } else {
209 unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk; 216 unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk;
264 bl = *ip++ << (bbits - 8); 271 bl = *ip++ << (bbits - 8);
265 else 272 else
266 bl = *ip++ >> (8 - bbits); 273 bl = *ip++ >> (8 - bbits);
267 274
268 conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift); 275 conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift);
276 #if WORDS_BIGENDIAN
269 if (outimg->byte_order == MSBFirst) 277 if (outimg->byte_order == MSBFirst)
270 for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q]; 278 for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
271 else 279 else
280 for (q = 3; q >= 4-byte_cnt; q--) *dp++ = conv.cp[q];
281 #else
282 if (outimg->byte_order == MSBFirst)
283 for (q = byte_cnt-1; q >= 0; q--) *dp++ = conv.cp[q];
284 else
272 for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q]; 285 for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
286 #endif
273 } 287 }
274 } 288 }
275 } 289 }
276 return outimg; 290 return outimg;
277 } 291 }