34#include "ramCanvas.hpp"
35#include "MRMathIVL.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();
44 const int NUMITR = 2000;
45 const int CSIZE = 7680;
48 std::complex<double> oneone(1,1), z;
50 mjr::ramCanvas3c8b theRamCanvasA(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
51 mjr::ramCanvas3c8b theRamCanvasB(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
52 mjr::ramCanvas3c8b theRamCanvasC(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
53 mjr::ramCanvas3c8b theRamCanvasD(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
54 mjr::ramCanvas3c8b theRamCanvasE(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
55 mjr::ramCanvas3c8b theRamCanvasF(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
56 mjr::ramCanvas3c8b theRamCanvasG(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
57 mjr::ramCanvas3c8b theRamCanvasH(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
58 mjr::ramCanvas3c8b theRamCanvasI(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
59 mjr::ramCanvas3c8b theRamCanvasJ(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
60 mjr::ramCanvas3c8b theRamCanvasK(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
61 mjr::ramCanvas3c8b theRamCanvasL(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
63 for(
int y=0;y<theRamCanvasA.getNumPixY();y++) {
65 std::cout <<
" LINE: " << y <<
"/" << CSIZE << std::endl;
66 for(
int x=0;x<theRamCanvasA.getNumPixX();x++) {
67 for(z=std::complex<double>(theRamCanvasA.int2realX(x),theRamCanvasA.int2realY(y)),count=0;
68 ((std::abs(std::real(z))<LIM)||(std::abs(std::imag(z))<LIM))&&(count<=NUMITR);
69 count++,z=
static_cast<std::complex<double>
>(std::pow(z, 5))+oneone) ;
72 theRamCanvasA.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(count*500)));
74 theRamCanvasB.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(std::norm(z)/1000)));
76 theRamCanvasC.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(std::abs(std::imag(z)))));
78 theRamCanvasD.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(std::abs(std::real(z)))));
80 if(std::abs(std::real(z))<std::abs(std::imag(z)))
81 theRamCanvasE.drawPoint(x, y,
"red");
83 theRamCanvasE.drawPoint(x, y,
"blue");
85 if(std::abs(std::real(z))<std::abs(std::imag(z)))
86 theRamCanvasF.drawPoint(x, y, ct::csCCu0R::c(
static_cast<cit
>(std::abs(std::real(z)))));
88 theRamCanvasF.drawPoint(x, y, ct::csCCu0B::c(
static_cast<cit
>(std::abs(std::imag(z)))));
90 if(std::abs(std::real(z))<std::abs(std::imag(z)))
91 theRamCanvasG.drawPoint(x, y, ct::csCCu0R::c(
static_cast<cit
>(std::norm(z)/1000)));
93 theRamCanvasG.drawPoint(x, y, ct::csCCu0B::c(
static_cast<cit
>(std::norm(z)/1000)));
95 if(std::real(z) < 0) {
96 if(std::imag(z) < 0) {
97 theRamCanvasH.drawPoint(x, y, ct::csCCu0R::c(
static_cast<cit
>(std::abs(std::real(z)))));
99 theRamCanvasH.drawPoint(x, y, ct::csCCu0B::c(
static_cast<cit
>(std::abs(std::real(z)))));
102 if(std::imag(z) < 0) {
103 theRamCanvasH.drawPoint(x, y, ct::csCCu0M::c(
static_cast<cit
>(std::abs(std::real(z)))));
105 theRamCanvasH.drawPoint(x, y, ct::csCCu0C::c(
static_cast<cit
>(std::abs(std::real(z)))));
109 if(std::real(z) < 0) {
110 if(std::imag(z) < 0) {
111 if(std::imag(z) < std::real(z) ) {
112 theRamCanvasI.drawPoint(x, y,
"red");
114 theRamCanvasI.drawPoint(x, y,
"yellow");
117 theRamCanvasI.drawPoint(x, y,
"blue");
120 if(std::imag(z) < 0) {
121 theRamCanvasI.drawPoint(x, y,
"magenta");
123 if(std::imag(z) < std::real(z) ) {
124 theRamCanvasI.drawPoint(x, y,
"cyan");
126 theRamCanvasI.drawPoint(x, y,
"green");
131 if(std::real(z) < 0) {
132 if(std::imag(z) < 0) {
133 if(std::imag(z) < std::real(z) ) {
134 theRamCanvasJ.drawPoint(x, y, ct::csCCu0R::c(
static_cast<cit
>(std::abs(std::real(z)))));
136 theRamCanvasJ.drawPoint(x, y, ct::csCCu0Y::c(
static_cast<cit
>(std::abs(std::real(z)))));
139 theRamCanvasJ.drawPoint(x, y, ct::csCCu0B::c(
static_cast<cit
>(std::abs(std::real(z)))));
142 if(std::imag(z) < 0) {
143 theRamCanvasJ.drawPoint(x, y, ct::csCCu0M::c(
static_cast<cit
>(std::abs(std::real(z)))));
145 if(std::imag(z) < std::real(z) ) {
146 theRamCanvasJ.drawPoint(x, y, ct::csCCu0C::c(
static_cast<cit
>(std::abs(std::real(z)))));
148 theRamCanvasJ.drawPoint(x, y, ct::csCCu0G::c(
static_cast<cit
>(std::abs(std::real(z)))));
153 theRamCanvasK.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>((std::arg(z)+3.14)*255)));
155 if(std::abs(std::real(z))<std::abs(std::imag(z)))
156 theRamCanvasL.drawPoint(x, y, ct::csCCu0R::c(mjr::math::ivl::clamp(
static_cast<cit
>(std::abs(std::real(z))/100), 255)));
158 theRamCanvasL.drawPoint(x, y, ct::csCCu0B::c(mjr::math::ivl::clamp(
static_cast<cit
>(std::abs(std::imag(z))/100), 255)));
162 theRamCanvasA.writeTIFFfile(
"biomorph1A.tiff");
163 theRamCanvasB.writeTIFFfile(
"biomorph1B.tiff");
164 theRamCanvasC.writeTIFFfile(
"biomorph1C.tiff");
165 theRamCanvasD.writeTIFFfile(
"biomorph1D.tiff");
166 theRamCanvasE.writeTIFFfile(
"biomorph1E.tiff");
167 theRamCanvasF.writeTIFFfile(
"biomorph1F.tiff");
168 theRamCanvasG.writeTIFFfile(
"biomorph1G.tiff");
169 theRamCanvasH.writeTIFFfile(
"biomorph1H.tiff");
170 theRamCanvasI.writeTIFFfile(
"biomorph1I.tiff");
171 theRamCanvasJ.writeTIFFfile(
"biomorph1J.tiff");
172 theRamCanvasK.writeTIFFfile(
"biomorph1K.tiff");
173 theRamCanvasL.writeTIFFfile(
"biomorph1L.tiff");
174 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
175 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])