freeswitch/libs/tiff-4.0.2/contrib/win_dib
Steve Underwood b989f8d3eb The tiff-4.0.2 distribution's configure.ac seems to have two lines missing
AC_PROG_LIBTOOL
m4_include(m4/acinclude.m4)
Adding these and taking out all the Makefile.in files from the tiff-4.0.2
directory seems to sort out the build issues.
2012-09-02 14:38:13 +08:00
..
Makefile.am Added tiff-4.0.2 as the first step in moving from libtiff 3.8.2 to libtiff 4.0.2 2012-09-01 17:59:43 +08:00
Makefile.w95 Added tiff-4.0.2 as the first step in moving from libtiff 3.8.2 to libtiff 4.0.2 2012-09-01 17:59:43 +08:00
README.tiff2dib Added tiff-4.0.2 as the first step in moving from libtiff 3.8.2 to libtiff 4.0.2 2012-09-01 17:59:43 +08:00
README.Tiffile Added tiff-4.0.2 as the first step in moving from libtiff 3.8.2 to libtiff 4.0.2 2012-09-01 17:59:43 +08:00
tiff2dib.c Added tiff-4.0.2 as the first step in moving from libtiff 3.8.2 to libtiff 4.0.2 2012-09-01 17:59:43 +08:00
Tiffile.cpp Added tiff-4.0.2 as the first step in moving from libtiff 3.8.2 to libtiff 4.0.2 2012-09-01 17:59:43 +08:00

Frank,

I attached a file that uses RGBA interface (tif_getimage.c) to read a tiff
file and convert to a DIB.  It's advantage is that it is easy to read *any*
tiff file suported by libtiff and easily convert it to a DIB.  The disadvantage
is that bilevel (B&W) bitmaps (and all other non-rgba images) are also 
converted to RGBA, thus taking up 32x as much memory as needed (4 bytes per 
pixel, rather than 1 bit).  I read tiff files, but don't need to
write them.  And my files are typically small, so the overhead is mostly
inconsequential.  But for bilevel images, I overrode the get() and put()
routines of the RGBA interface to just copy the data from the input raster
to the output raster, rather than expanding out to full 32 bit format.  It
would be nice if there were a simple way to handle all palletized images,
but that would take more custom routines, and it's not that important to me.

Usage:

    m_pDIB = (PBITMAPINFOHEADER)::ReadTIFF(pathName);
    if (m_pDIB != 0) {
       m_format = IMAGETYPE_TIF;
    }

This is intended as Win32, but the modifications for new get() and put()
routines may be independent of platform.

Thanks for your work supporting the forum and the library!

Regards,

Mark James
mark@james.net