[plt-scheme] Byte Swapping Bitmap Performance

From: Noel Welsh (noelwelsh at gmail.com)
Date: Wed Aug 5 04:59:22 EDT 2009

I've been playing around with squirting out bits of assembler when I
need speed. It is amusing, but not yet really practical.

So, after that completely useless statement, something helpful.
Matthew has been rebuilding MrEd on top of Cairo. The code is here:


You might this implementation useful, and you might like to contribute
further to it. I did a bit of work on the dc implementation -- you
could take up where I left off.


On Mon, Aug 3, 2009 at 7:28 PM, Sam Phillips<samdphillips at gmail.com> wrote:
> Hi,
> I've pieced together a simple foreign interface to cairo2 that draws to
> a canvas.  Cairo's image surfaces have a function
> cairo_image_surface_get_data that exposes the raw bytes of the surface,
> in the format that the surface is set up for.  Setting up the surface to
> use the ARGB32 format I would expect it to be trivial to do a
> set-argb-pixels on a bitmap-dc and be done with it.
> Except that the bytes from cairo_image_surface_get_data come back as
> BGRA, and I have to do a byte swapping operation before setting the
> pixels in the bitmap-dc.  Which adds about a second to each screen draw.
> Is there a faster way to do this that I'm missing?
> Cheers,
> Sam
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.