[cairo] rewriting libpixman

Jeff Muizelaar jeff at infidigm.net
Thu Apr 5 12:40:22 PDT 2007

On Thu, Apr 05, 2007 at 02:38:12PM -0400, Behdad Esfahbod wrote:
> 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.

But I'm not comparing to multiplying by 2^n-1 and flooring I'm comparing
to multiplying by 2^n-1 and rounding to the nearest. Rounding gives a
close to uniform distribution and less error than multiplying by 2^n and

What isn't clear to me, is why one would prefer a truly uniform
distribution over having less error.


More information about the cairo mailing list