83 |
|
|
84 |
|
COLR *scanline; /* scan line buffer */ |
85 |
|
TMbright *lscan; /* encoded luminance scanline */ |
86 |
< |
BYTE *cscan; /* encoded chroma scanline */ |
87 |
< |
BYTE *pscan; /* compute pixel scanline */ |
86 |
> |
uby8 *cscan; /* encoded chroma scanline */ |
87 |
> |
uby8 *pscan; /* compute pixel scanline */ |
88 |
|
|
89 |
|
RESOLU inpres; /* input resolution and ordering */ |
90 |
|
int xmax, ymax; /* picture dimensions */ |
122 |
|
|
123 |
|
char errmsg[128]; |
124 |
|
|
125 |
< |
BYTE clrtab[256][3]; /* global color map */ |
125 |
> |
uby8 clrtab[256][3]; /* global color map */ |
126 |
|
|
127 |
|
|
128 |
|
Display *thedisplay; |
271 |
|
getevent(); /* main loop */ |
272 |
|
userr: |
273 |
|
fprintf(stderr, |
274 |
< |
"Usage: %s [-di disp][[-ge] spec][-b][-m][-d][-f][-c nclrs][-e spec][-g gamcor][-s][-ospec][-t intvl] pic ..\n", |
274 |
> |
"Usage: %s [-di disp][[-ge] spec][-b][-m][-d][-f][-c nclrs][-e spec][-g gamcor][-s][-ospec][-t intvl] hdr ..\n", |
275 |
|
progname); |
276 |
|
exit(1); |
277 |
|
} |
447 |
|
register int *rp; |
448 |
|
|
449 |
|
if (v1->class == v2->class) { |
450 |
< |
if (v1->class == TrueColor || v1->class == DirectColor) { |
451 |
< |
/* prefer 24-bit to 32-bit */ |
452 |
< |
if (v1->depth == 24 && v2->depth == 32) |
450 |
> |
if ((v1->class == TrueColor) | (v1->class == DirectColor)) { |
451 |
> |
/* prefer 24-bit */ |
452 |
> |
if ((v1->depth == 24) & (v2->depth > 24)) |
453 |
|
return(-1); |
454 |
< |
if (v1->depth == 32 && v2->depth == 24) |
454 |
> |
if ((v1->depth > 24) & (v2->depth == 24)) |
455 |
|
return(1); |
456 |
|
/* go for maximum depth otherwise */ |
457 |
|
return(v2->depth - v1->depth); |
458 |
|
} |
459 |
|
/* don't be too greedy */ |
460 |
< |
if (maxcolors <= 1<<v1->depth && maxcolors <= 1<<v2->depth) |
460 |
> |
if ((maxcolors <= 1<<v1->depth) & (maxcolors <= 1<<v2->depth)) |
461 |
|
return(v1->depth - v2->depth); |
462 |
|
return(v2->depth - v1->depth); |
463 |
|
} |
464 |
|
/* prefer Pseudo when < 15-bit */ |
465 |
< |
if ((v1->class == TrueColor || v1->class == DirectColor) && |
465 |
> |
if ((v1->class == TrueColor) | (v1->class == DirectColor) && |
466 |
|
v1->depth < 15) |
467 |
|
bad1 = 1; |
468 |
< |
if ((v2->class == TrueColor || v2->class == DirectColor) && |
468 |
> |
if ((v2->class == TrueColor) | (v2->class == DirectColor) && |
469 |
|
v2->depth < 15) |
470 |
|
bad2 = -1; |
471 |
|
if (bad1 | bad2) |
1060 |
|
goto memerr; |
1061 |
|
if (greyscale) { |
1062 |
|
cscan = TM_NOCHROM; |
1063 |
< |
if ((pscan = (BYTE *)malloc(sizeof(BYTE)*xmax)) == NULL) |
1063 |
> |
if ((pscan = (uby8 *)malloc(sizeof(uby8)*xmax)) == NULL) |
1064 |
|
goto memerr; |
1065 |
< |
} else if ((pscan=cscan = (BYTE *)malloc(3*sizeof(BYTE)*xmax)) |
1065 |
> |
} else if ((pscan=cscan = (uby8 *)malloc(3*sizeof(uby8)*xmax)) |
1066 |
|
== NULL) |
1067 |
|
goto memerr; |
1068 |
|
/* initialize tm library */ |
1100 |
|
int len |
1101 |
|
) |
1102 |
|
{ |
1103 |
< |
register BYTE *ps; |
1103 |
> |
register uby8 *ps; |
1104 |
|
|
1105 |
|
if (tmflags == TM_F_LINEAR) { |
1106 |
|
if (scale) |