feat: add other fractals

This commit is contained in:
2026-09-15 15:50:57 +02:00
parent 72c3ea2ee8
commit c36c8b9829
7 changed files with 363 additions and 47 deletions
+13 -2
View File
@@ -9,7 +9,7 @@
use std::sync::mpsc::{Receiver, Sender, TryRecvError, channel};
use std::thread;
use crate::fractal::{compute_mandelbrot_reference, compute_reference};
use crate::fractal::{FractalKind, compute_reference, compute_set_reference};
use crate::view::{Big, big_from_f64};
pub struct RefRequest {
@@ -20,6 +20,8 @@ pub struct RefRequest {
pub julia_c: (f64, f64),
pub max_iter: u32,
pub precision: usize,
pub kind: FractalKind,
pub power: u32,
}
pub struct RefResult {
@@ -97,8 +99,17 @@ fn compute(req: &RefRequest) -> Vec<[f32; 2]> {
&ji,
req.max_iter,
req.precision,
req.kind,
req.power,
)
} else {
compute_mandelbrot_reference(&req.center_re, &req.center_im, req.max_iter, req.precision)
compute_set_reference(
&req.center_re,
&req.center_im,
req.max_iter,
req.precision,
req.kind,
req.power,
)
}
}