|
|
@@ -48,6 +48,20 @@ pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type) |
|
|
|
if(img->last_modified == type) |
|
|
|
return &img->p[type]; |
|
|
|
|
|
|
|
/* Preliminary conversions */ |
|
|
|
if(img->last_modified == PIPI_PIXELS_RGBA32 |
|
|
|
&& type == PIPI_PIXELS_Y_F) |
|
|
|
pipi_getpixels(img, PIPI_PIXELS_RGBA_F); |
|
|
|
else if(img->last_modified == PIPI_PIXELS_BGR24 |
|
|
|
&& type == PIPI_PIXELS_Y_F) |
|
|
|
pipi_getpixels(img, PIPI_PIXELS_RGBA_F); |
|
|
|
else if(img->last_modified == PIPI_PIXELS_Y_F |
|
|
|
&& type == PIPI_PIXELS_RGBA32) |
|
|
|
pipi_getpixels(img, PIPI_PIXELS_RGBA_F); |
|
|
|
else if(img->last_modified == PIPI_PIXELS_Y_F |
|
|
|
&& type == PIPI_PIXELS_BGR24) |
|
|
|
pipi_getpixels(img, PIPI_PIXELS_RGBA_F); |
|
|
|
|
|
|
|
/* Allocate pixels if necessary */ |
|
|
|
if(!img->p[type].pixels) |
|
|
|
{ |
|
|
|