pub struct RustImageData { /* private fields */ }Trait Implementations§
Source§impl Debug for RustImageData
impl Debug for RustImageData
Source§impl RustImage for RustImageData
impl RustImage for RustImageData
fn is_empty(&self) -> bool
Source§fn from_path(path: &str) -> ImageResult<Self>
fn from_path(path: &str) -> ImageResult<Self>
Read image from file path
Source§fn from_bytes(bytes: &[u8]) -> ImageResult<Self>
fn from_bytes(bytes: &[u8]) -> ImageResult<Self>
Create a new image from a byte slice
fn from_dynamic_image(image: DynamicImage) -> Self
Source§fn thumbnail(&self, width: u32, height: u32) -> ImageResult<Self>
fn thumbnail(&self, width: u32, height: u32) -> ImageResult<Self>
Scale this image down to fit within a specific size.
Returns a new image. The image’s aspect ratio is preserved.
The image is scaled to the maximum possible size that fits
within the bounds specified by
nwidth and nheight. Read moreSource§fn resize(
&self,
width: u32,
height: u32,
filter: FilterType,
) -> ImageResult<Self>
fn resize( &self, width: u32, height: u32, filter: FilterType, ) -> ImageResult<Self>
en: Adjust the size of the image without retaining the aspect ratio
zh: 调整图片大小,不保留长宽比
fn to_jpeg(&self) -> ImageResult<RustImageBuffer>
Source§fn to_png(&self) -> ImageResult<RustImageBuffer>
fn to_png(&self) -> ImageResult<RustImageBuffer>
en: Convert to png format, the returned image is a new image, and the data itself will not be modified
zh: 转为 png 格式,返回的为新的图片,本身数据不会修改
fn to_bitmap(&self) -> ImageResult<RustImageBuffer>
fn save_to_path(&self, path: &str) -> ImageResult<()>
Auto Trait Implementations§
impl Freeze for RustImageData
impl RefUnwindSafe for RustImageData
impl Send for RustImageData
impl Sync for RustImageData
impl Unpin for RustImageData
impl UnwindSafe for RustImageData
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> 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