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