Hello,

here's my problem with the Image object in OpenSG :
i'm trying to generate an image quickly in order to make my image evolve as
smoothly as possible. So the first time I do it, I set my image with an array
of UChar8 which contains the pixel values :
img->set( Image::OSG_RGB_PF, _iBar, _jBar, _kBar, 1, 1, 0, my_array);

The next time I do it, I'm calling :
img->setData(resultingImage);
, in order to regenerate the pixels without resetting the size, format, etc. (I
believe it's faster than the set(...) method, isn't it?)

The problem is that it crashes this time, whereas it was alright on the first
time. So I tried to call the set(...) method again but it still crashes. I
tried to clear the data before restting it, but the problem is still there.
So what's wrong? Any idea?

Also, I would like to make this as fast as possible, because the texture
generation process is a bit long. So is it possible (and faster) to directly
change the pixel of the image (with the setSubData(...) method called for each
pixel, for example), instead of creating a big UChar8 array, filling it, and
then setting it to the texture with setData (when I will manage to make it work
;), which implies a big copy and some useless memory consumption?

Thanks!

Jo


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to