pub struct ImageOptions {
pub uv: Rect,
pub bg_fill: Color32,
pub tint: Color32,
pub rotation: Option<(Rot2, Vec2)>,
pub rounding: Rounding,
}
Fields§
§uv: Rect
Select UV range. Default is (0,0) in top-left, (1,1) bottom right.
bg_fill: Color32
A solid color to put behind the image. Useful for transparent images.
tint: Color32
Multiply image color with this. Default is WHITE (no tint).
rotation: Option<(Rot2, Vec2)>
Rotate the image about an origin by some angle
Positive angle is clockwise. Origin is a vector in normalized UV space ((0,0) in top-left, (1,1) bottom right).
To rotate about the center you can pass Vec2::splat(0.5)
as the origin.
Due to limitations in the current implementation, this will turn off rounding of the image.
rounding: Rounding
Round the corners of the image.
The default is no rounding (Rounding::ZERO
).
Due to limitations in the current implementation, this will turn off any rotation of the image.
Trait Implementations§
Source§impl Clone for ImageOptions
impl Clone for ImageOptions
Source§fn clone(&self) -> ImageOptions
fn clone(&self) -> ImageOptions
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 ImageOptions
impl Debug for ImageOptions
Source§impl Default for ImageOptions
impl Default for ImageOptions
Source§impl<'de> Deserialize<'de> for ImageOptions
impl<'de> Deserialize<'de> for ImageOptions
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
Auto Trait Implementations§
impl Freeze for ImageOptions
impl RefUnwindSafe for ImageOptions
impl Send for ImageOptions
impl Sync for ImageOptions
impl Unpin for ImageOptions
impl UnwindSafe for ImageOptions
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