2012.09.06 15:30 "[Tiff] Managing the buffer", by

2012.09.06 15:30 "[Tiff] Managing the buffer", by

Dear TIFF list:

I would like (for complicated reasons) to write a large number of TIFF images that are the same size. I wish to have a pre-allocated buffer and not allocate a new buffer each time I want to write an image. I gather from reading various man-pages that TIFFWriteBufferSetup() may be used for such cases as mentioned in the man page -- " 'intelligent clients' that wish to optimize memory usage and/or eliminate potential copy operations that can occur when working with images that have data stored without compression "

That nicely states what I wish to do.

However, I don't quite understand at what point this routine should be called.

If I call TIFFOpen, then it seems that the buffer gets allocated if it isn't already allocated ;

But if I don't call TIFFopen, then I don't have a valid TIFF structure to call? When I call TIFFClose, doesn't it deallocate the buffer?

1 allocate a buffer
2 call TIFFWriteBufferSetup
3 call TIFFOpen
4 call TIFFWrite[scanline,strip...]
5 call TIFFClose
6 loop to 3?

This doesn't make sense because I don't have a TIFF structure pointer at 2


1 allocate a buffer
2 call TIFFOpen
3 call TIFFWriteBufferSetup
4 call TIFFWrite[scanline,strip...]
5 call TIFFClose
6 loop to 2?

This doesn't seem to make sense because I suppose that TIFFOpen will allocate a buffer, and TIFFClose will free the buffer?

Thanks for any help!



Dr. Robert C. Atwood
Senior Support Scientist
Beamline I12-JEEP
The Joint Engineering and Environmental Processing Beamline
Diamond Light Source
The Harwell Science and Innovation Campus
OX11 0DE
+44 (0) 1235 778 670

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom