47 Q_ASSERT(!device.
isNull());
62 const uint default_seed = (config->getProperty(
"seed", property)) ? property.toUInt() : 0;
63 const QString custom_seed_string = (config->getProperty(
"custom_seed_string", property)) ? property.toString() :
"";
64 const bool use_custom_seed = !custom_seed_string.trimmed().isEmpty();
69 double frequency = (config && config->getProperty(
"frequency", property)) ? property.toDouble() : 25.0;
70 double ratio_x = (config && config->getProperty(
"ratio_x", property)) ? property.toDouble() : 1.0;
71 double ratio_y = (config && config->getProperty(
"ratio_y", property)) ? property.toDouble() : 1.0;
73 bool looping = (config && config->getProperty(
"looping", property)) ? property.toBool() :
false;
76 float major_radius = 0.5f * frequency * ratio_x;
77 float minor_radius = 0.5f * frequency * ratio_y;
79 double x_phase = (double)it.
x() / (double)whole_image_bounds.width() *
M_PI * 2;
80 double y_phase = (double)it.
y() / (double)(whole_image_bounds.height()) *
M_PI * 2;
81 double x_coordinate = major_radius *
map_range(cos(x_phase), -1.0, 1.0, 0.0, 1.0);
82 double y_coordinate = major_radius *
map_range(sin(x_phase), -1.0, 1.0, 0.0, 1.0);
83 double z_coordinate = minor_radius *
map_range(cos(y_phase), -1.0, 1.0, 0.0, 1.0);
84 double w_coordinate = minor_radius *
map_range(sin(y_phase), -1.0, 1.0, 0.0, 1.0);
89 reinterpret_cast<float *
>(c.
data())[0] =
value;
96 double x_phase = (double)it.
x() / (double)(whole_image_bounds.width()) * ratio_x;
97 double y_phase = (double)it.
y() / (double)(whole_image_bounds.height()) * ratio_y;
98 double value =
open_simplex_noise4(noise_context, x_phase * frequency, y_phase * frequency, x_phase * frequency, y_phase * frequency);
102 reinterpret_cast<float *
>(c.
data())[0] =
value;