Explorar el Código

* pixels.c: clamp pixels in the float32 -> rgba32 conversion to avoid

artifacts.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2620 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam hace 16 años
padre
commit
caba836e5d
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. +5
    -1
      pipi/pixels.c

+ 5
- 1
pipi/pixels.c Ver fichero

@@ -97,7 +97,11 @@ pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type)
uint8_t d;

p = src[4 * (y * img->w + x) + i];
d = (int)(255.999 * pow(p, 1. / GAMMA));

if(p < 0.) d = 0.;
else if(p > 1.) d = 255;
else d = (int)(255.999 * pow(p, 1. / GAMMA));

dest[4 * (y * img->w + x) + i] = d;

e = p - u8tof32(d);


Cargando…
Cancelar
Guardar