📄 readme
字号:
Date: Fri, 01 Aug 1997 20:14:52 MDTTo: Sam Leffler <sam@cthulhu.engr.sgi.com>From: "Conrad J. Poelman (WSAT)" <poelmanc@plk.af.mil>Subject: Potential TIFF library additionsDelivery-Date: Fri, 01 Aug 1997 19:21:06 -0700Sam,You probably don't remember me, but I sent in a couple of bug fixesregarding the TIFF library about a 16 months ago or so...I just wanted to send you two other additions that I have made to ourlocal version of the TIFF library in hopes that you will want toincorporate them into your next major release of the TIFF library.(These additions are based on TIFF version 3.4beta31, but they sit ontop of the library so they shouldn't be much trouble to incorporate theminto any more recent version.) They are internally documented to areasonable extent and we've been successfully using them in our codehere for over a year. If you think they would make good additions to theTIFF library, I'd be happy to clean them up more, document them more,and/or integrate them with the latest version of the TIFF library, but Ifigured I'd see if you were interested in using them before I went toall that trouble.TIFF Image Iterator-------------------Your ReadRGBA() routine works well for reading many different formats(TILED, STIP, compressed or not, etc.) of the most basic types of data(RGB, 8-bit greyscale, 8-bit colormapped) into an SGI-style data array,and serves as a good template for users with other needs. I used it asan exmaple of how to make an iterator which, rather than fill a dataarray, calls an arbitrary user-supplied callback function for each"chunk" of data - that "chunk" might be a strip or a tile, and mighthave one sample-per-pixel or two, and might be 8-bit data or 16-bit or24-bit. The callback function can do whatever it wants with the data -store it in a big array, convert it to RGBA, or draw it directly to thescreen. I was able to use this iterator to read 16-bit greyscale and 32-and 64-bit floating point data, which wasn't possible with ReadRGBA().I have tested this routine with 8- and 16-bit greyscale data as well aswith 32- and 64-bit floating point data. I believe nearly all of ourdata is organized in strips, so actually I'd appreciate it if you hadsome tiled images that I could test it with.It should certainly be possible and would be cleanest to reimplementReadRGBA() in terms of the image iterator, but I haven't done that.Private Sub-Directory Read/Write--------------------------------TIFF-PL is a Phillips Laboratory extension to the TIFF tags that allowsus to store satellite imaging-specific information in a TIFF format,such as the satellite's trajectory, the imaging time, etc. In order togive us the flexibility to modify the tag definitions without gettingapproval from the TIFF committee every time, we were given only threeTIFF tags - a PL signature, a PL version number, and PL directoryoffset, which lists the position in the file at which to find a privatesub-directory of tags-value pairs. So I wrote two routines:TIFFWritePrivateDataSubDirectory(), which takes a list of tags and a"get" function and writes the tag values into the TIFF file, returningthe offset within the file at which it wrote the directory; andTIFFReadPrivateDataSubDirectory(), which takes an offset, a list oftags, and a "set" function and reads all the data from the privatedirectory. The functions themselves are pretty simple. (The files arehuge because I had to basically copy all of the tif_dirread.c andtif_dirwrite.c files in order to access the various fetching routineswhich were all declared static and therefore inaccessible in the TIFFlibrary.)I'm including the four source files (tif_imgiter.h, tif_imgiter.c,tif_pdsdirread.c, tif_pdsdirwrite.c) in case you want to take a look atthem. I can also send you some sample code that uses them if you like.If you're interested in having them incorporated into the standard TIFFlibrary, I'd be happy to do that integration and clean up and documentthe routines. (For example, I've already realized that instead oflimiting the SEP callback function to three bands (R,G,B) it should takean array to enable the handling of n-banded multi-spectral data...) Ifnot, I'll just leave them as they are, since they work fine for us now.Holler if you have any questions.-- Conrad__________________________________________________________________ Capt Conrad J. Poelman PL/WSAT (Phillips Laboratory) 505-846-4347 3550 Aberdeen Ave SE (FAX) 505-846-4374 Kirtland AFB, NM 87117-5776
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -