MandelVideoGenerator.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef MANDELVIDEOGENERATOR_H
  2. #define MANDELVIDEOGENERATOR_H
  3. #include "Mandel.h"
  4. #include "Gradient.h"
  5. #include "Bitmap.h"
  6. #include <functional>
  7. struct ExportVideoInfo
  8. {
  9. mnd::MandelViewport start;
  10. mnd::MandelViewport end;
  11. Gradient gradient;
  12. int width;
  13. int height;
  14. int maxIterations;
  15. int fps;
  16. double zoomSpeed;
  17. std::string path;
  18. /// bitrate in kbps
  19. int bitrate;
  20. std::string preset;
  21. };
  22. struct MandelVideoProgressInfo
  23. {
  24. int framesExported;
  25. };
  26. class MandelVideoGenerator
  27. {
  28. public:
  29. using ProgressCallback = std::function<void(const MandelVideoProgressInfo&)>;
  30. private:
  31. const ExportVideoInfo evi;
  32. std::vector<ProgressCallback> progressCallbacks;
  33. public:
  34. MandelVideoGenerator(const ExportVideoInfo& evi);
  35. void generate(mnd::MandelGenerator& gen);
  36. void addProgressCallback(ProgressCallback pc);
  37. private:
  38. void callCallbacks(const MandelVideoProgressInfo& evi);
  39. Bitmap<RGBColor> overlay(const Bitmap<RGBColor>& outer,
  40. const Bitmap<RGBColor>& inner,
  41. long bw, long bh,
  42. double scale, double oversizeFactor);
  43. };
  44. #endif // MANDELVIDEOGENERATOR_H