18 |
|
#include "tmprivat.h" |
19 |
|
#include "tmaptiff.h" |
20 |
|
|
21 |
– |
#ifndef BSD |
22 |
– |
#define bzero(d,n) (void)memset(d,0,n) |
23 |
– |
#endif |
21 |
|
#define uvflgop(p,uv,op) ((p)->rgbflg[(uv)>>5] op (1L<<((uv)&0x1f))) |
22 |
|
#define isuvset(p,uv) uvflgop(p,uv,&) |
23 |
|
#define setuv(p,uv) uvflgop(p,uv,|=) |
24 |
|
#define clruv(p,uv) uvflgop(p,uv,&=~) |
25 |
< |
#define clruvall(p) bzero((MEM_PTR)(p)->rgbflg,sizeof((p)->rgbflg)) |
25 |
> |
#define clruvall(p) memset((MEM_PTR)(p)->rgbflg,'\0',sizeof((p)->rgbflg)) |
26 |
|
|
27 |
|
#ifdef NOPROTO |
28 |
|
static MEM_PTR luv32Init(); |
136 |
|
/* check arguments */ |
137 |
|
if (tmTop == NULL) |
138 |
|
returnErr(TM_E_TMINVAL); |
139 |
< |
if (ls == NULL | luvs == NULL | len < 0) |
139 |
> |
if ((ls == NULL) | (luvs == NULL) | (len < 0)) |
140 |
|
returnErr(TM_E_ILLEGAL); |
141 |
|
/* check package registration */ |
142 |
|
if (luv32Reg < 0) { |
196 |
|
/* check arguments */ |
197 |
|
if (tmTop == NULL) |
198 |
|
returnErr(TM_E_TMINVAL); |
199 |
< |
if (ls == NULL | luvs == NULL | len < 0) |
199 |
> |
if ((ls == NULL) | (luvs == NULL) | (len < 0)) |
200 |
|
returnErr(TM_E_ILLEGAL); |
201 |
|
/* check package registration */ |
202 |
|
if (luv24Reg < 0) { |
215 |
|
continue; |
216 |
|
/* get chrominance */ |
217 |
|
if (tmTop->flags & TM_F_MESOPIC && ls[i] < BMESUPPER) { |
218 |
< |
if (uv_decode(uvp, uvp+1, luvs[i]&0x3fff) < 0) { |
218 |
> |
if (uv_decode(&uvp[0], &uvp[1], luvs[i]&0x3fff) < 0) { |
219 |
|
uvp[0] = U_NEU; /* should barf? */ |
220 |
|
uvp[1] = V_NEU; |
221 |
|
} |
225 |
|
SGILOGENCODE_NODITHER)) < 0) |
226 |
|
j = uv14neu; |
227 |
|
} else { |
228 |
< |
j = tmTop->flags&TM_F_BW ? uv14neu : luvs[i]&0x3fff; |
228 |
> |
j = tmTop->flags&TM_F_BW ? uv14neu : |
229 |
> |
(int)(luvs[i]&0x3fff); |
230 |
|
} |
231 |
|
if (!isuvset(ld, j)) { |
232 |
|
if (uv_decode(&uvp[0], &uvp[1], j) < 0) { |
256 |
|
/* check arguments */ |
257 |
|
if (tmTop == NULL) |
258 |
|
returnErr(TM_E_TMINVAL); |
259 |
< |
if (ls == NULL | l16s == NULL | len < 0) |
259 |
> |
if ((ls == NULL) | (l16s == NULL) | (len < 0)) |
260 |
|
returnErr(TM_E_ILLEGAL); |
261 |
|
/* check scaling offset */ |
262 |
|
if (!FEQ(tmTop->inpsf, lastsf)) { |