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