[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

More c friendly interface to FXImage

Artur Merke

2/23/2007 10:18:00 AM

Hi all,

I'm looking for an efficient way of image manipulation/rerendering
using fximage from fxruby:

To initialize a FXImage with a persistent pixel buffer one has to:

image = FXImage.new(getApp(), buf, IMAGE_OWNED|IMAGE_KEEP, width,
height)

where buf is an array of FXColor of size=width*height

after initialization

image.data.data

is a pointer to this buffer.

As image processing is quite computational expensive I would
appriciate a more c language friendly interface ...

so for example

buf= MyPic.new

where MyPic is implemented in c using e.g.

typedef struct {
int w,h;

//let it be the 4 bytes/ rgba pixel as required by fxruby
unsiged char * pixels;
...
} MyPic;

This would solve the problem that after changing the MyPic buffer
pixels the rerendering of the picture requires converting it to an
array of FXColor first ...

[*
Other solution would be to access the values of a ruby array in c as
an
memory block without copying it (didn't look into the implementation
of the ruby array if it's implemented this way at all ...)
*]

Any suggestions? Is it already implemented somehow and I just don't
see
it?

Any help would be appreciated

Artur