1*37854ecaSFrank WarmerdamSubject: tiff stream interface (contrib) 2*37854ecaSFrank WarmerdamDate: Thu, 30 Mar 2000 10:48:51 -0800 3*37854ecaSFrank WarmerdamFrom: "Avi Bleiweiss" <[email protected]> 4*37854ecaSFrank WarmerdamTo: <[email protected]>, <[email protected]> 5*37854ecaSFrank Warmerdam 6*37854ecaSFrank WarmerdamHere at Shutterfly we have augmented the file based tiff library to support 7*37854ecaSFrank WarmerdamC++ streams. The implementation is an adaptor class, which takes any C++ 8*37854ecaSFrank Warmerdamstream from the user and in return it deposits i/o operation method pointers 9*37854ecaSFrank Warmerdam(e.g. read, write, seek and close) into the tiff's library client state. 10*37854ecaSFrank Warmerdam 11*37854ecaSFrank WarmerdamThe class TiffStream has an overloaded factory method - makeFileStream - 12*37854ecaSFrank Warmerdamwhich takes the C++ stream as an argument, calls TIFFClientOpen and returns 13*37854ecaSFrank Warmerdama tiff handle. The class retains the tiff handle in its local state and 14*37854ecaSFrank Warmerdamprovides a helper function (getTiffHandle) to query the handle at any time. 15*37854ecaSFrank WarmerdamAdditional helper method - getStreamSize - provides the stream size to the 16*37854ecaSFrank Warmerdamuser. The implementation assumes client responsibility to delete the stream 17*37854ecaSFrank Warmerdamobject. The class calls TIFFClose at destruction time. 18*37854ecaSFrank Warmerdam 19*37854ecaSFrank WarmerdamAttached are a definition (tiffstream.h) and an implementation 20*37854ecaSFrank Warmerdam(tiffstream.cpp) files of the TiffStream class. No changes are required to 21*37854ecaSFrank Warmerdamthe tiff core piece and the class sits on top of the library. The code is 22*37854ecaSFrank Warmerdamfairly tested at this point and is used internally in Shutterfly imaging 23*37854ecaSFrank Warmerdamsoftware. The code is portable across WindowsNT/Linux/Solaris. 24*37854ecaSFrank Warmerdam 25*37854ecaSFrank WarmerdamWe at Shutterfly believe this software has benefits to the larger community 26*37854ecaSFrank Warmerdamof tiff library users and would like to contribute this software to be part 27*37854ecaSFrank Warmerdamof the tiff distributed package. Let me know of any issue. 28*37854ecaSFrank Warmerdam 29*37854ecaSFrank WarmerdamThanks 30*37854ecaSFrank WarmerdamAvi 31