MMRDecoder Class Reference

#include <MMRDecoder.h>

Inheritance diagram for MMRDecoder:

GPEnabled List of all members.

Detailed Description

Class for G4/MMR decoding.

The simplest way to use this class is the static member function MMRDecoder::decode}. This function internally creates an instance of MMRDecoder# which processes the MMR data scanline by scanline.

Definition at line 151 of file MMRDecoder.h.


Public Member Functions

 ~MMRDecoder ()
const unsigned short * scanruns (const unsigned short **endptr=0)
const unsigned char * scanrle (const bool invert, const unsigned char **endptr=0)

Static Public Member Functions

static GP< JB2Imagedecode (GP< ByteStream > gbs)
static bool decode_header (ByteStream &inp, int &width, int &height, int &invert)
static GP< MMRDecodercreate (GP< ByteStream > gbs, const int width, const int height, const bool striped=false)

Protected Member Functions

 MMRDecoder (const int width, const int height)
void init (GP< ByteStream > gbs, const bool striped=false)

Friends

class VLSource
class VLTable

Constructor & Destructor Documentation

MMRDecoder::~MMRDecoder (  ) 

Non-virtual destructor.

Definition at line 536 of file MMRDecoder.cpp.


Member Function Documentation

GP< MMRDecoder > MMRDecoder::create ( GP< ByteStream gbs,
const int  width,
const int  height,
const bool  striped = false 
) [static]

Create a MMRDecoder object for decoding an image of size width# by height#.

Flag $striped# must be set if the image is composed of multiple stripes.

Definition at line 561 of file MMRDecoder.cpp.

GP< JB2Image > MMRDecoder::decode ( GP< ByteStream gbs  )  [static]

Main decoding routine that (a) decodes the header using decode_header#, (b) decodes the MMR data using an instance of MMRDecoder#, and returns a new JB2Image} composed of tiles whose maximal width and height is derived from the size of the image.

Definition at line 874 of file MMRDecoder.cpp.

bool MMRDecoder::decode_header ( ByteStream inp,
int &  width,
int &  height,
int &  invert 
) [static]

Only decode the header.

Definition at line 855 of file MMRDecoder.cpp.

const unsigned char * MMRDecoder::scanrle ( const bool  invert,
const unsigned char **  endptr = 0 
)

Decodes a scanline and returns a pointer to RLE encoded data.

The buffer contains the length of the runs for the current line encoded as described in PNM and RLE file formats}.) The flag invert# can be used to indicate that the MMR data is encoded in reverse video. The RLE data is followed by two zero bytes. The position of these two zeroes is stored in the pointer specified by the optional argument endptr#. The buffer data should be processed before calling this function again. This is implemented by calling MMRDecoder::scanruns}.

Definition at line 793 of file MMRDecoder.cpp.

const unsigned short * MMRDecoder::scanruns ( const unsigned short **  endptr = 0  ) 

Decodes a scanline and returns a pointer to an array of run lengths.

The returned buffer contains the length of alternative white and black runs. These run lengths sum to the image width. They are followed by two zeroes. The position of these two zeroes is stored in the pointer specified by the optional argument endptr#. The buffer data should be processed before calling this function again.

Definition at line 571 of file MMRDecoder.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys