pub enum ImageOperation {
Resize {
max_width: u32,
max_height: u32,
},
Crop {
x: u32,
y: u32,
width: u32,
height: u32,
},
}Expand description
One transformation Command::ImageOp can apply.
Deliberately a closed set rather than a general filter language: each of these answers a question an analysis pipeline actually asks, and a closed set is one a host can implement completely and a block can rely on.
Variants§
Resize
Scale to fit within these bounds, preserving aspect ratio.
The common case before handing an image to a vision model, which resamples to a fixed size anyway — sending a 48-megapixel original costs encode time and tokens for detail the model cannot use.
Crop
Cut out a region, for asking about part of an image rather than all of it.
Trait Implementations§
Source§impl Clone for ImageOperation
impl Clone for ImageOperation
Source§fn clone(&self) -> ImageOperation
fn clone(&self) -> ImageOperation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageOperation
impl Debug for ImageOperation
Source§impl<'de> Deserialize<'de> for ImageOperation
impl<'de> Deserialize<'de> for ImageOperation
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
Source§impl PartialEq for ImageOperation
impl PartialEq for ImageOperation
Source§impl Serialize for ImageOperation
impl Serialize for ImageOperation
impl StructuralPartialEq for ImageOperation
Auto Trait Implementations§
impl Freeze for ImageOperation
impl RefUnwindSafe for ImageOperation
impl Send for ImageOperation
impl Sync for ImageOperation
impl Unpin for ImageOperation
impl UnsafeUnpin for ImageOperation
impl UnwindSafe for ImageOperation
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