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

void DjVuInfo::encode ( ByteStream bs  ) 

Encodes the DjVu #"INFO"# chunk. This function writes the fields of this DjVuInfo object into ByteStream bs#. It is normally called after creating an #"INFO"# chunk header with function {IFFByteStream::put_chunk}.

Definition at line 148 of file DjVuInfo.cpp.

References dpi, gamma, height, orientation, version, width, ByteStream::write16(), and ByteStream::write8().

{
  bs.write16(width);
  bs.write16(height);
  bs.write8(version & 0xff);
  bs.write8(version >> 8);
  bs.write8(dpi & 0xff);
  bs.write8(dpi >> 8);
  bs.write8((int)(10.0*gamma+0.5) );
  unsigned char flags;
  switch (orientation) 
    {
    default: flags=0; break;
    case 1:  flags=6; break;
    case 2:  flags=2; break;
    case 3:  flags=5; break;
    }
  bs.write8(flags);
}


Generated by  Doxygen 1.6.0   Back to index