openMSX
PNG.hh
Go to the documentation of this file.
1#ifndef PNG_HH
2#define PNG_HH
3
4#include "SDLSurfacePtr.hh"
5
6#include <cstdint>
7#include <span>
8#include <string>
9
12namespace openmsx::PNG {
19 [[nodiscard]] SDLSurfacePtr load(const std::string& filename, bool want32bpp);
20
21 void saveRGBA(size_t width, std::span<const uint32_t*> rowPointers,
22 const std::string& filename);
23 void saveGrayscale(size_t width, std::span<const uint8_t*> rowPointers,
24 const std::string& filename);
25
26} // namespace openmsx::PNG
27
28#endif // PNG_HH
Wrapper around a SDL_Surface.
Utility functions to hide the complexity of saving to a PNG file.
Definition PNG.cc:27
void saveGrayscale(size_t width, std::span< const uint8_t * > rowPointers_, const std::string &filename)
Definition PNG.cc:340
void saveRGBA(size_t width, std::span< const uint32_t * > rowPointers, const std::string &filename)
Definition PNG.cc:322
SDLSurfacePtr load(const std::string &filename, bool want32bpp)
Load the given PNG file in a SDL_Surface.
Definition PNG.cc:106