40#include "ramCanvas.hpp"
44 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
45 std::cout <<
"apomorph start" << std::endl;
46 const int CSIZE = 2160;
47 const int ITRTOSS = 1000;
48 const long NUMITR = 400000000;
50 mjr::ramCanvas3c8b theRamCanvas(CSIZE, CSIZE, -4.0, 4.0, -4.0, 4.0);
51 theRamCanvas.setDrawMode(mjr::ramCanvas3c8b::drawModeType::ADDCLAMP);
53 mjr::ramCanvas3c8b::colorType aColor[] = { mjr::ramCanvas3c8b::colorType(1, 0, 0), mjr::ramCanvas3c8b::colorType(0, 1, 0), mjr::ramCanvas3c8b::colorType(0, 0, 1) };
55 std::random_device rd;
56 std::minstd_rand0 rEng(rd());
58 const double s = 1.73205080757;
60 const std::complex<double> si(0.0, s);
61 const std::complex<double> c1 = (1.0+s)/(2.0+s);
62 const std::complex<double> c2 = 0.5*(si-1.0);
63 const std::complex<double> c3 = -0.5*(si+1.0);
64 const std::complex<double> c4 = 1.0+s;
65 for(
int frame=1; frame<401; frame++) {
66 theRamCanvas.clrCanvasToBlack();
67 std::complex<double> c5(3.0, (frame-1)*0.0025);
68 std::cout <<
"apomorph frame: " << frame <<
" " << (frame-1)*0.0025 << std::endl;
69 std::complex<double> z(0.1, 0.2);
70 for (
long n=0;n<NUMITR;n++) {
71 std::complex<double> zNxt;
72 if ((n % (NUMITR/100)) == 0) {
73 if ((n % (NUMITR/10)) == 0)
74 std::cout <<
"|" << std::flush;
76 std::cout <<
"." << std::flush;
78 std::complex<double> f = c5/(c4-z)-c1;
79 std::minstd_rand0::result_type rn = rEng()%3;
90 theRamCanvas.drawPoint(z, aColor[rn]);
92 std::cout <<
"|" << std::endl;
93 std::cout <<
"apomorph dump" << std::endl;
94 theRamCanvas.applyHomoPixTfrm(&mjr::ramCanvas3c8b::colorType::tfrmStdPow, 1/5.0);
96 theRamCanvas.writeTIFFfile(
"apomorph_" + mjr::math::str::fmt_int(frame, 3,
'0') +
".tiff");
97 std::cout <<
"apomorph finish" << std::endl;
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[])