Georg Holzmann wrote:
Hallo!
(i consider the pix_buffer-objects very much like the table-objects within pd: you don't tell [tabwrite] to load a file into a table, rather you send the request directly to the table (or use a specialized object))
okay, now I understand how you are thinking ;) should I implement it to pix_buffer or have you already done it?
it is already in the CVS
the problem with your solution is, that it crashes as soon, as you delete the associated [pix_buffer] object.
to fix this, you _have_ to do a pd_findbyclass() each and everytime you access the data behind it.
no, you dont have to :)
no you have to
because the pixBlock is stored in the class - so I only must use pd_findbyclass() when the index changes of course ... (and I didn't do that) (file attached)
while you are copying the struct-data into your local pixBlock, the actual pixel-data is stored in the [pix_buffer] (using copy2imageStruct() instead of copy2Image()) and it is freed when pix_buffer is deleted.
just open the example patch in examples/2.advanced load the buffer, change the index and delete the [pix_buffer] object.
i always tried with "auto 1"
mfg.asd.r IOhannes