2008.11.11 17:17 "Re: [Tiff] Writing scanlines with PLANARCONFIG == SEPARATE", by Richard Nolde
I saw the lines you quote in the TIFF spec but they do leave some
room for interpretation since they use the words "might" and "perhaps." My goal was to place one or more scanlines of sample one, eg Red, followed by one or more scanlines of sample two, eg Green, followed by one or more scanlines of sample three, eg Blue, in each strip, instead of having all the scanlines for sample one before any of the scanlines for sample 2 and the same for sample three. That way you would not have to seek so far within the file to get all the samples for a given scanline.
I did try setting rowsperstrip to one, but libtiff seems to have a problem with this since the functions that calculate which strip a given scanline will fall into assume that all scanlines (and strips) for a given sample plane are contiguous. Since PLANARCONFIG == SEPARATE doesn't seem to be widely used, I am going to stay with the previous logic when writing out those files and concentrate on adding support for cropping, rotating, mirroring, etc for all bit depths. I am curious if anyone has seen TIFF files with such an arrangement however.
I kinda got lost in following what you want to do, but it seems to me that if you want PLANAR, and you want the bands together by scanline, then you must set ROWS_PER_STRIP to 1. Otherwise, a number of scanlines from each band are going to be together.
>From the TIFF spec:
"If a row interleave effect is desired, a writer might write out the
PlanarConfiguration=2-separate sample planes-but break up the planes
multiple strips (one row per strip, perhaps) and interleave the
Perhaps I am misunderstanding, but from what I can tell, what you are proposing is neither PLANAR nor CHUNKY as defined by the TIFF spec.