| 34 |
|
|
| 35 |
|
#define FONTNAME "8x13" /* text font we'll use */ |
| 36 |
|
|
| 37 |
< |
#define CTRL(c) ('c'-'@') |
| 37 |
> |
#define CTRL(c) ((c)-'@') |
| 38 |
|
|
| 39 |
|
#define BORWIDTH 5 /* border width */ |
| 40 |
|
|
| 192 |
|
headline(s) /* get relevant info from header */ |
| 193 |
|
char *s; |
| 194 |
|
{ |
| 195 |
– |
static char *altname[] = {"rview","rpict","pinterp",VIEWSTR,NULL}; |
| 196 |
– |
register char **an; |
| 195 |
|
char fmt[32]; |
| 196 |
|
|
| 197 |
|
if (isexpos(s)) |
| 199 |
|
else if (isformat(s)) { |
| 200 |
|
formatval(fmt, s); |
| 201 |
|
wrongformat = strcmp(fmt, COLRFMT); |
| 202 |
< |
} else |
| 203 |
< |
for (an = altname; *an != NULL; an++) |
| 206 |
< |
if (!strncmp(*an, s, strlen(*an))) { |
| 207 |
< |
if (sscanview(&ourview, s+strlen(*an)) > 0) |
| 208 |
< |
gotview++; |
| 209 |
< |
return; |
| 210 |
< |
} |
| 202 |
> |
} else if (isview(s) && sscanview(&ourview, s) > 0) |
| 203 |
> |
gotview++; |
| 204 |
|
} |
| 205 |
|
|
| 206 |
|
|
| 412 |
|
com = buf[0]; |
| 413 |
|
switch (com) { /* interpret command */ |
| 414 |
|
case 'q': |
| 415 |
< |
case CTRL(D): /* quit */ |
| 415 |
> |
case CTRL('D'): /* quit */ |
| 416 |
|
quit(0); |
| 417 |
|
case '\n': |
| 418 |
|
case '\r': |
| 486 |
|
free_raster(ourras); |
| 487 |
|
getras(); |
| 488 |
|
/* fall through */ |
| 489 |
< |
case CTRL(R): /* redraw */ |
| 490 |
< |
case CTRL(L): |
| 489 |
> |
case CTRL('R'): /* redraw */ |
| 490 |
> |
case CTRL('L'): |
| 491 |
|
unmap_rcolors(ourras); |
| 492 |
|
XClearWindow(thedisplay, wind); |
| 493 |
|
map_rcolors(ourras, wind); |
| 722 |
|
shiftcolrs(scanline, xmax, scale); |
| 723 |
|
colrs_gambs(scanline, xmax); |
| 724 |
|
add2icon(y, scanline); |
| 725 |
< |
for (x = 0; x < xmax; x++) { |
| 733 |
< |
*dp++ = scanline[x][RED]; |
| 734 |
< |
*dp++ = scanline[x][GRN]; |
| 725 |
> |
for (x = 0; x < xmax; x++) { /* BGR byte ordering */ |
| 726 |
|
*dp++ = scanline[x][BLU]; |
| 727 |
+ |
*dp++ = scanline[x][GRN]; |
| 728 |
+ |
*dp++ = scanline[x][RED]; |
| 729 |
|
} |
| 730 |
|
} |
| 731 |
|
} |