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