2004.03.15 23:58 "[Tiff] libtiff and streams", by Dimitar Gospodinov

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