542 |
|
register unsigned short *dp; |
543 |
|
register int x, err; |
544 |
|
int y; |
545 |
< |
rgbpixel *inline; |
545 |
> |
rgbpixel *inl; |
546 |
|
short *cerr; |
547 |
|
|
548 |
< |
if ((inline = (rgbpixel *)malloc(xmax*sizeof(rgbpixel))) == NULL |
548 |
> |
if ((inl = (rgbpixel *)malloc(xmax*sizeof(rgbpixel))) == NULL |
549 |
|
|| (cerr = (short *)calloc(xmax,sizeof(short))) == NULL) |
550 |
|
quit("out of memory in getmono"); |
551 |
|
dp = ourras->data.m - 1; |
552 |
|
for (y = 0; y < ymax; y++) { |
553 |
< |
picreadline3(y, inline); |
553 |
> |
picreadline3(y, inl); |
554 |
|
err = 0; |
555 |
|
for (x = 0; x < xmax; x++) { |
556 |
|
if (!(x&0xf)) |
557 |
|
*++dp = 0; |
558 |
< |
err += rgb_bright(&inline[x]) + cerr[x]; |
558 |
> |
err += rgb_bright(&inl[x]) + cerr[x]; |
559 |
|
if (err > 127) |
560 |
|
err -= 255; |
561 |
|
else |
563 |
|
cerr[x] = err >>= 1; |
564 |
|
} |
565 |
|
} |
566 |
< |
free((char *)inline); |
566 |
> |
free((char *)inl); |
567 |
|
free((char *)cerr); |
568 |
|
} |
569 |
|
|
656 |
|
if (getscan(y) < 0) |
657 |
|
quiterr("cannot seek for picreadline"); |
658 |
|
/* convert scanline */ |
659 |
< |
if (scale) |
660 |
< |
for (i = 0; i < xmax; i++) |
661 |
< |
if (scanline[i][EXP]) |
662 |
< |
scanline[i][EXP] += scale; |
663 |
< |
normcolrs(scanline, xmax); |
659 |
> |
normcolrs(scanline, xmax, scale); |
660 |
|
for (i = 0; i < xmax; i++) { |
661 |
|
l3[i].r = scanline[i][RED]; |
662 |
|
l3[i].g = scanline[i][GRN]; |
669 |
|
int y; |
670 |
|
pixel *l; |
671 |
|
{ |
672 |
< |
bcopy(l, ourras->data.bz+BZPixmapSize(xmax,y), BZPixmapSize(xmax,1)); |
672 |
> |
bcopy((char *)l, (char *)ourras->data.bz+BZPixmapSize(xmax,y), BZPixmapSize(xmax,1)); |
673 |
|
} |
674 |
|
|
675 |
|
|