On Thu, 8 Aug 2002, Tim Phipps wrote:

[SNIP]
> I can't help feeling that 257 is the wrong number for all this stuff and 
> 256 is the correct number. It might be better to just leave most of 
> these things as unsigned shorts or pass XColor's around and convert to 
> byte size pieces as late as possible.
> 
> /257 will take ages on any processor, /256 will take one cycle on most.

        257 is the correct scale factor for conversion between 8- and
16-bit colors: 257==0x101, so that e.g. 0xFF becomes 0xFFFF if multiplied
by 0x101, not 0x100.  Most of XFree86 code uses 0x101 as conversion factor
(see xc/{lib/X11/LRGB.c,programs/xcmsdb/xcmsdb.c}.  Of course, when
scaling from 16 down to 8 bits 256 will work almost as good as 257, but
unification-wise 257 is better.

        _________________________________________
          Dmitry Yu. Bolkhovityanov
          The Budker Institute of Nuclear Physics
          Novosibirsk, Russia

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to