diff --git a/.gitignore b/.gitignore index f30a6ef..ca50bc7 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,7 @@ react_app_demo/package-lock.json photon-docs/site output*.jpg output*.png -.vscode \ No newline at end of file +.vscode + +# Jetbrains IDE +.idea/ \ No newline at end of file diff --git a/crate/Cargo.toml b/crate/Cargo.toml index adb0ac1..d7f56aa 100644 --- a/crate/Cargo.toml +++ b/crate/Cargo.toml @@ -36,12 +36,13 @@ imageproc = { version = "0.23.0", default-features = false } rusttype = "0.9.2" base64 = "0.13.0" time = "0.3.21" -wasm-bindgen = { version = "=0.2.85", optional = true } +wasm-bindgen = { version = "0.2.92", optional = true } serde = { version = "1.0", features = ["derive"] } thiserror = "1.0" js-sys = { version = "0.3.62", optional = true } node-sys = { version = "0.4.2", optional = true } perlin2d = "0.2.6" +instant = "0.1.12" # The `console_error_panic_hook` crate provides better debugging of panics by # logging them with `console.error`. This is great for development, but requires diff --git a/crate/examples/example.rs b/crate/examples/example.rs index af432b4..d0b1ace 100644 --- a/crate/examples/example.rs +++ b/crate/examples/example.rs @@ -1,7 +1,6 @@ extern crate image; extern crate photon_rs as photon; -extern crate time; -use time::Instant; +use instant::Instant; fn main() -> Result<(), Box> { // Replace the variable file_name with whatever image you would like to apply filters to @@ -26,7 +25,7 @@ fn main() -> Result<(), Box> { let end = Instant::now(); println!( "Took {} seconds to {} image.", - (end - start).as_seconds_f64(), + (end - start).as_secs_f64(), effect ); } diff --git a/crate/examples/seam_carver.rs b/crate/examples/seam_carver.rs index 5ab1c9d..39c5821 100644 --- a/crate/examples/seam_carver.rs +++ b/crate/examples/seam_carver.rs @@ -1,6 +1,7 @@ extern crate image; extern crate photon_rs; -extern crate time; + +use instant::Instant; fn main() -> Result<(), Box> { let file_name = "crate/examples/input_images/daisies_fuji.jpg"; @@ -8,7 +9,7 @@ fn main() -> Result<(), Box> { // // Open the image let img = photon_rs::native::open_image(file_name)?; - let start = time::Instant::now(); + let start = Instant::now(); // Seam Carver let (w, h) = (img.get_width(), img.get_height()); println!("original = w: {}, h: {}", w, h); @@ -19,10 +20,10 @@ fn main() -> Result<(), Box> { // Write the contents of this image in JPEG format. photon_rs::native::save_image(res, "output_seam_carver.jpg")?; - let end = time::Instant::now(); + let end = Instant::now(); println!( "Took {} seconds to seam carve image.", - (end - start).as_seconds_f64() + (end - start).as_secs_f64() ); Ok(()) diff --git a/crate/src/bin/bin.rs b/crate/src/bin/bin.rs index f3884a4..1ab35f4 100644 --- a/crate/src/bin/bin.rs +++ b/crate/src/bin/bin.rs @@ -1,9 +1,9 @@ extern crate photon_rs; extern crate time; +use instant::Instant; use photon_rs::channels::alter_red_channel; use photon_rs::native::{open_image, save_image}; -use time::Instant; fn main() -> Result<(), Box> { // Open the image (a PhotonImage is returned) @@ -20,7 +20,7 @@ fn main() -> Result<(), Box> { let end = Instant::now(); println!( "Took {} seconds to increment red channel by 40 on image.", - (end - start).as_seconds_f64() + (end - start).as_secs_f64() ); println!(