mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-16 10:47:06 +00:00
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.
24 lines
404 B
C++
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
|