Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

unsigned char * GBitmap::take_data ( size_t &  offset  ) 

Steals the memory buffer of a GBitmap. This function returns the address of the memory buffer allocated by this GBitmap 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 GBitmap 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 GBitmap object. This function will return a null pointer if the GBitmap object does not ``own'' the buffer in the first place.

Definition at line 372 of file GBitmap.cpp.

References monitor().

  GMonitorLock lock(monitor());
  unsigned char *ret = bytes_data;
  if (ret) offset = (size_t)border;
  return ret;

Generated by  Doxygen 1.6.0   Back to index