Logo Search packages:      
Sourcecode: djvulibre version File versions

GPixel * GPixmap::take_data ( size_t &  offset  ) 

Steals the memory buffer of a GPixmap. This function returns the address of the memory buffer allocated by this GPixmap object. The offset of the first pixel in the bottom line is written into variable offset#. Other lines can be accessed using pointer arithmetic (see {rowsize}). The GPixmap object no longer ``owns'' the buffer: you must explicitly de-allocate the buffer using operator delete []#. This de-allocation should take place after the destruction or the re-initialization of the GPixmap object. This function will return a null pointer if the GPixmap object does not ``own'' the buffer in the first place.

Definition at line 423 of file GPixmap.cpp.

  GPixel *ret = pixels_data;
  pixels_data = 0;
  offset = 0;
  return ret;

Generated by  Doxygen 1.6.0   Back to index