Files
rgbds/include/gfx/png.hpp
T
Rangi f8a1da71c1 Only sort generated palette colors by PLTE order for indexed PNG images
Non-indexed images can still have a PLTE chunk. We should use
`sortRgb` instead of `sortIndexed` for them, since their pixels' colors
may not all be present in the PLTE chunk and would be unsortable.
2026-09-13 18:53:31 -04:00

24 lines
404 B
C++

// SPDX-License-Identifier: MIT
#ifndef RGBDS_GFX_PNG_HPP
#define RGBDS_GFX_PNG_HPP
#include <stdint.h>
#include <streambuf>
#include <vector>
#include "gfx/rgba.hpp"
struct Png {
uint32_t width = 0;
uint32_t height = 0;
std::vector<Rgba> pixels{};
std::vector<Rgba> palette{};
bool isIndexed = false;
Png() {}
Png(char const *filename, std::streambuf &file);
};
#endif // RGBDS_GFX_PNG_HPP