54#include "ramCanvas.hpp"
55#include "MRMathSTR.hpp"
58typedef mjr::ramCanvas3c8b::colorType ct;
59typedef ct::csIntType cit;
63 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
64 const int NUMITR = 255;
65 const int NUMFRM = 24*16;
67 const int IMXSIZ = 7680/2;
68 const int IMYSIZ = 7680/2;
69 const int MAXZSQ = 10;
70 const double ANGMIN = 0.0;
71 const double ANGMAX = std::numbers::pi*2;
75 for(
int frame=0; frame<NUMFRM; frame++) {
76 mjr::ramCanvas3c8b theRamCanvas(IMXSIZ, IMYSIZ, -1.5, 1.5, -1.5, 1.5);
78 theRamCanvas.clrCanvasToBlack();
79 std::cout <<
"Frame: " << frame <<
" of " << NUMFRM << std::endl;
80 double angle = frame*(ANGMAX-ANGMIN)/NUMFRM+ANGMIN;
81 std::complex<double> a(std::cos(angle), std::sin(angle));
82# pragma omp parallel for schedule(static,1)
83 for(
int y=0;y<theRamCanvas.getNumPixY();y++) {
84 for(
int x=0;x<theRamCanvas.getNumPixX();x++) {
85 std::complex<double> c(theRamCanvas.int2realX(x), theRamCanvas.int2realY(y));
86 std::complex<double> z(0.0, 0.0);
88 while((std::norm(z)<MAXZSQ) && (count<=NUMITR)) {
89 z = std::pow(z, 5) + a * z + c;
93 theRamCanvas.drawPoint(x, y, ct::csCColdeFireRamp::c(
static_cast<ct::csIntType
>(count*20)));
96 theRamCanvas.scaleDownMean(8);
97 theRamCanvas.writeTIFFfile(
"mandelbrot_wave_" + mjr::math::str::fmt_int(frame, 3,
'0') +
".tiff");
99 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
100 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])