pub struct Transform {
pub width: u32,
pub height: u32,
pub gravity: Gravity,
pub focus: Option<FocalPoint>,
pub opacity: f64,
pub background: Option<String>,
pub border: Option<(u32, String)>,
pub radius: u32,
pub rotation: i64,
}Expand description
One preview: a crop, then opacity, a background, a border, rounded corners and a rotation, in that order. A part left at its default is skipped.
PHP: Utopia\Image\Transform.
Fields§
§width: u32The width to crop to; 0 follows the aspect ratio.
height: u32The height to crop to; 0 follows the aspect ratio.
gravity: GravityWhich part of the image a crop keeps.
focus: Option<FocalPoint>A point to keep in view, which overrides gravity.
opacity: f64From 0 (transparent) to 1 (unchanged).
background: Option<String>A colour to flatten the image onto.
border: Option<(u32, String)>A border’s width in pixels and its colour.
radius: u32The corner radius in pixels.
rotation: i64Degrees clockwise.
Trait Implementations§
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Forget for Transform
impl Freeze for Transform
impl Move for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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,
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