35#include "ramCanvas.hpp"
36#include "MRMathSTR.hpp"
39typedef mjr::ramCanvas3c8b::colorType ct;
40typedef ct::csIntType cit;
44 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
46 const int NUMFRM = 24*4;
47 const int IMXSIZ = 7680/4;
48 const int IMYSIZ = 7680/4;
51 mjr::ramCanvas3c8b theRamCanvas(IMXSIZ, IMYSIZ, -2.75, 2.75, -2.75, 2.75);
52 for(
int frame=0; frame<NUMFRM; frame++) {
53 std::cout <<
"Frame: " << frame << std::endl;
54 double angle = frame*std::numbers::pi*2/NUMFRM;
55 theRamCanvas.clrCanvasToBlack();
56 for(
int y=0;y<theRamCanvas.getNumPixY();y++) {
57 for(
int x=0;x<theRamCanvas.getNumPixX();x++) {
58 std::complex<double> c(std::cos(angle), std::sin(angle));
59 std::complex<double> z = theRamCanvas.int2real(x, y);
60 std::complex<double> zL(0.0, 0.0);
62 while( ((std::abs(std::real(z))<LIM) || (std::abs(std::imag(z))<LIM)) && (count<NUMITR) ) {
64 z=std::sin(z) + std::pow(z, 2) + c;
68 if(std::abs(std::real(zL)) < LIM)
69 theRamCanvas.drawPoint(x, y, ct::csCCu0W::c(std::abs(std::real(zL))/LIM));
70 else if(std::abs(std::imag(zL)) < LIM)
71 theRamCanvas.drawPoint(x, y, ct::csCCu0W::c(1.0-std::abs(std::imag(zL))/LIM));
73 if(std::abs(std::real(zL)) < LIM)
74 theRamCanvas.drawPoint(x, y, ct::csCCu0Y::c(std::abs(std::real(zL))/LIM));
75 else if(std::abs(std::imag(zL)) < LIM)
76 theRamCanvas.drawPoint(x, y, ct::csCCu0Y::c(1.0-std::abs(std::imag(zL))/LIM));
80 theRamCanvas.writeTIFFfile(
"biomorphMorph_" + mjr::math::str::fmt_int(frame, 3,
'0') +
".tiff");
82 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
83 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])