Skip to content

Commit d084f68

Browse files
Merge pull request silvia-odwyer#184 from akinsella/wasm-halftone
Enabled halftoning effect for wasm. Added some basic documentation and example
2 parents aa3598a + 8166a61 commit d084f68

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

crate/src/effects.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,20 @@ pub fn multiple_offsets(
199199
}
200200

201201
/// Halftoning effect.
202+
///
203+
/// # Arguments
204+
/// * `img` - A PhotonImage that contains a view into the image.
205+
/// # Example
206+
///
207+
/// ```no_run
208+
/// // For example:
209+
/// use photon_rs::effects::halftone;
210+
/// use photon_rs::native::open_image;
211+
///
212+
/// let mut img = open_image("img.jpg").expect("File should open");
213+
/// halftone(&mut img);
214+
/// ```
215+
#[cfg_attr(feature = "enable_wasm", wasm_bindgen)]
202216
pub fn halftone(photon_image: &mut PhotonImage) {
203217
let mut img = helpers::dyn_image_from_raw(photon_image);
204218
let (width, height) = img.dimensions();

0 commit comments

Comments
 (0)