[GEM-dev] pix buffer improvements
Georg Holzmann
grhPD at gmx.at
Wed Aug 24 10:09:02 CEST 2005
Hallo gem devs!
I need some fast changing images and so I added a open-message to
pix_buffer_write, so that I can load an image into the buffer.
I read the image like this:
imageStruct *image = NULL;
canvas_makefilename(getCanvas(), filename->s_name, buf, MAXPDSTRING);
image = image2mem(buf);
so my question is: do I need all the cache-stuff like in pix_image, or is a
simple image2mem sufficient (like above) ?
Now for the next: pix_buffer_read
I just noticed, that pix_buffer_read needs much more cpu than pix_image,
because stuff like this:
Obj_header*ohead=(Obj_header*)pd_findbyclass(m_bindname,
pix_buffer_class);
[...]
pix_buffer *buffer=(pix_buffer *)(ohead)->data;
[..]
img=buffer->getMess((int)m_frame);
if (img && img->data)
img->copy2ImageStruct(&state->image->image);
is called every frame!
So I'm thinking about, how to handle it in a more efficient way - maybe the
best solution would be to check for a buffer and image only when the index
changes ?
Thanks,
LG
Georg
--
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
More information about the GEM-dev
mailing list