Struct turbojpeg::TransformCrop
source · pub struct TransformCrop {
pub x: usize,
pub y: usize,
pub width: Option<usize>,
pub height: Option<usize>,
}
Expand description
Transform cropping region.
The x
and y
position of the region must be aligned on MCU boundaries.
The size of the MCU depends on the chrominance subsampling option, which can be obtained using
Decompressor::read_header()
.
The default instance performs no cropping.
Fields§
§x: usize
Left boundary of the region. This must be divisible by the MCU width (see
Subsamp::mcu_width()
).
y: usize
Upper boundary of the region. This must be divisible by the MCU height (see
Subsamp::mcu_height()
).
width: Option<usize>
Width of the region. If None is given, the region ends at the right boundary of the image.
height: Option<usize>
Height of the region. If None is given, the region ends at the bottom boundary of the image.
Trait Implementations§
source§impl Clone for TransformCrop
impl Clone for TransformCrop
source§fn clone(&self) -> TransformCrop
fn clone(&self) -> TransformCrop
Returns a copy of the value. Read more
1.0.0 · 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 TransformCrop
impl Debug for TransformCrop
source§impl Default for TransformCrop
impl Default for TransformCrop
source§fn default() -> TransformCrop
fn default() -> TransformCrop
Returns the “default value” for a type. Read more
source§impl Hash for TransformCrop
impl Hash for TransformCrop
source§impl Ord for TransformCrop
impl Ord for TransformCrop
source§fn cmp(&self, other: &TransformCrop) -> Ordering
fn cmp(&self, other: &TransformCrop) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for TransformCrop
impl PartialEq for TransformCrop
source§fn eq(&self, other: &TransformCrop) -> bool
fn eq(&self, other: &TransformCrop) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TransformCrop
impl PartialOrd for TransformCrop
source§fn partial_cmp(&self, other: &TransformCrop) -> Option<Ordering>
fn partial_cmp(&self, other: &TransformCrop) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for TransformCrop
impl Eq for TransformCrop
impl StructuralPartialEq for TransformCrop
Auto Trait Implementations§
impl Freeze for TransformCrop
impl RefUnwindSafe for TransformCrop
impl Send for TransformCrop
impl Sync for TransformCrop
impl Unpin for TransformCrop
impl UnwindSafe for TransformCrop
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