Closed GoogleCodeExporter closed 8 years ago
As a temporary workaround, I've made the following change locally to mimic the
behavior of the current code (see attached file). This allows for arbitrary
colour
quantization given the bitsize of each colour. It also has the nice (and not so
coincidental) side-effect that it solves Issue 50 as well since it preserves
alpha.
Original comment by jon...@gmail.com
on 11 Jun 2008 at 10:00
Attachments:
Sorry, I just realized that
r = r << ( 8 - rsize ) | r >> rsize;
should really read
r = r << ( 8 - rsize ) | r >> ( 2 * rsize - 8 );
Likewise for g and b. Sorry for any inconvenience.
Original comment by jon...@gmail.com
on 11 Jun 2008 at 10:30
I think that in PixelFormat.h there's a function that should do what you want:
r = PixelFormat::convert(r, 8, rsize);
r = PixelFormat::convert(r, rsize, 8);
and that will also work in the case that rsize < 4.
Original comment by cast...@gmail.com
on 11 Jun 2008 at 10:44
I'll modify and integrate your patch into the 2.0 branch. I think it should be
possible to replace the specialized quantizers with this one.
Original comment by cast...@gmail.com
on 11 Jun 2008 at 10:45
I've integrated the patch in the 2.0 branch. Thanks!
Original comment by cast...@gmail.com
on 12 Jun 2008 at 1:20
Original issue reported on code.google.com by
jon...@gmail.com
on 11 Jun 2008 at 9:05