mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Revert "Create palette in rpng_process_t"
This reverts commit 93706c67e86353a7f8a022f2c87941d75b448baf.
This commit is contained in:
parent
18da753ec1
commit
4770b37273
@ -90,7 +90,8 @@ static void deinterlace_pass(uint32_t *data, const struct png_ihdr *ihdr,
|
||||
}
|
||||
|
||||
static bool png_reverse_filter(uint32_t *data, const struct png_ihdr *ihdr,
|
||||
struct rpng_process_t *pngp)
|
||||
struct rpng_process_t *pngp,
|
||||
const uint32_t *palette)
|
||||
{
|
||||
unsigned i, h;
|
||||
unsigned bpp;
|
||||
@ -165,7 +166,7 @@ static bool png_reverse_filter(uint32_t *data, const struct png_ihdr *ihdr,
|
||||
copy_line_rgb(data, decoded_scanline, ihdr->width, ihdr->depth);
|
||||
else if (ihdr->color_type == 3)
|
||||
copy_line_plt(data, decoded_scanline, ihdr->width,
|
||||
ihdr->depth, pngp->palette);
|
||||
ihdr->depth, palette);
|
||||
else if (ihdr->color_type == 4)
|
||||
copy_line_gray_alpha(data, decoded_scanline, ihdr->width,
|
||||
ihdr->depth);
|
||||
@ -183,7 +184,8 @@ end:
|
||||
|
||||
static bool png_reverse_filter_adam7(uint32_t *data,
|
||||
const struct png_ihdr *ihdr,
|
||||
struct rpng_process_t *pngp)
|
||||
struct rpng_process_t *pngp,
|
||||
const uint32_t *palette)
|
||||
{
|
||||
unsigned pass;
|
||||
static const struct adam7_pass passes[] = {
|
||||
@ -232,7 +234,7 @@ static bool png_reverse_filter_adam7(uint32_t *data,
|
||||
}
|
||||
|
||||
if (!png_reverse_filter(tmp_data,
|
||||
&tmp_ihdr, pngp))
|
||||
&tmp_ihdr, pngp, palette))
|
||||
{
|
||||
free(tmp_data);
|
||||
return false;
|
||||
|
@ -340,16 +340,15 @@ bool rpng_load_image_argb(const char *path, uint32_t **data,
|
||||
|
||||
process.total_out = stream.total_out;
|
||||
process.inflate_buf = rpng.inflate_buf;
|
||||
process.palette = rpng.palette;
|
||||
|
||||
if (rpng.ihdr.interlace == 1)
|
||||
{
|
||||
if (!png_reverse_filter_adam7(*data,
|
||||
&rpng.ihdr, &process))
|
||||
&rpng.ihdr, &process, rpng.palette))
|
||||
GOTO_END_ERROR();
|
||||
}
|
||||
else if (!png_reverse_filter(*data,
|
||||
&rpng.ihdr, &process))
|
||||
&rpng.ihdr, &process, rpng.palette))
|
||||
GOTO_END_ERROR();
|
||||
|
||||
end:
|
||||
|
@ -299,16 +299,15 @@ bool rpng_nbio_load_image_argb_process(struct rpng_t *rpng,
|
||||
|
||||
process.total_out = stream.total_out;
|
||||
process.inflate_buf = rpng->inflate_buf;
|
||||
process.palette = rpng->palette;
|
||||
|
||||
if (rpng->ihdr.interlace == 1)
|
||||
{
|
||||
if (!png_reverse_filter_adam7(*data,
|
||||
&rpng->ihdr, &process))
|
||||
&rpng->ihdr, &process, rpng->palette))
|
||||
return false;
|
||||
}
|
||||
else if (!png_reverse_filter(*data,
|
||||
&rpng->ihdr, &process))
|
||||
&rpng->ihdr, &process, rpng->palette))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -63,7 +63,6 @@ struct png_ihdr
|
||||
struct rpng_process_t
|
||||
{
|
||||
const uint8_t *inflate_buf;
|
||||
const uint32_t *palette;
|
||||
size_t total_out;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user