23 |
|
|
24 |
|
#include "color.h" |
25 |
|
|
26 |
+ |
#include "resolu.h" |
27 |
+ |
|
28 |
|
#include "xraster.h" |
29 |
|
|
30 |
|
#include "view.h" |
90 |
|
|
91 |
|
extern char *malloc(), *calloc(); |
92 |
|
|
93 |
< |
extern double atof(), pow(), log(); |
93 |
> |
extern double pow(), log(); |
94 |
|
|
95 |
|
|
96 |
|
main(argc, argv) |
550 |
|
{ |
551 |
|
register unsigned short *dp; |
552 |
|
register int x, err; |
553 |
< |
int y; |
553 |
> |
int y, errp; |
554 |
|
rgbpixel *inl; |
555 |
|
short *cerr; |
556 |
|
|
564 |
|
for (x = 0; x < xmax; x++) { |
565 |
|
if (!(x&0xf)) |
566 |
|
*++dp = 0; |
567 |
+ |
errp = err; |
568 |
|
err += rgb_bright(&inl[x]) + cerr[x]; |
569 |
|
if (err > 127) |
570 |
|
err -= 255; |
571 |
|
else |
572 |
|
*dp |= 1<<(x&0xf); |
573 |
< |
cerr[x] = err >>= 1; |
573 |
> |
err /= 3; |
574 |
> |
cerr[x] = err + errp; |
575 |
|
} |
576 |
|
} |
577 |
|
free((char *)inl); |