[GEM-dev] pix_buffer_read

IOhannes m zmoelnig zmoelnig at iem.at
Sun Oct 2 19:57:33 CEST 2005


Georg Holzmann wrote:
> Hallo IOhannes, gem-devs!
> 
> 
> I'm not shure, but shouldn't be in pix_buffer_read ca. line 140 a
> 
> img->copy2Image(&m_pixBlock.image);
> 
> instead of
> 
> img->copy2ImageStruct(&m_pixBlock.image);  ??
> 
> 
> (but I'm not so familiar with those methods ...)
> 


copy2Image copies all the meta-information AND the pixel-data from the
given image into img.
copy2ImageStruct only copies the meta-information and a reference to the
data of the argument; thus it is very fast (not much copying done); the
drawback is, that if the data is changed in place by a downstream
object, it will be changed in the pix_buffer.
i guess you just discovered that and are annoyed by it...

however, just use [pix_buf] to explicitely make a copy of the image data.

thus the user can change whether they want speed or constant data.

(so i don't really feel like changing it)

mfg.asd.r
IOhannes




More information about the GEM-dev mailing list