ImageExport.h 968 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef LIBALMOND_IMAGEEXPORT_H
  2. #define LIBALMOND_IMAGEEXPORT_H
  3. #include "Mandel.h"
  4. #include "Gradient.h"
  5. #include <functional>
  6. #include <stdexcept>
  7. namespace alm
  8. {
  9. struct ImageExportInfo
  10. {
  11. mnd::MandelInfo drawInfo;
  12. mnd::MandelGenerator* generator;
  13. Gradient gradient;
  14. std::string path;
  15. };
  16. struct ImageExportException :
  17. std::runtime_error
  18. {
  19. ImageExportException(const std::string& err);
  20. };
  21. /**
  22. * \brief generates and saves a fractal image in png format.
  23. *
  24. * \param iei info to generate the image
  25. * \param progressCallback optional function that is called to
  26. * report progress; the float parameter
  27. * contains a value from 0 to 100
  28. */
  29. void exportPng(const ImageExportInfo& iei,
  30. std::function<void(float)> progressCallback = [](float){});
  31. }
  32. #endif // LIBALMOND_IMAGEEXPORT_H