AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.03.05 11:22 "[Tiff] Reading a bilevel inage", by salil khanwalkar
2004.03.05 14:00 "Re: [Tiff] Reading a bilevel inage", by Frank Warmerdam
2004.04.03 07:22 "[Tiff] tiff", by maryam pahlevanzadeh
2004.04.04 16:48 "Re: [Tiff] tiff", by Andrey Kiselev

2004.03.05 14:00 "Re: [Tiff] Reading a bilevel inage", by Frank Warmerdam

Can somebody help me in displaying a bilevel image. Please tell me which functions should i read.

Salil,

Are you sure you have went through the documentation sufficiently before asking such a general and open ended question?

Looking through the "Using The TIFF Library" page at:

   http://www.remotesensing.org/libtiff/libtiff.html

There are simple examples of accessing TIFF files using libtiff. For example the first scanline example is pretty straight forward:

#include "tiffio.h"
main()
{
     TIFF* tif = TIFFOpen("myfile.tif", "r");
     if (tif) {
        uint32 imagelength;
        tdata_t buf;
        uint32 row;

        TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imagelength);
        buf = _TIFFmalloc(TIFFScanlineSize(tif));
        for (row = 0; row < imagelength; row++)
            TIFFReadScanline(tif, buf, row);
        _TIFFfree(buf);
        TIFFClose(tif);
     }
}

The pixel values will be bit packed in the "buf" buffer.

There is also some excellent tutorial material available from IBM DeveloperWrks on using libtiff. Also linked on the "Using The TIFF Library" page.

I would suggest you experiment and then ask a focused question.

As you might imagine, there is nothing us free software maintainers like less than someone essentially saying "tell me how to do my job, I am not willing to take the time to even read your documentation and experiment first".

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent