AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.03.15 23:58 "[Tiff] libtiff and streams", by Dimitar Gospodinov
2004.03.16 00:14 "Re: [Tiff] libtiff and streams", by Bob Friesenhahn
2004.03.16 00:43 "Re: [Tiff] libtiff and streams", by Joris Van Damme
2004.03.16 01:38 "Re: [Tiff] libtiff and streams", by Dimitar Gospodinov
2004.03.16 02:08 "Re: [Tiff] libtiff and streams", by Joris Van Damme
2004.03.16 06:56 "Re: [Tiff] libtiff and streams", by Andrey Kiselev
2004.03.16 12:16 "Re: Re: [Tiff] libtiff and streams", by Dimitar
2004.03.16 04:30 "Re: [Tiff] libtiff and streams", by Frank Warmerdam
2004.03.16 08:00 "Re: [Tiff] libtiff and streams", by Rob van den Tillaart
2004.03.16 08:25 "Re: [Tiff] libtiff and streams", by Andrey Kiselev

2004.03.16 08:25 "Re: [Tiff] libtiff and streams", by Andrey Kiselev

So if you want to do streaming you should have a TIFF_2_TIFF-F normalizer in the front of the pipeline and every filter in the pipeline should write according to TIFF-F. But as stated in the RFC the filters should be able to read non TIFF-F conforming TIFF format to be more generic.

And to place IFD in front of image data it should be enough to call TIFFCheckpointDirectory() after setting all tags. Something like:

    out = TIFFOpen("out.tif", "w");
    TIFFSetField(out, TIFFTAG_IMAGEWIDTH, image_width);
    TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, bpp);
    TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, spp);
    TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
    TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photo);
    TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
    TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(out, 0));

    TIFFCheckpointDirectory(out);

    for (i = 0; i < image_height; i++)
        TIFFWriteScanline(out, buf + i * image_width * spp, i, 0);

    TIFFClose(out);

Just a suggestion fro those, who want to create TIFFs, suitable for sequental access.

Andrey

Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517