Return-Path: <tiff-admin@remotesensing.org>
Received: from inmx011.isp.belgacom.be (inmx011.isp.belgacom.be [195.238.3.50])
        by six.skynet.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id i1ND0twd015581
        for <joris.at.lebbeke@skynet.be>; Mon, 23 Feb 2004 14:00:55 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com ([208.24.120.42])
        by inmx011.isp.belgacom.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id i1ND0nnU029393
        for <joris.at.lebbeke@skynet.be>; Mon, 23 Feb 2004 14:00:50 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com (localhost.localdomain [127.0.0.1])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i1NCwnl05274;
	Mon, 23 Feb 2004 07:58:49 -0500
Received: from DarkOne.ural.ru (relay.ural.ru [195.64.192.49])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i1NCtUl05240
	for <tiff@remotesensing.org>; Mon, 23 Feb 2004 07:55:30 -0500
Received: from ubik.convex.ru (ubik.convex.ru [195.64.222.2])
	by DarkOne.ural.ru (8.12.10/Ural) with ESMTP id i1NCtTvm002217
	for <tiff@remotesensing.org>; Mon, 23 Feb 2004 17:55:29 +0500 (YEKT)
Received: from naumen.ru (vol.convex.ru [82.193.148.152])
	by ubik.convex.ru (8.12.11/8.12.11) with ESMTP id i1NCtRCS073616
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <tiff@remotesensing.org>; Mon, 23 Feb 2004 17:55:29 +0500 (YEKT)
Message-ID: <4039F826.8020603@naumen.ru>
From: Vladimir Pastukhov <vpastukhov@naumen.ru>
Organization: NAUMEN
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: ru, en
MIME-Version: 1.0
To: tiff@remotesensing.org
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Subject: [Tiff] Request for new functions
Sender: tiff-admin@remotesensing.org
Errors-To: tiff-admin@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Post: <mailto:tiff@remotesensing.org>
List-Subscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
List-Id: TIFF and libtiff discussion <tiff.remotesensing.org>
List-Unsubscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://remotesensing.org/pipermail/tiff/>
Date: Mon, 23 Feb 2004 17:55:02 +0500
X-UIDL: 03d51cd50d584049f10fd8925490ee6e

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

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://remotesensing.org/mailman/listinfo/tiff
