diff --git a/src/imageops/sample.rs b/src/imageops/sample.rs index e738fdd59c..d40e7e3c9b 100644 --- a/src/imageops/sample.rs +++ b/src/imageops/sample.rs @@ -6,6 +6,8 @@ use std::f32; use num_traits::{NumCast, ToPrimitive, Zero}; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; use crate::image::{GenericImage, GenericImageView}; use crate::traits::{Enlargeable, Pixel, Primitive}; @@ -79,6 +81,7 @@ use crate::{ImageBuffer, Rgba32FImage}; /// /// #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum FilterType { /// Nearest Neighbor Nearest,