35#include "ramCanvas.hpp"
39 const int BSIZ = 480*8;
41 std::random_device rd;
42 std::mt19937 rEng(rd());
43 std::uniform_real_distribution<double> uniform_dist_double(-2.0, 2.0);
45 mjr::ramCanvas1c16b theRamCanvas(BSIZ, BSIZ, -2, 2, -2, 2);
46 mjr::ramCanvas1c16b::colorType aColor;
49 for(
int j=0; j<1000; j++) {
50 std::map<uint64_t, uint64_t> ptcnt;
51 double a = uniform_dist_double(rEng);
52 double b = uniform_dist_double(rEng);
53 double c = uniform_dist_double(rEng);
54 double d = uniform_dist_double(rEng);
64 for(itr=1;itr<10000000;itr++) {
65 double xNew = x*x-y*y+a*x+b*y;
66 double yNew = 2*x*y+c*x+d*y;
67 if (xNew > xMax) xMax = xNew;
68 if (xNew < xMin) xMin = xNew;
69 if (yNew > yMax) yMax = yNew;
70 if (yNew < yMin) yMin = yNew;
71 if ( !theRamCanvas.isCliped(x, y)) {
73 theRamCanvas.drawPoint(x, y, theRamCanvas.getPxColor(x, y).tfrmAdd(aColor));
74 if(theRamCanvas.getPxColor(x, y).getC0() > maxII) {
75 maxII = theRamCanvas.getPxColor(x, y).getC0();
84 if ( (inCnt > 1000000) && (xMin < xMax) && (yMin < yMax) ) {
85 mjr::ramCanvas1c16b::coordIntType uCnt = theRamCanvas.statNumNonZeroPixels();
87 std::cout <<
" { " << a <<
", " << b <<
", " << c <<
", " << d <<
", " << 0.1 <<
", " << 0.1 <<
", " <<
"1e8, " << xMin <<
", " << xMax <<
", " << yMin <<
", " << yMax <<
" }, // " <<
" INC: " << inCnt <<
" UNQ: " << uCnt << std::endl;
int main(int argc, char *argv[])