614 |
|
make_rpixmap(ourras, wind); |
615 |
|
redraw(0, 0, width, height); |
616 |
|
return(0); |
617 |
+ |
case '0': /* recenter origin */ |
618 |
+ |
if (xoff == 0 & yoff == 0) |
619 |
+ |
return(0); |
620 |
+ |
xoff = yoff = 0; |
621 |
+ |
XClearWindow(thedisplay, wind); |
622 |
+ |
redraw(0, 0, width, height); |
623 |
+ |
return(0); |
624 |
|
case ' ': /* clear */ |
625 |
|
redraw(box.xmin, box.ymin, box.xsiz, box.ysiz); |
626 |
|
return(0); |
732 |
|
return(-1); |
733 |
|
if (left == ll && right == lr && top == lt && bottom == lb) { |
734 |
|
copycolor(clr, lc); |
735 |
< |
return; |
735 |
> |
return(0); |
736 |
|
} |
737 |
|
for (y = top; y < bottom; y++) { |
738 |
|
if (getscan(y) == -1) |
761 |
|
quiterr("out of memory in getmono"); |
762 |
|
dp = ourdata - 1; |
763 |
|
for (y = 0; y < ymax; y++) { |
764 |
< |
if (getscan(y) < 0) |
758 |
< |
quiterr("seek error in getmono"); |
759 |
< |
normcolrs(scanline, xmax, scale); |
764 |
> |
getscan(y); |
765 |
|
add2icon(y, scanline); |
766 |
+ |
normcolrs(scanline, xmax, scale); |
767 |
|
err = 0; |
768 |
|
for (x = 0; x < xmax; x++) { |
769 |
|
if (!(x&7)) |
789 |
|
static short cerr[ICONSIZ]; |
790 |
|
static int ynext; |
791 |
|
static char *dp; |
792 |
+ |
COLR clr; |
793 |
|
register int err; |
794 |
|
register int x, ti; |
795 |
|
int errp; |
820 |
|
*++dp = 0; |
821 |
|
errp = err; |
822 |
|
ti = x*xmax/iconwidth; |
823 |
< |
err += normbright(scan[ti]) + cerr[x]; |
823 |
> |
copycolr(clr, scan[ti]); |
824 |
> |
normcolrs(clr, 1, scale); |
825 |
> |
err += normbright(clr) + cerr[x]; |
826 |
|
if (err > 127) |
827 |
|
err -= 255; |
828 |
|
else |
844 |
|
/* read and convert file */ |
845 |
|
dp = (unsigned long *)ourdata; |
846 |
|
for (y = 0; y < ymax; y++) { |
847 |
< |
if (getscan(y) < 0) |
848 |
< |
quiterr("seek error in getfull"); |
847 |
> |
getscan(y); |
848 |
> |
add2icon(y, scanline); |
849 |
|
if (scale) |
850 |
|
shiftcolrs(scanline, xmax, scale); |
851 |
|
colrs_gambs(scanline, xmax); |
843 |
– |
add2icon(y, scanline); |
852 |
|
if (ourras->image->blue_mask & 1) |
853 |
|
for (x = 0; x < xmax; x++) |
854 |
|
*dp++ = scanline[x][RED] << 16 | |
873 |
|
/* read and convert file */ |
874 |
|
dp = ourdata; |
875 |
|
for (y = 0; y < ymax; y++) { |
876 |
< |
if (getscan(y) < 0) |
877 |
< |
quiterr("seek error in getgrey"); |
876 |
> |
getscan(y); |
877 |
> |
add2icon(y, scanline); |
878 |
|
if (scale) |
879 |
|
shiftcolrs(scanline, xmax, scale); |
880 |
+ |
for (x = 0; x < xmax; x++) |
881 |
+ |
scanline[x][GRN] = normbright(scanline[x]); |
882 |
|
colrs_gambs(scanline, xmax); |
873 |
– |
add2icon(y, scanline); |
883 |
|
if (maxcolors < 256) |
884 |
|
for (x = 0; x < xmax; x++) |
885 |
< |
*dp++ = ((long)normbright(scanline[x]) * |
886 |
< |
maxcolors + 128) >> 8; |
885 |
> |
*dp++ = ((long)scanline[x][GRN] * |
886 |
> |
maxcolors + maxcolors/2) >> 8; |
887 |
|
else |
888 |
|
for (x = 0; x < xmax; x++) |
889 |
< |
*dp++ = normbright(scanline[x]); |
889 |
> |
*dp++ = scanline[x][GRN]; |
890 |
|
} |
891 |
|
for (x = 0; x < maxcolors; x++) |
892 |
|
clrtab[x][RED] = clrtab[x][GRN] = |
893 |
< |
clrtab[x][BLU] = ((long)x*256+maxcolors/2)/maxcolors; |
893 |
> |
clrtab[x][BLU] = ((long)x*256 + 128)/maxcolors; |
894 |
|
} |
895 |
|
|
896 |
|
|
904 |
|
for (y = 0; y < ymax; y++) { |
905 |
|
if (getscan(y) < 0) |
906 |
|
quiterr("seek error in getmapped"); |
907 |
+ |
add2icon(y, scanline); |
908 |
|
if (scale) |
909 |
|
shiftcolrs(scanline, xmax, scale); |
910 |
|
colrs_gambs(scanline, xmax); |
901 |
– |
add2icon(y, scanline); |
911 |
|
cnt_colrs(scanline, xmax); |
912 |
|
} |
913 |
|
/* map pixels */ |