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

void GBitmap::compress (  ) 

Reduces the memory required for a bilevel image by using a run-length encoded representation. Functions that need to access the pixel array will decompress the image on demand.

Definition at line 399 of file GBitmap.cpp.

References monitor().

Referenced by get_rle(), rotate(), and save_pbm().

{
  if (grays > 2)
    G_THROW( ERR_MSG("GBitmap.cant_compress") );
  GMonitorLock lock(monitor());
  if (bytes)
    {
      grle.resize(0);
      grlerows.resize(0);
      rlelength = encode(rle,grle);
      if (rlelength)
        {
          gbytes_data.resize(0);
          bytes = 0;
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index