AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
May 2001

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2001.05.02 12:45 "Pixel Raster (DIB) into TIFF G4", by Wolfram Bettermann
2001.05.02 13:30 "Re: Pixel Raster (DIB) into TIFF G4", by Frank Warmerdam

2001.05.02 13:30 "Re: Pixel Raster (DIB) into TIFF G4", by Frank Warmerdam

Wolfram Bettermann wrote:
> I have tried to convert this packed raster into a TIFF G4 using
> TIFFWriteEncodedSTrip, but do get an error message that the ImageLength is not
> set (altough I did with TIFFSetField) but was not sure how to tell libtiff
> where this raster buffer resides.

Wolfram, 

You will likely have to provide the relvent section of code for us to see
to answer this.  
 
> My question is, do I first have to unpack the bytes that 1 pixel (1bit) is in
> ne byte (so width is now really one pixel per byte) and then pass this buffer
> to libtiff using  WriteEncodedStrip? And if yes, how do I pass this raster
> buffer to the libtiff?

No, if you setup output with BITSPERSAMPLE set to 1, you will want to 
keep your bitmap packed eight pixels per byte.  However, the 32bit alignment
of scanlines will be a problem.  I believe that the buffer passed to 
TIFFWriteEncodedStrip() expects the buffer to be tightly packed (no extra
space for alignment between scanlines), so if you width isn't a multiple
of 32 you will have to repack the bitmap before passing to TIFFWriteEncodedStrip.

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