SVG path string numeric precision

This commit is contained in:
Bobby Ng
2021-07-23 23:35:45 +08:00
committed by Chris Tsang
parent 9ce7df176a
commit d0593e716a
10 changed files with 74 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ pub struct BinaryImageConverterParams {
pub max_iterations: usize,
pub splice_threshold: f64,
pub filter_speckle: usize,
pub path_precision: u32,
}
#[wasm_bindgen]
@@ -80,6 +81,7 @@ impl BinaryImageConverter {
self.svg.prepend_path(
&paths,
&color,
Some(self.params.path_precision),
);
}
self.counter += 1;

View File

@@ -21,6 +21,7 @@ pub struct ColorImageConverterParams {
pub filter_speckle: usize,
pub color_precision: i32,
pub layer_difference: i32,
pub path_precision: u32,
}
#[wasm_bindgen]
@@ -137,6 +138,7 @@ impl ColorImageConverter {
self.svg.prepend_path(
&paths,
&cluster.residue_color(),
Some(self.params.path_precision),
);
self.counter += 1;
false