125 |
|
|
126 |
|
int sigrecv; |
127 |
|
|
128 |
< |
int onsig() { sigrecv++; } |
128 |
> |
void onsig(int i) { sigrecv++; } |
129 |
|
|
130 |
|
|
131 |
|
main(argc, argv) |
537 |
|
goto fail; |
538 |
|
getmono(); |
539 |
|
} else if (ourvis.class == TrueColor | ourvis.class == DirectColor) { |
540 |
< |
int datsiz = ourvis.depth>16 ? sizeof(int4) : sizeof(int2); |
540 |
> |
int datsiz = ourvis.depth>16 ? sizeof(int32) : sizeof(int16); |
541 |
|
ourdata = (unsigned char *)malloc(datsiz*xmax*ymax); |
542 |
|
if (ourdata == NULL) |
543 |
|
goto fail; |
625 |
|
traceray(xpos, ypos) /* print requested pixel data */ |
626 |
|
int xpos, ypos; |
627 |
|
{ |
628 |
< |
FLOAT hv[2]; |
628 |
> |
RREAL hv[2]; |
629 |
|
FVECT rorg, rdir; |
630 |
|
COLOR cval; |
631 |
|
register char *cp; |
673 |
|
XColor cvx; |
674 |
|
int com, n; |
675 |
|
double comp; |
676 |
< |
FLOAT hv[2]; |
676 |
> |
RREAL hv[2]; |
677 |
|
|
678 |
|
n = XLookupString(ekey, buf, sizeof(buf), NULL, NULL); |
679 |
|
if (n == 0) |
1152 |
|
getfull() /* get full (24-bit) data */ |
1153 |
|
{ |
1154 |
|
int y; |
1155 |
< |
register unsigned int4 *dp; |
1156 |
< |
register unsigned int2 *dph; |
1155 |
> |
register uint32 *dp; |
1156 |
> |
register uint16 *dph; |
1157 |
|
register int x; |
1158 |
|
/* initialize tone mapping */ |
1159 |
|
make_tonemap(); |
1160 |
|
/* read and convert file */ |
1161 |
< |
dp = (unsigned int4 *)ourdata; |
1162 |
< |
dph = (unsigned int2 *)ourdata; |
1161 |
> |
dp = (uint32 *)ourdata; |
1162 |
> |
dph = (uint16 *)ourdata; |
1163 |
|
for (y = 0; y < ymax; y++) { |
1164 |
|
getscan(y); |
1165 |
|
add2icon(y, scanline); |
1167 |
|
switch (ourras->image->blue_mask) { |
1168 |
|
case 0xff: /* 24-bit RGB */ |
1169 |
|
for (x = 0; x < xmax; x++) |
1170 |
< |
*dp++ = (unsigned int4)scanline[x][RED] << 16 | |
1171 |
< |
(unsigned int4)scanline[x][GRN] << 8 | |
1172 |
< |
(unsigned int4)scanline[x][BLU] ; |
1170 |
> |
*dp++ = (uint32)scanline[x][RED] << 16 | |
1171 |
> |
(uint32)scanline[x][GRN] << 8 | |
1172 |
> |
(uint32)scanline[x][BLU] ; |
1173 |
|
break; |
1174 |
|
case 0xff0000: /* 24-bit BGR */ |
1175 |
|
for (x = 0; x < xmax; x++) |
1176 |
< |
*dp++ = (unsigned int4)scanline[x][RED] | |
1177 |
< |
(unsigned int4)scanline[x][GRN] << 8 | |
1178 |
< |
(unsigned int4)scanline[x][BLU] << 16 ; |
1176 |
> |
*dp++ = (uint32)scanline[x][RED] | |
1177 |
> |
(uint32)scanline[x][GRN] << 8 | |
1178 |
> |
(uint32)scanline[x][BLU] << 16 ; |
1179 |
|
break; |
1180 |
|
#if 0 |
1181 |
|
case 0x1f: /* 15-bit RGB */ |
1231 |
|
tmap_colrs(scanline, xmax); |
1232 |
|
if (maxcolors < 256) |
1233 |
|
for (x = 0; x < xmax; x++) |
1234 |
< |
*dp++ = ((int4)scanline[x][GRN] * |
1234 |
> |
*dp++ = ((int32)scanline[x][GRN] * |
1235 |
|
maxcolors + maxcolors/2) >> 8; |
1236 |
|
else |
1237 |
|
for (x = 0; x < xmax; x++) |
1239 |
|
} |
1240 |
|
for (x = 0; x < maxcolors; x++) |
1241 |
|
clrtab[x][RED] = clrtab[x][GRN] = |
1242 |
< |
clrtab[x][BLU] = ((int4)x*256 + 128)/maxcolors; |
1242 |
> |
clrtab[x][BLU] = ((int32)x*256 + 128)/maxcolors; |
1243 |
|
} |
1244 |
|
|
1245 |
|
|
1252 |
|
/* initialize tone mapping */ |
1253 |
|
make_tonemap(); |
1254 |
|
/* make histogram */ |
1255 |
< |
if (new_histo((int4)xmax*ymax) == -1) |
1255 |
> |
if (new_histo((int32)xmax*ymax) == -1) |
1256 |
|
quiterr("cannot initialize histogram"); |
1257 |
|
for (y = 0; y < ymax; y++) { |
1258 |
|
if (getscan(y) < 0) |