pub enum Quarter {
None,
Clockwise90,
Half,
Clockwise270,
}Expand description
A quarter-turn rotation, clockwise.
Variants§
None
No rotation.
Clockwise90
90 degrees clockwise.
Half
180 degrees.
Clockwise270
270 degrees clockwise, i.e. 90 anticlockwise.
Implementations§
Source§impl Quarter
impl Quarter
Sourcepub fn from_degrees(degrees: i32) -> Result<Quarter, PixelsError>
pub fn from_degrees(degrees: i32) -> Result<Quarter, PixelsError>
The rotation for degrees, which must be a multiple of 90.
Negative and out-of-range angles are normalized, so -90 and 270 are the same rotation.
§Errors
Returns PixelsError::InvalidArgument if degrees is not a multiple
of 90. Rounding to the nearest quarter turn would silently rotate an
image differently from what was asked.
Sourcepub const fn transposes(self) -> bool
pub const fn transposes(self) -> bool
Whether this rotation exchanges width and height.
Trait Implementations§
impl Copy for Quarter
impl Eq for Quarter
impl StructuralPartialEq for Quarter
Auto Trait Implementations§
impl Freeze for Quarter
impl RefUnwindSafe for Quarter
impl Send for Quarter
impl Sync for Quarter
impl Unpin for Quarter
impl UnsafeUnpin for Quarter
impl UnwindSafe for Quarter
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