42 const int alignedWidth = (img_width / packetSize) * packetSize;
45 const double yradius = xradius * img_height / img_width;
49 Vector2 step(2 *
widget->
xradius / img_width, 2 * yradius / img_height);
52 for (
int y =
id;
y < img_height;
y += threadcount) {
53 int pix =
y * img_width;
59 Packet pzi_start, pci_start;
60 for (
int i = 0;
i < packetSize;
i++) pzi_start[
i] = pci_start[
i] =
start.y() +
y * step.y();
62 for (
int x = 0;
x < alignedWidth;
x += packetSize, pix += packetSize) {
63 Packet pcr, pci = pci_start, pzr, pzi = pzi_start, pzr_buf;
64 for (
int i = 0;
i < packetSize;
i++) pzr[
i] = pcr[
i] =
start.x() + (
x +
i) * step.x();
78 pzr -= pzi.square(); \
80 pzi = (2 * pzr_buf) * pzi; \
85 ((pzr.square() + pzi.square()).
eval()
86 <= Packet::Constant(4))
89 .
template cast<int>();
96 for (
int i = 0;
i < packetSize;
i++) {
97 buffer[4 * (pix +
i)] = 255 * pix_iter[
i] /
max_iter;
98 buffer[4 * (pix +
i) + 1] = 0;
99 buffer[4 * (pix +
i) + 2] = 0;
104 for (
int x = alignedWidth;
x < img_width;
x++, pix++)
105 buffer[4 * pix] = buffer[4 * pix + 1] = buffer[4 * pix + 2] = 0;
internal::packet_traits< Scalar >::type Packet
Definition: benchmark-blocking-sizes.cpp:54
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:48
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
int max_iter
Definition: mandelbrot.h:24
long long total_iter
Definition: mandelbrot.h:23
Scalar * y
Definition: level1_cplx_impl.h:128
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243
double Zero
Definition: pseudosolid_node_update_elements.cc:35
list x
Definition: plotDoE.py:28
internal::nested_eval< T, 1 >::type eval(const T &xpr)
Definition: sparse_permutations.cpp:47
Definition: GenericPacketMath.h:108
Definition: mandelbrot.cpp:27
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2