mirror of
https://github.com/visioncortex/vtracer.git
synced 2025-12-06 17:15:41 -08:00
python again
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
use crate::*;
|
||||
use pyo3::prelude::*;
|
||||
|
||||
use visioncortex::{PathSimplifyMode};
|
||||
use super::converter::*;
|
||||
use std::path::PathBuf;
|
||||
use visioncortex::PathSimplifyMode;
|
||||
|
||||
/// Python binding
|
||||
#[pyfunction]
|
||||
fn convert_image_to_svg_py( image_path: &str,
|
||||
fn convert_image_to_svg_py(
|
||||
image_path: &str,
|
||||
out_path: &str,
|
||||
colormode: Option<&str>, // "color" or "binary"
|
||||
hierarchical: Option<&str>, // "stacked" or "cutout"
|
||||
@@ -17,7 +18,7 @@ fn convert_image_to_svg_py( image_path: &str,
|
||||
length_threshold: Option<f64>, // in [3.5, 10] default: 4.0
|
||||
max_iterations: Option<usize>, // default: 10
|
||||
splice_threshold: Option<i32>, // default: 45
|
||||
path_precision: Option<u32> // default: 8
|
||||
path_precision: Option<u32>, // default: 8
|
||||
) -> PyResult<()> {
|
||||
let input_path = PathBuf::from(image_path);
|
||||
let output_path = PathBuf::from(out_path);
|
||||
@@ -68,7 +69,6 @@ fn convert_image_to_svg_py( image_path: &str,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
||||
convert_image_to_svg(config).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user