|
roentgen |
b75cab |
Subject: tiff stream interface (contrib)
|
|
roentgen |
b75cab |
Date: Thu, 30 Mar 2000 10:48:51 -0800
|
|
roentgen |
b75cab |
From: "Avi Bleiweiss" <avi@shutterfly.com></avi@shutterfly.com>
|
|
roentgen |
b75cab |
To: <warmerda@home.com>, <mike@onshore.com></mike@onshore.com></warmerda@home.com>
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
Here at Shutterfly we have augmented the file based tiff library to support
|
|
roentgen |
b75cab |
C++ streams. The implementation is an adaptor class, which takes any C++
|
|
roentgen |
b75cab |
stream from the user and in return it deposits i/o operation method pointers
|
|
roentgen |
b75cab |
(e.g. read, write, seek and close) into the tiff's library client state.
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
The class TiffStream has an overloaded factory method - makeFileStream -
|
|
roentgen |
b75cab |
which takes the C++ stream as an argument, calls TIFFClientOpen and returns
|
|
roentgen |
b75cab |
a tiff handle. The class retains the tiff handle in its local state and
|
|
roentgen |
b75cab |
provides a helper function (getTiffHandle) to query the handle at any time.
|
|
roentgen |
b75cab |
Additional helper method - getStreamSize - provides the stream size to the
|
|
roentgen |
b75cab |
user. The implementation assumes client responsibility to delete the stream
|
|
roentgen |
b75cab |
object. The class calls TIFFClose at destruction time.
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
Attached are a definition (tiffstream.h) and an implementation
|
|
roentgen |
b75cab |
(tiffstream.cpp) files of the TiffStream class. No changes are required to
|
|
roentgen |
b75cab |
the tiff core piece and the class sits on top of the library. The code is
|
|
roentgen |
b75cab |
fairly tested at this point and is used internally in Shutterfly imaging
|
|
roentgen |
b75cab |
software. The code is portable across WindowsNT/Linux/Solaris.
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
We at Shutterfly believe this software has benefits to the larger community
|
|
roentgen |
b75cab |
of tiff library users and would like to contribute this software to be part
|
|
roentgen |
b75cab |
of the tiff distributed package. Let me know of any issue.
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
Thanks
|
|
roentgen |
b75cab |
Avi
|