|
|
@@ -48,6 +48,10 @@ pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type) |
|
|
|
if(img->last_modified == type) |
|
|
|
return &img->p[type]; |
|
|
|
|
|
|
|
/* Handle special cases */ |
|
|
|
if(type == PIPI_PIXELS_MASK_C) |
|
|
|
return &img->p[type]; |
|
|
|
|
|
|
|
/* Preliminary conversions */ |
|
|
|
if(img->last_modified == PIPI_PIXELS_RGBA_C |
|
|
|
&& type == PIPI_PIXELS_Y_F) |
|
|
@@ -152,16 +156,16 @@ pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type) |
|
|
|
|
|
|
|
dest[4 * (y * img->w + x) + i] = d; |
|
|
|
|
|
|
|
e = p - u8tof32(d); |
|
|
|
e = (p - u8tof32(d)) / 8; |
|
|
|
if(x < img->w - 1) |
|
|
|
src[4 * (y * img->w + x + 1) + i] += e * .4375; |
|
|
|
src[4 * (y * img->w + x + 1) + i] += e * 7; |
|
|
|
if(y < img->h - 1) |
|
|
|
{ |
|
|
|
if(x > 0) |
|
|
|
src[4 * ((y + 1) * img->w + x - 1) + i] += e * .1875; |
|
|
|
src[4 * ((y + 1) * img->w + x) + i] += e * .3125; |
|
|
|
src[4 * ((y + 1) * img->w + x - 1) + i] += e * 3; |
|
|
|
src[4 * ((y + 1) * img->w + x) + i] += e * 5; |
|
|
|
if(x < img->w - 1) |
|
|
|
src[4 * ((y + 1) * img->w + x + 1) + i] += e * .0625; |
|
|
|
src[4 * ((y + 1) * img->w + x + 1) + i] += e; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -188,16 +192,16 @@ pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type) |
|
|
|
|
|
|
|
dest[3 * (y * img->w + x) + i] = d; |
|
|
|
|
|
|
|
e = p - u8tof32(d); |
|
|
|
e = (p - u8tof32(d)); |
|
|
|
if(x < img->w - 1) |
|
|
|
src[4 * (y * img->w + x + 1) + i] += e * .4375; |
|
|
|
src[4 * (y * img->w + x + 1) + i] += e * 7; |
|
|
|
if(y < img->h - 1) |
|
|
|
{ |
|
|
|
if(x > 0) |
|
|
|
src[4 * ((y + 1) * img->w + x - 1) + i] += e * .1875; |
|
|
|
src[4 * ((y + 1) * img->w + x) + i] += e * .3125; |
|
|
|
src[4 * ((y + 1) * img->w + x - 1) + i] += e * 3; |
|
|
|
src[4 * ((y + 1) * img->w + x) + i] += e * 5; |
|
|
|
if(x < img->w - 1) |
|
|
|
src[4 * ((y + 1) * img->w + x + 1) + i] += e * .0625; |
|
|
|
src[4 * ((y + 1) * img->w + x + 1) + i] += e; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|