53#include "ramCanvas.hpp"
56typedef mjr::ramCanvas1c16b rcct;
57typedef mjr::ramCanvas3c8b rcrt;
61 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
62 const int csize = 7680/6;
63 const int maxitr = 256*4;
64 const int resMul = 16;
65 const int sweepYres = csize*resMul;
66 const double sweepYmin = -4.0;
67 const double sweepYmax = 4.0;
68 const double sweepYdel = (sweepYmax-sweepYmin)/sweepYres;
69 const std::vector<double> sweepXminL { -4.0, -4.0, -4.0};
70 const std::vector<double> sweepXmaxL { 0.0, 4.0, 4.0};
71 const std::vector<int> sweepXresL { 1, 2, 1};
72 const std::vector<std::string> caseNamesL {
"neg",
"all",
"pos"};
74 for(
int side=0; side<3; side++) {
75 int sweepXres = csize*resMul*sweepXresL[side];
76 double sweepXmin = sweepXminL[side];
77 double sweepXmax = sweepXmaxL[side];
78 double sweepXdel = (sweepXmax-sweepXmin)/sweepXres;;
80 rcct ihstRamCanvas(csize, csize, -0.6, 1.0, -0.9, 0.9);
81 rcct ohstRamCanvas(csize, csize, -0.6, 1.0, -0.9, 0.9);
82 rcct omaxRamCanvas(csize, csize, -0.6, 1.0, -0.9, 0.9);
83 std::complex<double>* theOrbit =
new std::complex<rcct::coordFltType>[maxitr+1];
85 for(
int y=0;y<sweepYres;y++) {
86 if((y%(sweepYres/16))==0)
87 std::cout <<
"LINE: " << y <<
"/" << sweepYres << std::endl;
88 for(
int x=0;x<sweepXres;x++) {
89 std::complex<rcct::coordFltType> c(x * sweepXdel + sweepXmin, y * sweepYdel + sweepYmin);
90 std::complex<rcct::coordFltType> z(0.5, 0.0);
91 for(rcct::colorChanType count=0; ; count++) {
92 z = (c + 1.0) * z * (1.0 - z);
95 for(rcct::colorChanType i=10; i<=count; i++) {
96 ohstRamCanvas.incPxChan(theOrbit[i]);
97 omaxRamCanvas.tformPixel(theOrbit[i], [i](
auto& c) { c.tfrmMax(i); });
100 }
else if(count>=(maxitr-1)) {
101 for(rcct::colorChanType i=10; i<=count; i++) {
102 ihstRamCanvas.incPxChan(theOrbit[i]);
111 omaxRamCanvas.autoHistStrech();
112 omaxRamCanvas.rotate90CCW();
113 omaxRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_omax.tiff");
114 ohstRamCanvas.autoHistStrech();
115 ohstRamCanvas.rotate90CCW();
116 ohstRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_ohst.tiff");
117 ihstRamCanvas.autoHistStrech();
118 ihstRamCanvas.rotate90CCW();
119 ihstRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_ihst.tiff");
122 rcrt theRamCanvas(omaxRamCanvas.getNumPixX(), omaxRamCanvas.getNumPixY());
124 theRamCanvas.colorizeIntCanvas([&omaxRamCanvas, &ohstRamCanvas, &ihstRamCanvas](
auto x,
auto y) {
return rcrt::colorType(
static_cast<rcrt::colorChanType
>(omaxRamCanvas.getPxColor(x, y).tfrmPow(0.8).getChan(0)/256),
125 static_cast<rcrt::colorChanType
>(ohstRamCanvas.getPxColor(x, y).tfrmPow(0.3).getChan(0)/256),
126 static_cast<rcrt::colorChanType
>(ihstRamCanvas.getPxColor(x, y).tfrmPow(0.8).getChan(0)/256)); });
127 theRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_color_838.tiff");
129 theRamCanvas.colorizeIntCanvas([&omaxRamCanvas, &ohstRamCanvas, &ihstRamCanvas](
auto x,
auto y) {
return rcrt::colorType(
static_cast<rcrt::colorChanType
>(0),
130 static_cast<rcrt::colorChanType
>(ohstRamCanvas.getPxColor(x, y).tfrmPow(0.3).getChan(0)/256),
131 static_cast<rcrt::colorChanType
>(ihstRamCanvas.getPxColor(x, y).tfrmPow(0.8).getChan(0)/256)); });
132 theRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_color__Z38.tiff");
134 theRamCanvas.colorizeIntCanvas([&ohstRamCanvas](
auto x,
auto y) {
return rcrt::colorType::csCCfractal0RYBCW::c(ohstRamCanvas.getPxColor(x, y).tfrmPow(0.3).getChan_dbl(0)); });
135 theRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_ohst_3csCCfractal0RYBCW.tiff");
137 theRamCanvas.colorizeIntCanvas([&ohstRamCanvas](
auto x,
auto y) {
return rcrt::colorType::csCCdivBWR::c(ohstRamCanvas.getPxColor(x, y).tfrmPow(0.3).getChan_dbl(0)); });
138 theRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_ohst_3csCCdivBWR.tiff");
140 theRamCanvas.colorizeIntCanvas([&ohstRamCanvas](
auto x,
auto y) {
return rcrt::colorType::csCCdivBWR::c(ohstRamCanvas.getPxColor(x, y).tfrmPow(0.5).getChan_dbl(0)); });
141 theRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_ohst_5csCCdivBWR.tiff");
143 theRamCanvas.colorizeIntCanvas([&ohstRamCanvas](
auto x,
auto y) {
return rcrt::colorType::csPLYinferno::c(ohstRamCanvas.getPxColor(x, y).tfrmPow(0.5).getChan_dbl(0)); });
144 theRamCanvas.writeTIFFfile(
"mandeldragon_orbits_" + caseNamesL[side] +
"_ohst_csPLYinferno.tiff");
147 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
148 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])