Factor out a single PNG-reading function to encapsulate the libpng API (#1765)

This commit is contained in:
Rangi
2025-07-23 15:53:33 -04:00
committed by GitHub
parent 2ce4cdbff6
commit 7e151f16c3
19 changed files with 395 additions and 543 deletions

21
include/gfx/png.hpp Normal file
View File

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