Symbian
 Developer Library

DEVELOPER LIBRARY

[Index] [Glossary] [Previous] [Next]



Location: cfaxio.h
Link against: FaxIO.lib

Class CFaxT4

CFaxT4

Support

Supported from 5.0

Description

Fax line coding/decoding

Provides utility functions for encoding and decoding fax scan lines. The lines can be encoded/decoded as 1 dimensional modified Huffman or 2 dimensional modified Read.

Users must first create a CFaxT4 object using NewL() or NewLC(). Specific functions are provided to encode/decode scan lines using the two coding schemes. In addition, general functions are provided which determine the coding type from the values specified when the object is initialised — using PageInitialise().

In pre-v5.1 releases of Symbian OS, this class was defined in faxstore.h and its import library was faxst2.lib.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CFaxT4Fax line coding/decoding

Defined in CFaxT4:
DecodeScanLine(), DecodeScanLine1D(), DecodeScanLine2D(), EncodeScanLine(), EncodeScanLine1D(), EncodeScanLine2D(), NewL(), NewLC(), PageInitialize()

Inherited from CBase:
operator new()


Construction and destruction


NewL()

static CFaxT4* NewL();

Description

Constructs a CFaxT4 object, which provides utility functions to encode and decode fax scan lines.

The function is exactly the same as NewLC() except that the new object is popped from the cleanup stack.

The new object is constructed with the default compression and resolution: EModifiedHuffman and EFaxNormal respectively.

Return value

CFaxT4*

A pointer to the newly created object.

Leave codes

KErrNoMemory

There is insufficient memory to perform the operation.


NewLC()

static CFaxT4* NewLC();

Description

Constructs a CFaxT4 object, which provides utility functions to encode and decode fax scan lines.

As is usual in Symbian OS, the only difference between this function and NewL() is that this variant pushes the object to the cleanup stack.

The new object is constructed with the default compression and resolution: EModifiedHuffman and EFaxNormal respectively.

Return value

CFaxT4*

A pointer to the newly created object.

Leave codes

KErrNoMemory

There is insufficient memory to perform the operation.

[Top]


Object initialisation


PageInitialize()

void PageInitialize(TFaxResolution aResolution, TFaxCompression aCompression, TInt aFlag2 = 0);

Description

Initialises the CFaxT4 object with a specific resolution and compression.

Parameters

TFaxResolution aResolution

The resolution level.

TFaxCompression aCompression

The compression type.

TInt aFlag2 = 0

Reserved for future use.

[Top]


Encoding and decoding


EncodeScanLine()

void EncodeScanLine(const TDesC8& aScanLine,TDes8& anEncodedScanLine);

Description

Encodes a scan line using either one dimensional Modified Huffman (MH) or two dimensional Modified Read (MR) encoding.

The type of encoding used depends on the compression type specified when the object was initialised — using PageInitialize(). If the object was not initialised, then the default compression is MH.

Parameters

const TDesC8& aScanLine

The raw scan line to be encoded.

TDes8& anEncodedScanLine

On return, contains the encoded scan line.


DecodeScanLine()

TInt DecodeScanLine(TDes8& aScanLine,const TDesC8& anEncodedScanLine);

Description

Decodes a scan line.

The decoding method depends on the compression type specified when the object was initialised — using PageInitialize(). If the object was not initialised, then the scan line is decoded as Modified Huffman.

Parameters

TDes8& aScanLine

On return, contains the decoded scan line.

const TDesC8& anEncodedScanLine

The encoded scan line to be decoded.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

Notes:


EncodeScanLine1D()

void EncodeScanLine1D(const TDesC8& aScanLine,TDes8& anEncodedScanLine);

Description

Encodes a scan line using Modified Huffman compression.

Parameters

const TDesC8& aScanLine

The scan line to be encoded.

TDes8& anEncodedScanLine

On return, contains the MH encoded scan line.


DecodeScanLine1D()

TInt DecodeScanLine1D(TDes8& aScanLine,const TDesC8& anEncodedScanLine);

Description

Decodes a Modified Huffman encoded scan line.

Parameters

TDes8& aScanLine

On return, contains the decoded scan line.

const TDesC8& anEncodedScanLine

The MH encoded scan line to be decoded.

Return value

TInt

KErrNone if successful, KErrUnderflow if the scan line is encoded as MR, otherwise another of the system-wide error codes.


EncodeScanLine2D()

void EncodeScanLine2D(const TDesC8& aScanLine,TDes8& anEncodedScanLine);

Description

Encodes a scan line using Modified Read compression.

Parameters

const TDesC8& aScanLine

The scan line to be encoded.

TDes8& anEncodedScanLine

On return, contains the MR encoded scan line.


DecodeScanLine2D()

TInt DecodeScanLine2D(TDes8& aScanLine,const TDesC8& anEncodedScanLine);

Description

Decodes a Modified Read encoded scan line.

Parameters

TDes8& aScanLine

On return, contains the decoded scan line.

const TDesC8& anEncodedScanLine

The 2D encoded scan line to be decoded.

Return value

TInt

KErrNone if successful, KErrUnderflow if the scan line is encoded as MR, otherwise another of the system-wide error codes.