PNG.hh 991 B

1234567891011121314151617181920212223242526272829
  1. #ifndef PNG_HH
  2. #define PNG_HH
  3. #include "PixelFormat.hh"
  4. #include "SDLSurfacePtr.hh"
  5. #include <string>
  6. /** Utility functions to hide the complexity of saving to a PNG file.
  7. */
  8. namespace openmsx::PNG {
  9. /** Load the given PNG file in a SDL_Surface.
  10. * This SDL_Surface is either 24bpp or 32bpp, depending on whether the
  11. * PNG file had an alpha layer. But it's possible to force a 32bpp
  12. * surface. The surface will use RGB(A) or BGR(A) format depending on
  13. * the current display format.
  14. */
  15. SDLSurfacePtr load(const std::string& filename, bool want32bpp);
  16. void save(unsigned width, unsigned height, const void** rowPointers,
  17. const PixelFormat& format, const std::string& filename);
  18. void save(unsigned width, unsigned height, const void** rowPointers,
  19. const std::string& filename);
  20. void saveGrayscale(unsigned width, unsigned height,
  21. const void** rowPointers, const std::string& filename);
  22. } // namespace openmsx::PNG
  23. #endif // PNG_HH