2007.07.19 07:43 "[Tiff] How can I pass Tiff to float or unsigned char?", by NandEx

2007.07.19 08:32 "Re: [Tiff] How can I pass Tiff to float or unsigned char?", by Oliver Geisen

Hello,

I'm novice using libTiff. I want to catch a TIFF Image and pass to float or unsigend char.

i think you're mixing up some things, but should be more descriptive about what you want to do?

Do you want to deal with the pixeldata of the image? If yes is the answer this is how it's been done

  1. Open the tiff
  2. read sone tiff-tags to find out what kind of image it is (size, organisation of data (strips/tiles), colorspace, planarconfig, etc.)
  3. create a memorybuffer to store a scanline, strip or tile of data
  4. loop through each component and use TIFFReadScanline, TIFFReadEncodedStrip, etc. so get the desired data
  5. do something with it :-) maybe write back to another tiff
  6. close tiff

So the point is about how to access the pixeldata of the tiff image. Because of the variety of possibilities the tiff-format provides there is no simple answer to that question... Basically data is stored in some sort of byte-arrays, so best is to create a memoryblock of type unsigned char, which will most often be a byte (8 bit) on all platforms, and then use TIFF-functions to copy data into it.

Then it's up to your imagination of what to do with this data.

Oliver Geisen
Systemadministrator
_____________________________
Kreisboten Verlag Mühlfellner KG
82362 Weilheim i. Ob.
Tel. 0881/686-904
Fax 0881/686-74
Sitz Weilheim, AG München, HRA 64016, p.h.G.:
Kreisboten-Verlag Verwaltungsgesellschaft mbH,
Weilheim, AG München, HRB 119773,
Geschäftsführer: Dr. Dirk Ippen, Dr. Gerd Waldenmaier