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