• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

MMRDecoder.h File Reference

#include "GSmartPointer.h"

Include dependency graph for MMRDecoder.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Classes

class  MMRDecoder
 Class for G4/MMR decoding. More...

Defines

MMRDecoder.h
Files #"MMRDecoder.h"# and #"MMRDecoder.cpp"# implement a CCITT-G4/MMR decoder suitable for use in DjVu.

The main entry point is function {MMRDecoder::decode}.

The foreground mask layer of a DjVu file is usually encoded with a #"Sjbz"# chunk containing JB2 encoded data (cf. {JB2Image.h}). Alternatively, the qmask layer may be encoded with a #"Smmr"# chunk containing a small header followed by MMR encoded data. This encoding scheme produces significantly larger files. On the other hand, many scanners a printers talk MMR using very efficient hardware components. This is the reason behind the introduction of #"Smmr"# chunks.

The Smmr# chunk starts by a header containing the following data: {verbatim} BYTE*3 : 'M' 'M' 'R' BYTE : 0xb000000<s> INT16 : <width> (MSB first) INT16 : <height> (MSB first) {verbatim}

The header is followed by the encoded data. Bit 0 of the fourth header byte (##) is similar to TIFF's ``min-is-black'' tag. This bit is set for a reverse video image. The encoded data can be in either ``regular'' MMR form or ``striped'' MMR form. This is indicated by bit 1 of the fourth header byte (#<s>#). This bit is set to indicate ``striped'' data. The ``regular'' data format consists of ordinary MMR encoded data. The ``striped'' data format consists of one sixteen bit integer (msb first) containing the number of rows per stripe, followed by data for each stripe as follows. {verbatim} INT16 : <rowsperstripe> (MSB first) INT32 : <nbytes1> BYTE*<nbytes1> : <mmrdata1> INT32 : <nbytes2> BYTE*<nbytes2> : <mmrdata2> ... {verbatim} Static function {MMRDecoder::decode_header} decodes the header. You can then create a {MMRDecoder} object with the flags inverted# and striped# as obtained when decoding the header. One can also decode raw MMR data by simply initialising a {MMRDecoder} object with flag striped# unset. Each call to {MMRDecoder::scanruns}, {MMRDecoder::scanrle} or {MMRDecoder::scanline} will then decode a row of the MMR encoded image.

Function {MMRDecoder::decode} is a convenience function for decoding the contents of a #"Smmr"# chunk. It returns a {JB2Image} divided into manageable blocks in order to provide the zooming and panning features implemented by class {JB2Image}.

CCITT-G4/MMR decoder.

Version:
$Id: MMRDecoder.h,v 1.9 2003/11/07 22:08:22 leonb Exp $#
Author:
Parag Deshmukh <parag@sanskrit.lz.att.com> \ Leon Bottou <leonb@research.att.com>


#define MMRDECODER_HAS_SCANRLE   1
#define MMRDECODER_HAS_SCANRUNS   1

Define Documentation

#define MMRDECODER_HAS_SCANRLE   1

Definition at line 143 of file MMRDecoder.h.

#define MMRDECODER_HAS_SCANRUNS   1

Definition at line 142 of file MMRDecoder.h.

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal