From a7af546c292c0933986772adeba077e56947181e Mon Sep 17 00:00:00 2001 From: aaron404 <54856541+aaron404@users.noreply.github.com> Date: Sat, 11 Jan 2025 15:22:52 -0500 Subject: [PATCH] Impl Serialize/Deserialize for FilterType (#2399) --- src/imageops/sample.rs | 3 +++ 1 file changed, 3 insertions(+) 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,