Skip to content

Commit 6777e68

Browse files
committed
fixed the glitch correction
1 parent 8579765 commit 6777e68

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

output.png

43.1 KB
Loading

src/bin/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ fn main() {
5959
iterations.parse::<usize>().unwrap(),
6060
center_re,
6161
center_im,
62-
0.1,
63-
true,
64-
0
62+
0.01,
63+
false,
64+
16
6565
);
6666

6767
let time = Instant::now();

src/renderer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl FractalRenderer {
130130
println!("{:<14}{:>6} ms", "Iteration", time.elapsed().as_millis());
131131

132132
let time = Instant::now();
133-
Colouring::Iteration.run(&pixel_data, &mut self.image, self.maximum_iteration, delta_pixel, &reference);
133+
Colouring::IterationSmooth.run(&pixel_data, &mut self.image, self.maximum_iteration, delta_pixel, &reference);
134134
println!("{:<14}{:>6} ms", "Coloring", time.elapsed().as_millis());
135135

136136
let time = Instant::now();
@@ -166,7 +166,7 @@ impl FractalRenderer {
166166

167167
Perturbation::iterate(&mut pixel_data, &r, r.current_iteration);
168168

169-
Colouring::Iteration.run(&pixel_data, &mut self.image, self.maximum_iteration, delta_pixel, &r);
169+
Colouring::IterationSmooth.run(&pixel_data, &mut self.image, self.maximum_iteration, delta_pixel, &r);
170170

171171
// Remove all non-glitched points from the remaining points
172172
pixel_data.retain(|packet| {

src/util/complex_extended.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl Sub<ComplexExtended> for ComplexExtended {
132132
if self.exponent > other.exponent {
133133
ComplexExtended::new(self.mantissa - other.mantissa * 1.0f64.ldexp(other.exponent - self.exponent), self.exponent)
134134
} else {
135-
ComplexExtended::new(other.mantissa - self.mantissa * 1.0f64.ldexp(self.exponent - other.exponent), other.exponent)
135+
ComplexExtended::new(self.mantissa * 1.0f64.ldexp(self.exponent - other.exponent) - other.mantissa, other.exponent)
136136
}
137137
}
138138
}

0 commit comments

Comments
 (0)