|
![](/i/fill.gif) |
clipka wrote:
> Another thing: In the various file readers, I frequently encounter the
> following construct:
>
> floatColor = ((intColor * 255) / intMax) / 255.0;
>
> where intMax is derived from the bit depth of the color component.
> Does this make any sense to you? Wouldn't it be more faithful to the
> encoded data to decode it as
>
> floatColor = float(intColor) / float(intMax) ?
>
> My initial assumption was that it's just lazy coding, with the /255.0
> having been added when refactoring the code to use float values, but the
> frequent appearance makes me uneasy.
Assuming floatColor was once a byteColor it really looks like a relict
of the once used MulDiv approach. I cannot see a reason for keeping that.
Ahem, and in case you came across tiff.cpp, could you please change the line
if (PhotometricInterpretation == PHOTOMETRIC_PALETTE)
to
if ((PhotometricInterpretation == PHOTOMETRIC_PALETTE) &&
(TIFFIsTiled(tif) == 0))
This will prevent POV-Ray from having a few pointers running wild when
someone tries to use a color palette TIF-file that happens to be tiled
and is not arranged in strips.
-Ive
Post a reply to this message
|
![](/i/fill.gif) |