Ignore:
Timestamp:
Aug 1, 2008, 12:02:34 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • pixels.c: clamp pixels in the float32 -> rgba32 conversion to avoid artifacts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/pixels.c

    r2616 r2620  
    9898
    9999                    p = src[4 * (y * img->w + x) + i];
    100                     d = (int)(255.999 * pow(p, 1. / GAMMA));
     100
     101                    if(p < 0.) d = 0.;
     102                    else if(p > 1.) d = 255;
     103                    else d = (int)(255.999 * pow(p, 1. / GAMMA));
     104
    101105                    dest[4 * (y * img->w + x) + i] = d;
    102106
Note: See TracChangeset for help on using the changeset viewer.