34#include "ramCanvas.hpp"
37typedef mjr::ramCanvas3c8b::colorType ct;
38typedef ct::csIntType cit;
42 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
43 const int NUMITR = 2000;
44 const int CSIZE = 7680;
47 std::complex<double> oneone(1,1), z;
49 mjr::ramCanvas3c8b theRamCanvasA(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
50 mjr::ramCanvas3c8b theRamCanvasB(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
51 mjr::ramCanvas3c8b theRamCanvasC(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
52 mjr::ramCanvas3c8b theRamCanvasD(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
53 mjr::ramCanvas3c8b theRamCanvasE(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
54 mjr::ramCanvas3c8b theRamCanvasF(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
55 mjr::ramCanvas3c8b theRamCanvasG(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
56 mjr::ramCanvas3c8b theRamCanvasH(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
57 mjr::ramCanvas3c8b theRamCanvasI(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
58 mjr::ramCanvas3c8b theRamCanvasJ(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
59 mjr::ramCanvas3c8b theRamCanvasK(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
60 mjr::ramCanvas3c8b theRamCanvasL(CSIZE, CSIZE, 0.2, 1.2, 0.2, 1.2);
62 for(
int y=0;y<theRamCanvasA.getNumPixY();y++) {
64 std::cout <<
" LINE: " << y <<
"/" << CSIZE << std::endl;
65 for(
int x=0;x<theRamCanvasA.getNumPixX();x++) {
66 for(z=std::complex<double>(theRamCanvasA.int2realX(x),theRamCanvasA.int2realY(y)),count=0;
67 ((std::abs(std::real(z))<LIM)||(std::abs(std::imag(z))<LIM))&&(count<=NUMITR);
68 count++,z=
static_cast<std::complex<double>
>(std::pow(z, 5))+oneone) ;
71 theRamCanvasA.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(count*500)));
73 theRamCanvasB.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(std::norm(z)/1000)));
75 theRamCanvasC.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(std::abs(std::imag(z)))));
77 theRamCanvasD.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(std::abs(std::real(z)))));
79 if(std::abs(std::real(z))<std::abs(std::imag(z)))
80 theRamCanvasE.drawPoint(x, y,
"red");
82 theRamCanvasE.drawPoint(x, y,
"blue");
84 if(std::abs(std::real(z))<std::abs(std::imag(z)))
85 theRamCanvasF.drawPoint(x, y, ct::csCCu0R::c(
static_cast<cit
>(std::abs(std::real(z)))));
87 theRamCanvasF.drawPoint(x, y, ct::csCCu0B::c(
static_cast<cit
>(std::abs(std::imag(z)))));
89 if(std::abs(std::real(z))<std::abs(std::imag(z)))
90 theRamCanvasG.drawPoint(x, y, ct::csCCu0R::c(
static_cast<cit
>(std::norm(z)/1000)));
92 theRamCanvasG.drawPoint(x, y, ct::csCCu0B::c(
static_cast<cit
>(std::norm(z)/1000)));
94 if(std::real(z) < 0) {
95 if(std::imag(z) < 0) {
96 theRamCanvasH.drawPoint(x, y, ct::csCCu0R::c(
static_cast<cit
>(std::abs(std::real(z)))));
98 theRamCanvasH.drawPoint(x, y, ct::csCCu0B::c(
static_cast<cit
>(std::abs(std::real(z)))));
101 if(std::imag(z) < 0) {
102 theRamCanvasH.drawPoint(x, y, ct::csCCu0M::c(
static_cast<cit
>(std::abs(std::real(z)))));
104 theRamCanvasH.drawPoint(x, y, ct::csCCu0C::c(
static_cast<cit
>(std::abs(std::real(z)))));
108 if(std::real(z) < 0) {
109 if(std::imag(z) < 0) {
110 if(std::imag(z) < std::real(z) ) {
111 theRamCanvasI.drawPoint(x, y,
"red");
113 theRamCanvasI.drawPoint(x, y,
"yellow");
116 theRamCanvasI.drawPoint(x, y,
"blue");
119 if(std::imag(z) < 0) {
120 theRamCanvasI.drawPoint(x, y,
"magenta");
122 if(std::imag(z) < std::real(z) ) {
123 theRamCanvasI.drawPoint(x, y,
"cyan");
125 theRamCanvasI.drawPoint(x, y,
"green");
130 if(std::real(z) < 0) {
131 if(std::imag(z) < 0) {
132 if(std::imag(z) < std::real(z) ) {
133 theRamCanvasJ.drawPoint(x, y, ct::csCCu0R::c(
static_cast<cit
>(std::abs(std::real(z)))));
135 theRamCanvasJ.drawPoint(x, y, ct::csCCu0Y::c(
static_cast<cit
>(std::abs(std::real(z)))));
138 theRamCanvasJ.drawPoint(x, y, ct::csCCu0B::c(
static_cast<cit
>(std::abs(std::real(z)))));
141 if(std::imag(z) < 0) {
142 theRamCanvasJ.drawPoint(x, y, ct::csCCu0M::c(
static_cast<cit
>(std::abs(std::real(z)))));
144 if(std::imag(z) < std::real(z) ) {
145 theRamCanvasJ.drawPoint(x, y, ct::csCCu0C::c(
static_cast<cit
>(std::abs(std::real(z)))));
147 theRamCanvasJ.drawPoint(x, y, ct::csCCu0G::c(
static_cast<cit
>(std::abs(std::real(z)))));
152 theRamCanvasK.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>((std::arg(z)+3.14)*255)));
154 if(std::abs(std::real(z))<std::abs(std::imag(z)))
155 theRamCanvasL.drawPoint(x, y, ct::csCCu0R::c(mjr::math::ivl::clamp(
static_cast<cit
>(std::abs(std::real(z))/100), 255)));
157 theRamCanvasL.drawPoint(x, y, ct::csCCu0B::c(mjr::math::ivl::clamp(
static_cast<cit
>(std::abs(std::imag(z))/100), 255)));
161 theRamCanvasA.writeTIFFfile(
"biomorph1A.tiff");
162 theRamCanvasB.writeTIFFfile(
"biomorph1B.tiff");
163 theRamCanvasC.writeTIFFfile(
"biomorph1C.tiff");
164 theRamCanvasD.writeTIFFfile(
"biomorph1D.tiff");
165 theRamCanvasE.writeTIFFfile(
"biomorph1E.tiff");
166 theRamCanvasF.writeTIFFfile(
"biomorph1F.tiff");
167 theRamCanvasG.writeTIFFfile(
"biomorph1G.tiff");
168 theRamCanvasH.writeTIFFfile(
"biomorph1H.tiff");
169 theRamCanvasI.writeTIFFfile(
"biomorph1I.tiff");
170 theRamCanvasJ.writeTIFFfile(
"biomorph1J.tiff");
171 theRamCanvasK.writeTIFFfile(
"biomorph1K.tiff");
172 theRamCanvasL.writeTIFFfile(
"biomorph1L.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[])