[cairo] rewriting libpixman

Behdad Esfahbod behdad at behdad.org
Thu Apr 5 11:38:12 PDT 2007

On Thu, 2007-04-05 at 09:33 -0400, Jeff Muizelaar wrote:
> On Wed, Apr 04, 2007 at 03:46:58PM -0400, James Cloos wrote:
> > >>>>> "Jeff" == Jeff Muizelaar <jeff at infidigm.net> writes:
> > 
> > Jeff> Why are the results saner then multiplying by 2ⁿ-1?
> > 
> > I had initially argued for 2ⁿ-1 but examples posted here convinced my
> > otherwise and led to my (couple of hours of) research....
> Do you care to point more specifically at which examples you mean?

If you multiply by 2^n-1 and floor, the only number mapping to 2^n-1 is
1.0.  That is certainly not uniform and tends to shift colors/data/etc
down.  If you multiply by 2^n and special-case 1.0 to map to 2^n-1, you
get a truly uniform distribution of real-space to discrete bins.

> -Jeff

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list