50#include "ramCanvas.hpp"
54 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
55 mjr::ramCanvas1c16b theRamCanvas(7680, 7680, -2.2, 0.8, -1.5, 1.5);
57 const int NUMITR = mjr::ramCanvas1c16b::colorType::maxChanVal;
59 mjr::ramCanvas1c16b::coordFltType cr, ci;
60 std::complex<mjr::ramCanvas1c16b::coordFltType> c, z, zero(0.0, 0.0);
61 for(
int y=0;y<theRamCanvas.getNumPixY();y++) {
62 for(
int x=0;x<theRamCanvas.getNumPixX();x++) {
63 cr = theRamCanvas.int2realX(x);
64 ci = theRamCanvas.int2realY(y);
65 c = std::complex<mjr::ramCanvas1c16b::coordFltType>(cr, ci);
66 mjr::ramCanvas1c16b::coordFltType p = abs(c-0.25);
67 if((cr >= p-2.0*p*p+0.25) && abs(c+1.0) >= 0.25) {
68 for(z=zero,count=0; (std::norm(z)<4)&&(count<NUMITR); count++,z=z*z+c)
71 theRamCanvas.drawPoint(x, y,
static_cast<mjr::ramCanvas1c16b::colorChanType
>(count));
75 theRamCanvas.autoHistStrech();
76 theRamCanvas.writeTIFFfile(
"mandelbrot_grayscale.tiff");
77 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
78 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])