AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2002.09.05 09:56 "Decode group4", by Jan Edmundson
2002.09.05 10:21 "Re: Decode group4", by Frank D. Cringle
2002.09.05 11:56 "Re: Decode group4", by Scott Wagner
2002.09.05 16:34 "Re: Decode group4", by Lee Howard
2002.09.05 17:45 "Re: Decode group4", by Frank D. Cringle
2002.09.05 18:02 "Re: Decode group4", by Lee Howard
2002.09.09 12:27 "Re: Decode group4", by Jan Edmundson
2002.09.05 13:16 "Re: Decode group4", by

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

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