
Thread
2005.03.16 19:38 "Re: [Tiff] Need to write CCITT T.6 encoded TIFF file data directlytomemory buffer", by Joris Van Damme
Roger,
I am now more puzzled than ever.
I'm not sure what's so confusing. Why do you expect any reference to any particular codec in IO functions? Perhaps I should try and explain where exactly this IO comes into play...
The basic TIFF open function is TIFFClientOpen. This is not just the most basic of TIFF open functions, it is in fact the *only* TIFF open function on the platform independent LibTiff level. Amongst its parameters are pointers to IO functions. By providing pointers to file IO functions, you obtain TIFF reading/writing from/to file. By providing pointers to TStream IO functions you obtain TIFF reading/writing from/to TStream. The most widely used TIFFOpen is in fact a wrapper around TIFFClientOpen that passes pointers to file IO functions.
Let's look at this from another perspective. There's something like three layers involved here
- The application level, that makes the call to a TIFFOpen or TIFFOpenStream function
- The platform dependent little layer on top of LibTiff. This layer implements IO functions in platform specific manners. tiff_win32.c, for example, is a platform dependent layer, specifically targetted towards LibTiff usage in windows. This tiff_win32.c thus implements file IO functions in a manner that works for this platform. It also implements a TIFFOpen function, that is a wrapper around the platform independent TIFFClientOpen, and passes pointers to these win32 file IO functions.
- The platform independent core LibTiff. This layer can be platform independent because it doesn't actually need to know how to read from or write to file, for example. Instead, it has pointers to functions that do this kind of stuff, provided as parameters in the TIFFClientOpen call. Whenever this core LibTiff layer needs to read, it calls the tiff reader function that is *not* part of patform independent core LibTiff, but pointed to by a TIFFClientOpen parameter, and presumably implemented in the previously explained platform dependent little layer.
More information about the various TIFFOpen flavours is here:
http://www.remotesensing.org/libtiff/man/TIFFOpen.3tiff.html
Does this all explain it?
Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html