pub enum ImageOp {
Crop {
x: u32,
y: u32,
width: u32,
height: u32,
},
Grayscale,
Binarize {
threshold: Option<u8>,
},
Resize {
width: u32,
height: u32,
},
Contrast {
amount: f32,
},
Brightness {
amount: f32,
},
}Expand description
Atomic image operations for the Sandbox mode.
Variants§
Crop
Crop a specific region: { x, y, width, height }
Grayscale
Convert to grayscale.
Binarize
Binarize using Otsu’s threshold (if threshold is None).
Resize
Resize to exact dimensions.
Contrast
Adjust contrast (e.g., 2.0 for double contrast).
Brightness
Adjust brightness (e.g., -20 to darken).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ImageOp
impl<'de> Deserialize<'de> for ImageOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ImageOp
impl RefUnwindSafe for ImageOp
impl Send for ImageOp
impl Sync for ImageOp
impl Unpin for ImageOp
impl UnsafeUnpin for ImageOp
impl UnwindSafe for ImageOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more