AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1998.05.26 13:00 "Processing large files", by Roland Hammerle
1998.05.26 13:10 "Re: Processing large files", by Takao Matsuda
1998.05.26 13:37 "Re: Processing large files", by Roland Hammerle
1998.05.26 16:07 "Re: Processing large files", by Joe Longo

1998.05.26 16:07 "Re: Processing large files", by Joe Longo

I also needed to buffer the RGBA a few rows at a time, Allocating a buffer to hold the entire image was not an option. My solution was to add my own function to collect the decompressed RGB rows as they are generated, 1 line at a time.

This means adding a call to each of the colorspace conversion routines in tif_getimage.c (the 'put' functions) like in the example below.

(a tiled routine will differ from the contiguous routine. I only needed contiguous, so that is all I wrote.)

/*
 * 8-bit packed samples, no Map => RGB
 */
DECLAREContigPutFunc(putRGBcontig8bittile)
{
    int samplesperpixel = img->samplesperpixel;
   (void) x; (void) y;
    fromskew *= samplesperpixel;
    while (h-- > 0) {
        UNROLL8(w, NOP,
            *cp++ = PACK(pp[0], pp[1], pp[2]);
            pp += samplesperpixel);
        cp += toskew;
        pp += fromskew;
/**One row of RGBA has been produced, so you can use it **/
        YOUR_CALL_HERE(your, arguments, here);
    }
}

--
Joe Longo joel@flashpnt.com
530 274 5977 ext. 13 (Grass Valley, Ca.)
Flashpoint Technology, Inc.