Skip to content

Commit

Permalink
Merge pull request #184 from akinsella/wasm-halftone
Browse files Browse the repository at this point in the history
Enabled halftoning effect for wasm. Added some basic documentation and example
  • Loading branch information
silvia-odwyer authored Jul 18, 2024
2 parents aa3598a + 8166a61 commit d084f68
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crate/src/effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,20 @@ pub fn multiple_offsets(
}

/// Halftoning effect.
///
/// # Arguments
/// * `img` - A PhotonImage that contains a view into the image.
/// # Example
///
/// ```no_run
/// // For example:
/// use photon_rs::effects::halftone;
/// use photon_rs::native::open_image;
///
/// let mut img = open_image("img.jpg").expect("File should open");
/// halftone(&mut img);
/// ```
#[cfg_attr(feature = "enable_wasm", wasm_bindgen)]
pub fn halftone(photon_image: &mut PhotonImage) {
let mut img = helpers::dyn_image_from_raw(photon_image);
let (width, height) = img.dimensions();
Expand Down

0 comments on commit d084f68

Please sign in to comment.