87#include "ramCanvas.hpp"
90std::vector<std::array<double, 14>> params {
92 { -2.00000, -0.33000, 0.01000, -1.0, -1.0, 1.0, 0.0, 0.0, 4.0e7, 1.0, -18.0, 17.0, -18.0, 17.0},
93 { 0.40000, 1.10000, 0.00000, -1.0, -1.0, 1.0, 0.0, 0.0, 2.5e7, 1.0, -7.0, 7.0, -7.0, 7.0},
94 { -3.14000, 0.20000, 0.30000, -1.0, -1.0, 1.0, 0.0, 0.0, 3.0e7, 1.0, -40.0, 40.0, -40.0, 40.0},
95 { -3.14000, 0.19000, 0.32000, 1.0, -1.0, 1.0, 0.0, 0.0, 1.0e7, 1.0, -38.0, 35.0, -38.0, 35.0},
96 { -2.14000, -0.20000, 0.30000, 1.0, 1.0, 1.0, 0.0, 0.0, 3.0e7, 0.5, -9.0, 7.0, -9.0, 7.0},
97 { 0.40000, 1.00000, 0.00000, -1.0, -1.0, 0.0, 1.0, 0.0, 2.0e6, 1.0, -70.0, 70.0, -70.0, 70.0},
98 { -3.14000, 0.20000, 0.30000, -1.0, -1.0, 0.0, 1.0, 0.0, 6.0e7, 1.0, -45.0, 45.0, -45.0, 45.0},
99 { -3.14000, 0.20000, 0.30000, 1.0, -1.0, 0.0, 1.0, 0.0, 1.0e7, 1.0, -35.0, 35.0, -35.0, 35.0},
100 { -2.00000, -0.33000, 0.01000, -1.0, -1.0, 1.0, 0.0, 1.0, 4.0e7, 1.0, -25.0, 25.0, -25.0, 25.0},
101 { -3.14000, 0.20000, 0.30000, -1.0, -1.0, 1.0, 0.0, 1.0, 4.0e7, 1.0, -60.0, 60.0, -60.0, 60.0},
102 { -3.14000, 0.20000, 0.30000, 1.0, -1.0, 1.0, 0.0, 1.0, 6.0e7, 1.0, -90.0, 90.0, -90.0, 90.0},
103 { -3.14000, 0.20000, 0.30000, -1.0, -1.0, 0.0, 0.0, 1.0, 2.0e7, 1.0, -17.0, 15.0, -17.0, 15.0},
104 { -3.14000, 0.20000, 0.30000, 1.0, -1.0, 0.0, 0.0, 1.0, 3.0e7, 1.0, -17.0, 14.0, -17.0, 14.0},
105 { -3.14000, 0.20000, 0.30000, 1.0, -1.0, 0.0, 0.0, 1.0, 1.0e7, 1.0, -17.0, 14.0, -17.0, 14.0},
106 { -1.14000, 0.01000, 0.05000, 1.0, -1.0, 0.0, 0.0, 1.0, 5.0e6, 1.0, -3.5, 2.5, -3.5, 2.5},
107 { -1.14000, 0.10000, 0.50000, 1.0, -1.0, 0.0, 0.0, 1.0, 6.0e7, 1.0, -17.0, 14.0, -17.0, 14.0},
112 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
113 const int BSIZ = 480*8;
114 mjr::ramCanvas1c16b::colorType aColor;
117 for(
decltype(params.size()) j=0; j<params.size(); ++j) {
118 mjr::ramCanvas1c16b theRamCanvas(BSIZ, BSIZ, params[j][10], params[j][11], params[j][12], params[j][13]);
120 double a = params[j][0];
121 double b = params[j][1];
122 double c = params[j][2];
123 double d = params[j][3];
124 double s = params[j][4];
125 double k = params[j][9];
127 double f = params[j][5];
128 double g = params[j][6];
129 double h = params[j][7];
137 uint64_t maxItr =
static_cast<uint64_t
>(params[j][8]);
138 uint64_t iPrt = maxItr / 5;
139 for(uint64_t i=1;i<maxItr;i++) {
140 double xNew = y+d*(x<0.0?s:1.0)* (f*std::sqrt(std::abs(b*x-c)) + g*std::sin(b*x-c) + h*std::abs(b*x-c));
142 if ( !theRamCanvas.isCliped(x, y)) {
144 theRamCanvas.drawPoint(x, y, theRamCanvas.getPxColor(x, y).tfrmAdd(aColor));
145 if(theRamCanvas.getPxColor(x, y).getC0() > maxII) {
146 maxII = theRamCanvas.getPxColor(x, y).getC0();
148 std::cout <<
"ITER(" << j <<
"): " << i <<
" MAXS: " << maxII <<
" EXIT: Maximum image intensity reached" << std::endl;
154 std::cout <<
"ITER(" << j <<
"): " << i <<
" MAXS: " << maxII <<
" INC: " << inCnt << std::endl;
158 std::cout <<
"ITER(" << j <<
"): " <<
"DONE" <<
" MAXS: " << maxII <<
" INC: " << inCnt << std::endl;
161 theRamCanvas.applyHomoPixTfrm(&mjr::ramCanvas1c16b::colorType::tfrmLn1);
162 maxII =
static_cast<uint64_t
>(std::log(
static_cast<double>(maxII)));
165 mjr::ramCanvas3c8b anotherRamCanvas(BSIZ, BSIZ);
166 typedef mjr::ramCanvas3c8b::colorType::csCCfractal0RYBCW cs_t;
167 for(
int yi=0;yi<theRamCanvas.getNumPixY();yi++)
168 for(
int xi=0;xi<theRamCanvas.getNumPixX();xi++)
169 anotherRamCanvas.drawPoint(xi, yi, cs_t::c(k * theRamCanvas.getPxColor(xi, yi).getC0() /
static_cast<mjr::ramCanvas3c8b::csFltType
>(maxII)));
171 anotherRamCanvas.writeTIFFfile(
"barrymartin_" + mjr::math::str::fmt_int(j, 2,
'0') +
".tiff");
173 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
174 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])