The idea is that the 8-bit input range 0..255 should map to the 16-bit
output range 0..65535 ... Try the original code, compared to your
suggestion;)
(To be honest, multiplying by 257 did sound weird to me, too, but then
I realized that 257 == 65535/255 . I would perhaps write out the
65535/255 explicitly and let the compiler fold it to 257.)
--tml
Context
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.