131 |
|
int len |
132 |
|
) |
133 |
|
{ |
134 |
< |
static char funcName[] = "tmCvLuv32"; |
134 |
> |
static const char funcName[] = "tmCvLuv32"; |
135 |
|
double uvp[2]; |
136 |
|
register LUV32DATA *ld; |
137 |
|
register int i, j; |
255 |
|
int len |
256 |
|
) |
257 |
|
{ |
258 |
< |
static char funcName[] = "tmCvL16"; |
258 |
> |
static const char funcName[] = "tmCvL16"; |
259 |
|
static double lastsf; |
260 |
|
static int offset; |
261 |
|
register int i; |
266 |
|
returnErr(TM_E_ILLEGAL); |
267 |
|
/* check scaling offset */ |
268 |
|
if (!FEQ(tms->inpsf, lastsf)) { |
269 |
< |
offset = BRT2SCALE(64); |
270 |
< |
if (tms->inpsf > 1.0001) |
271 |
< |
offset -= (int)(TM_BRTSCALE*log(tms->inpsf)+.5); |
272 |
< |
else if (tms->inpsf < 0.9999) |
273 |
< |
offset -= (int)(TM_BRTSCALE*log(tms->inpsf)-.5); |
269 |
> |
offset = BRT2SCALE(64) - tmCvLuminance(tms->inpsf); |
270 |
|
lastsf = tms->inpsf; |
271 |
|
} |
272 |
|
/* convert each pixel */ |
291 |
|
exit(1); |
292 |
|
} |
293 |
|
ld = (LUV32DATA *)tms->pd[luv32Reg]; |
294 |
< |
ld->offset = BRT2SCALE(64); |
299 |
< |
if (tms->inpsf > 1.0001) |
300 |
< |
ld->offset -= (int)(TM_BRTSCALE*log(tms->inpsf)+.5); |
301 |
< |
else if (tms->inpsf < 0.9999) |
302 |
< |
ld->offset -= (int)(TM_BRTSCALE*log(tms->inpsf)-.5); |
294 |
> |
ld->offset = BRT2SCALE(64) - tmCvLuminance(tms->inpsf); |
295 |
|
clruvall(ld); |
296 |
|
} |
297 |
|
|
322 |
|
exit(1); |
323 |
|
} |
324 |
|
ld = (LUV24DATA *)tms->pd[luv24Reg]; |
325 |
< |
ld->offset = BRT2SCALE(12); |
334 |
< |
if (tms->inpsf > 1.0001) |
335 |
< |
ld->offset -= (int)(TM_BRTSCALE*log(tms->inpsf)+.5); |
336 |
< |
else if (tms->inpsf < 0.9999) |
337 |
< |
ld->offset -= (int)(TM_BRTSCALE*log(tms->inpsf)-.5); |
325 |
> |
ld->offset = BRT2SCALE(12) - tmCvLuminance(tms->inpsf); |
326 |
|
clruvall(ld); |
327 |
|
} |
328 |
|
|