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
April 2005

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

2005.04.26 15:07 "Floating points to TIFF", by <gandhy@free.fr>
2005.04.26 15:41 "Re: Floating points to TIFF", by Joris Van Damme
2005.04.27 07:20 "Re: Floating points to TIFF", by <gandhy@free.fr>
2005.04.26 21:20 "Re: Floating points to TIFF", by Andrey Kiselev

2005.04.26 15:07 "Floating points to TIFF", by <gandhy@free.fr>

Hi !

I'm developping a soft to convert my binary raw file of floating points to TIFF
format. I'm using libtiff with these tags:

TIFFSetField(ficout, TIFFTAG_IMAGEWIDTH,width	);
TIFFSetField(ficout, TIFFTAG_IMAGELENGTH,length	);
TIFFSetField(ficout, TIFFTAG_BITSPERSAMPLE,32 ); //floating points=4Bytes
TIFFSetField(ficout, TIFFTAG_PHOTOMETRIC,34892	);
TIFFSetField(ficout, TIFFTAG_ROWSPERSTRIP,1);
TIFFSetField(ficout, TIFFTAG_SAMPLEFORMAT,SAMPLEFORMAT_IEEEFP	);
TIFFSetField(ficout, TIFFTAG_PLANARCONFIG,1	);
TIFFSetField(ficout, TIFFTAG_SAMPLESPERPIXEL,1	);

So I'm using 1band images with floating points (4Bytes)
My program writes the right amount of rows (1per strip), but i get 1byte data in
output instead of 4bytes !!!

I think i missed something...

I'm saving data like this:
raster=my raw data, filout=my output if file
// Write the information to the file
for (i=0; i<length; i++)
{
	for (j=0; j<width; j++)
		raster2[j]=raster[i*width+j];
		TIFFWriteRawStrip(filout, i, raster2, width);
}
TIFFClose(filout);


So:
My test data is a 4920*5116 image of float (4Bytes/pixel)
My output data is a 4920*5116 image of Byte (1Byte/pixel)

If someone could help me...

Thanks,
Bastien