PixelPeeker plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PixelPeeker plugin

timrowledge
One of the issues with doing Squeak/Scratch for the Pi is the rather dismal bitblt performance. I'm working on that with another colleague in the UK, but one interesting common case I've found in my tracing runs of Scratch is alot of use of pixelValueAt:, which builds a bitblt and runs it to move a single pixel and then look at it. That adds up to a lot of work for not much result so I've written a little plugin with (so far) a single prim to read a single pixel  with rather less fiddling.

So far it only deals with Squeak internal format bitmps (ie demented spawn of satan big-endian not-at-all-like-RISC-OS structure) but does cope with 1/2/4/8/16/32 bpp ok.  I could probably make it handle LSB (which is closer to convenient for almost all machines these days) and probably even external bitmaps if there is any real need.

Currently the code is all on its lonesome but I suppose it could be added to the bitblt plugin if that's a popular idea.
Included is a copy for anyone interested to try out and find bugs -



tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: IA: Illogical And





pixelpeeker.2.cs (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PixelPeeker plugin

Karl Ramberg
Cool

I have wished for something like this a long time

Karl



On Fri, Mar 15, 2013 at 7:27 PM, tim Rowledge <[hidden email]> wrote:
One of the issues with doing Squeak/Scratch for the Pi is the rather dismal bitblt performance. I'm working on that with another colleague in the UK, but one interesting common case I've found in my tracing runs of Scratch is alot of use of pixelValueAt:, which builds a bitblt and runs it to move a single pixel and then look at it. That adds up to a lot of work for not much result so I've written a little plugin with (so far) a single prim to read a single pixel  with rather less fiddling.

So far it only deals with Squeak internal format bitmps (ie demented spawn of satan big-endian not-at-all-like-RISC-OS structure) but does cope with 1/2/4/8/16/32 bpp ok.  I could probably make it handle LSB (which is closer to convenient for almost all machines these days) and probably even external bitmaps if there is any real need.

Currently the code is all on its lonesome but I suppose it could be added to the bitblt plugin if that's a popular idea.
Included is a copy for anyone interested to try out and find bugs -



tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: IA: Illogical And








Reply | Threaded
Open this post in threaded view
|

Re: PixelPeeker plugin

Bert Freudenberg
In reply to this post by timrowledge

On 2013-03-15, at 19:27, tim Rowledge <[hidden email]> wrote:

> One of the issues with doing Squeak/Scratch for the Pi is the rather dismal bitblt performance. I'm working on that with another colleague in the UK, but one interesting common case I've found in my tracing runs of Scratch is alot of use of pixelValueAt:, which builds a bitblt and runs it to move a single pixel and then look at it. That adds up to a lot of work for not much result so I've written a little plugin with (so far) a single prim to read a single pixel  with rather less fiddling.
>
> So far it only deals with Squeak internal format bitmps (ie demented spawn of satan big-endian not-at-all-like-RISC-OS structure) but does cope with 1/2/4/8/16/32 bpp ok.

BitBlt does do endian conversion for a while now, no? The platform code simply needs to answer negative depths for its supported displays.

>  I could probably make it handle LSB (which is closer to convenient for almost all machines these days) and probably even external bitmaps if there is any real need.

Yes, it should be as general as BitBlt itself.

> Currently the code is all on its lonesome but I suppose it could be added to the bitblt plugin if that's a popular idea.


Makes sense to add to the bitblt plugin, yes.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: PixelPeeker plugin

David T. Lewis
On Fri, Mar 15, 2013 at 10:16:32PM +0100, Bert Freudenberg wrote:

>
> On 2013-03-15, at 19:27, tim Rowledge <[hidden email]> wrote:
>
> > One of the issues with doing Squeak/Scratch for the Pi is the rather dismal bitblt performance. I'm working on that with another colleague in the UK, but one interesting common case I've found in my tracing runs of Scratch is alot of use of pixelValueAt:, which builds a bitblt and runs it to move a single pixel and then look at it. That adds up to a lot of work for not much result so I've written a little plugin with (so far) a single prim to read a single pixel  with rather less fiddling.
> >
> > So far it only deals with Squeak internal format bitmps (ie demented spawn of satan big-endian not-at-all-like-RISC-OS structure) but does cope with 1/2/4/8/16/32 bpp ok.
>
> BitBlt does do endian conversion for a while now, no? The platform code simply needs to answer negative depths for its supported displays.
>
> >  I could probably make it handle LSB (which is closer to convenient for almost all machines these days) and probably even external bitmaps if there is any real need.
>
> Yes, it should be as general as BitBlt itself.
>
> > Currently the code is all on its lonesome but I suppose it could be added to the bitblt plugin if that's a popular idea.
>
>
> Makes sense to add to the bitblt plugin, yes.
>
> - Bert -

+1

Dave