diff --git a/CImg.h b/CImg.h index 2ffd58d0..ab274eac 100644 --- a/CImg.h +++ b/CImg.h @@ -52459,37 +52459,29 @@ namespace cimg_library { // Square step. for (int y0 = 0; y0M?M:val); + const int x2 = x0 + delta2, y2 = y0 + delta2; + if (containsXYZC(x2,y2)) { + const int x1 = (x0 + delta)%w, y1 = (y0 + delta)%h; + const Tfloat val = (Tfloat)(0.25f*(ref(x0,y0) + ref(x1,y0) + ref(x1,y1) + ref(x0,y1)) + + r*cimg::rand(-1,1,&rng)); + ref(x2,y2) = (T)(valM?M:val); + } } // Diamond steps. - for (int y = -delta2; yM?M:val); - } - for (int y0 = 0; y0M?M:val); - } - for (int y = -delta2; yM?M:val); + bool is_odd_y = false; + for (int y0 = 0; y0M?M:val); + } } + is_odd_y = !is_odd_y; + } } } cimg::srand(rng);