|
|
@@ -1980,13 +1980,14 @@ quantize(size_t max_colors) {
|
|
|
* PerlinNoise2 class in mathutil.
|
|
|
*/
|
|
|
void PNMImage::
|
|
|
-perlin_noise_fill(float sx, float sy, int table_size, unsigned long seed) {
|
|
|
+perlin_noise_fill(float sx, float sy, int table_size, unsigned long seed,
|
|
|
+ float ox, float oy) {
|
|
|
float x, y;
|
|
|
float noise;
|
|
|
PerlinNoise2 perlin (sx * _x_size, sy * _y_size, table_size, seed);
|
|
|
for (x = 0; x < _x_size; ++x) {
|
|
|
for (y = 0; y < _y_size; ++y) {
|
|
|
- noise = perlin.noise(x, y);
|
|
|
+ noise = perlin.noise(x + ox, y + oy);
|
|
|
set_xel(x, y, 0.5 * (noise + 1.0));
|
|
|
}
|
|
|
}
|