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
February 2000

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

2000.02.17 23:21 "New to this list", by Michael Still
2000.02.22 03:21 "Re: New to this list", by Michael Still
2000.02.22 13:39 "Re: New to this list", by Helge Blischke
2000.02.22 22:29 "Re: New to this list", by Michael Still
2000.02.23 11:27 "Re: New to this list", by Michael Still
2000.02.23 13:29 "Re: New to this list", by Rainer Wiesenfarth
2000.02.23 13:42 "Re: New to this list", by Scott Wagner
2000.02.23 23:12 "Re: New to this list", by Michael Still
2000.02.24 00:35 "Re: New to this list", by Sam Leffler
2000.02.24 03:48 "Re: New to this list", by Michael Still
2000.02.23 18:08 "Re: New to this list", by Daniel Mccoy
2000.02.23 23:13 "Re: New to this list", by Michael Still

2000.02.23 18:08 "Re: New to this list", by Daniel Mccoy

Michael.Still@ipaustralia.gov.au wrote:
> [...] I want to be able to do
> the conversion in memory, without the intermediate file.
> 
> The code for the g4 compression within libtiff is somewhat undocumented, and I
> was hoping to have this clarified.

Rainer:
>What might be a solution for you:
>Use the approach of tiffcp (or Bjorn), but instead of writing to a real
>file use TIFFClientOpen to redirect the output.

Good advice from Rainer. 

In case you're not familiar with it, TIFFClientOpen
would allow you to essentially establish callbacks so that 
the g4 compression code would call your routines whenever it wanted
to do file i/o operations.  So you don't have to know anything
about the g4 compression internals to do this. 

If I remember right, you needed to get a g4 TIFF file,
possibly in strips, into a single g4 encoded buffer in memory.

Open the input file normally, open the output file with TIFFClientOpen,
copy the essential tag values from input to output, but make sure
to set the output compression to g4 and to set rows per strip
for the output file to something larger than the image.
Then just read the image from the input file and write it to the output
(simplest to write would probably be a scanline oriented loop). 
The seek,write,etc routines you specified in TIFFClientOpen need
to maintain the file image in a memory buffer.
If you need just the g4 image data and not the rest of the TIFF file
structure, it would be relatively easy to scan the file buffer
and follow the tags necessary to find image data.

Daniel McCoy            Pixar
(Rumours of this list's death have been greatly exaggerated.)