1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #ifndef MANDELVIDEOGENERATOR_H
- #define MANDELVIDEOGENERATOR_H
- #include "MandelUtil.h"
- #include "Gradient.h"
- #include "Bitmap.h"
- #include <functional>
- struct ExportVideoInfo
- {
- mnd::MandelViewport start;
- mnd::MandelViewport end;
- Gradient gradient;
- int width;
- int height;
- int maxIterations;
- int fps;
- double zoomSpeed;
- std::string path;
- /// bitrate in kbps
- int bitrate;
- std::string preset;
- };
- struct MandelVideoProgressInfo
- {
- int framesExported;
- };
- class MandelVideoGenerator
- {
- public:
- using ProgressCallback = std::function<void(const MandelVideoProgressInfo&)>;
- private:
- const ExportVideoInfo evi;
- std::vector<ProgressCallback> progressCallbacks;
- public:
- MandelVideoGenerator(const ExportVideoInfo& evi);
- void generate(void);
- void addProgressCallback(ProgressCallback pc);
- private:
- void callCallbacks(const MandelVideoProgressInfo& evi);
- Bitmap<RGBColor> overlay(const Bitmap<RGBColor>& outer,
- const Bitmap<RGBColor>& inner,
- double scale);
- };
- #endif // MANDELVIDEOGENERATOR_H
|