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 2005

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!



2005.03.11 15:36 "unassociated v associated alpha", by Chris Losinger

just curious...

in tif_getimage.c, the putRGBUAcontig8bittile function (8-bit packed 
samples => RGBA w/ unassociated alpha) appears to be treating the alpha 
data as if it's been pre-multiplied:

...
    a = pp[3];
    r = (pp[0] * a) / 255;
    g = (pp[1] * a) / 255;
    b = (pp[2] * a) / 255;
    *cp++ = PACK4(r,g,b,a);
...

while the putRGBAAcontig8bittile function (8-bit packed samples => RGBA w/ 
associated alpha) simply copies the pixel data to the output, without doing 
any alpha calculations.

are these reversed ? seems to me you'd want to multiply the "associated" 
data, but copy the "unassociated" data.

or, am I confused... ? :)

-c
__________________________
Chris Losinger
Smaller Animals Software, Inc.				
http://www.smalleranimals.com