AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
February 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.02.23 12:55 "Request for new functions", by Vladimir Pastukhov
2004.02.23 14:50 "Re: Request for new functions", by Frank Warmerdam
2004.02.24 00:28 "Re: Request for new functions", by Vladimir Pastukhov
2004.02.24 07:28 "Re: Request for new functions", by Andrey Kiselev
2004.02.24 07:30 "Re: Request for new functions", by Andrey Kiselev

2004.02.23 12:55 "Request for new functions", by Vladimir Pastukhov

Hello,

I'm adding Group3 and Group4 TIFF compression support to Python
Imaging Library, using Libtiff codecs.

Currently in my solution I have to manipulate internal Libtiff
structures, which is a bad programming design.  To overcome this
problem I want to have several additions to Libtiff interface.


Because PIL can read image in chunks, calling appropriate decoder,
it is necessary to save and restore TIFF codec's state.  Two new
functions are needed.  They should have an argument specifying
which part of the state structure to copy (all/base/decoder/encoder,
decoder and encoder do not include base).

The proposed declarations are:

typedef enum {
     STATE_ALL, STATE_BASE,
     STATE_DECODER, STATE_ENCODER
} TIFFCodecStateType;

tdata_t TIFFSaveCodecState(TIFF *tif, tdata_t buf, TIFFCodecStateType st);
void TIFFRestoreCodecState(TIFF *tif, tdata_t buf, TIFFCodecStateType st);

Because allocating memory every time the state is saved seems
inefficient, save function should take a pointer to the existing
memory buffer.  If the pointer is null, it allocates a new buffer
and returns its address.


Other less important things I wish to be added:

* Function that allocates a new TIFF structure, zero-filling it.

* Function to determine what runtime library version is (there is
already TIFFGetVersion but it returns string in a machine-unfriendly
form).

* Header declaration for _TIFFSetDefaultCompressionState.


I can participate in work on implementation if these interface
changes will be approved.


Best regards,
-- 
Vladimir Pastukhov
vpastukhov@naumen.ru