2007.07.19 08:32 "Re: [Tiff] How can I pass Tiff to float or unsigned char?", by Oliver Geisen
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
- Open the tiff
- read sone tiff-tags to find out what kind of image it is (size, organisation of data (strips/tiles), colorspace, planarconfig, etc.)
- create a memorybuffer to store a scanline, strip or tile of data
- loop through each component and use TIFFReadScanline, TIFFReadEncodedStrip, etc. so get the desired data
- do something with it :-) maybe write back to another tiff
- 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.
Kreisboten Verlag Mühlfellner KG
82362 Weilheim i. Ob.
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