2002.09.05 09:56 "Decode group4", by Jan Edmundson

2002.09.05 13:16 "Re: Decode group4", by Peter Nielsen

I am currently in the process of creating a class implementation of the fax group 4 codec. I have a class namned CCodec with 2 methods Decode and Encode. I am focusing on the decoding bit at the moment. I have a hypothesis that the Decode method would be sufficently declared as follows:

Decode( BYTE* pDest, DWORD dwDestSize, BYTE* pSrc, DWORD dwSrcSize, DWORD dwRowSize );

Dest should be uncompressed and Src should be compressed.

Janne,

I think that at the very minimum a generic decoder class would need to have the following fuctions:

::setDataSource (std::istream& is); // Set the data source that handles feeding of data to the decoder (e.g. reading a file, feeding raw memory, reading a socket, or whatever). This could be a custom class or someting as simple and standard as a C++ istream.

::decodeRow (BYTE* pData, UINT* uiBytesInOut); // Read one "row" of strip or tile data

::skipToEOL (); // Eat data until the next EOL

::setXXX () // Misc functions to configure the decoder, e.g. ::setByteAlign (bool set = true); ::setFailOnBadData (bool set = true);

Best regards,
Peter Nielsen