pub enum Gravity {
Center,
TopLeft,
Top,
TopRight,
Left,
Right,
BottomLeft,
Bottom,
BottomRight,
}Expand description
Which part of the image a crop keeps.
PHP: the Image::GRAVITY_* string constants.
use utopia_image::Gravity;
assert_eq!(Gravity::from_name("top-left"), Some(Gravity::TopLeft));
assert_eq!(Gravity::TopLeft.name(), "top-left");
assert_eq!(Gravity::ALL.len(), 9);use Utopia\Image\Image;
echo Image::GRAVITY_TOP_LEFT, "\n"; // top-left
echo count(Image::getGravityTypes()), "\n"; // 9Variants§
Center
center: a centred thumbnail crop.
TopLeft
top-left
Top
top
TopRight
top-right
Left
left
Right
right
BottomLeft
bottom-left
Bottom
bottom
BottomRight
bottom-right
Implementations§
Trait Implementations§
impl Copy for Gravity
impl Eq for Gravity
impl StructuralPartialEq for Gravity
Auto Trait Implementations§
impl Forget for Gravity
impl Freeze for Gravity
impl Move for Gravity
impl RefUnwindSafe for Gravity
impl Send for Gravity
impl Sync for Gravity
impl Unpin for Gravity
impl UnsafeUnpin for Gravity
impl UnwindSafe for Gravity
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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