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
March 2008

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

2008.03.27 17:43 "Open Tiff File in Read and write mode.", by Jean-michel Frecinat
2008.04.02 10:29 "Re: Open Tiff File in Read and write mode.", by Gerben Vos

2008.03.27 17:43 "Open Tiff File in Read and write mode.", by Jean-michel Frecinat

Hi,
 
I use libtiff 3.8.2 and i have some problems with memory. When I create a
30000x10000 pixels in cmyk, i have to have a lot of RAM memory (about
2-3GB).
 
To create this file, I use this code.
 
unsigned char* raster = (unsigned char*)_TIFFmalloc(width*height*spp);
 
but this method require a lot of memory.
 
I want use this code.
 
unsigned char* raster = (unsigned char*)_TIFFmalloc(width*spp);
 
But my problem, i would open my file in read and write mode to edit and to
process some pixels and after save the scanline into file.
 
Like that :
 
for(unsigned long y=0 ; y<height ; y++)
{
        TIFFReadScanline(input,data,y,0);
        TIFFReadScanline(output,raster,y,0);

       for(unsigned long x=0 ; x< width ; x++)
       {
                for(unsigned short sample = 0 ; sample < spp ; sample++)
                {
                    raster[(width*index+x)*spp+sample] = data[x*spp+sample];
                    ...
                }
       }
       TIFFWriteScanline(output,raster,y,0);
...
 
This method could help me to create large tiff files with only 1GB of RAM
memory.
 
It is possible, can you help me.
 
 
best regards.
 
_________________________________________________________________
Découvrez les profils Messenger de vos amis !
http://home.services.spaces.live.com/