[cairo] rewriting libpixman
behdad at behdad.org
Sun Jul 1 12:38:48 PDT 2007
[Replying to old mails]
On Thu, 2007-04-05 at 15:40 -0400, Jeff Muizelaar wrote:
> 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.
I'm convinced now that multiplying by 2^n-1 and rounding makes more
sense. The only reason I see for preferring the current approach is
that it can be made to run a lot faster. Dono if we should switch over.
"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