| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2004.01.14 17:36 "Re: COLORMAP and byte padding", by Joris Van DammeAndy Cave wrote: > I really wouldn't do that. > 0 to 256 -> 0, > 257 to 513 -> 2, Philip Crews wrote: > Using integer division, the only 16-bit pixel value that will > result in white (255) is 0xffff, and 0x0100 will incorrectly be black You misunderstood. I should have thought about / with integer operands being an integer divide in C (right?). In ObjectPascal, it's a floating divide. I actually meant to denote the floating division, and rounding afterwards. That should make more sense. Also, I tend to look at it from the theoretical point of view. If 0 maps to 0, and 65535 maps to 255, then the mapping formulae quite simply is /65535*255. Plus rounding, of course. Joris |
|||||||