Ive schrieb:
> There are indeed some (but very rare) PNM files that seem to assume
> "maxvalue" is the maximal value that *appears* within the image out of
> the full range of 0-65535 but this is a bug within the used PNM-writer
> and shouldn't become our problem.
Good.
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.
Post a reply to this message
|