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