367 |
|
} |
368 |
|
|
369 |
|
|
370 |
< |
normcolrs(scan, len) /* normalize a scanline of colrs */ |
370 |
> |
normcolrs(scan, len, adjust) /* normalize a scanline of colrs */ |
371 |
|
register COLR *scan; |
372 |
|
int len; |
373 |
+ |
int adjust; |
374 |
|
{ |
375 |
|
register int c; |
376 |
|
register int shift; |
377 |
|
|
378 |
|
while (len-- > 0) { |
379 |
< |
shift = scan[0][EXP] - COLXS; |
379 |
> |
shift = scan[0][EXP] + adjust - COLXS; |
380 |
|
if (shift > 0) { |
381 |
|
if (shift > 8) { |
382 |
|
scan[0][RED] = |
403 |
|
scan[0][BLU] = ((scan[0][BLU]>>shift)+1)>>1; |
404 |
|
} |
405 |
|
} |
406 |
< |
scan[0][EXP] = COLXS; |
406 |
> |
scan[0][EXP] = COLXS - adjust; |
407 |
|
scan++; |
408 |
|
} |
409 |
|
} |