pub struct ImageRect {
pub w: u16,
pub h: u16,
pub data: Vec<u8>,
}Expand description
Rect to be used when trying to send image to lcd screen
Fields§
§w: u16Width of the image
h: u16Height of the image
data: Vec<u8>Data of the image row by row as RGB
Implementations§
Source§impl ImageRect
impl ImageRect
Sourcepub fn from_image(image: DynamicImage) -> Result<ImageRect, StreamDeckError>
pub fn from_image(image: DynamicImage) -> Result<ImageRect, StreamDeckError>
Converts image to image rect
Sourcepub fn from_image_async(
image: DynamicImage,
) -> Result<ImageRect, StreamDeckError>
Available on crate feature async only.
pub fn from_image_async( image: DynamicImage, ) -> Result<ImageRect, StreamDeckError>
async only.Converts image to image rect, can be safely ran inside multi_thread runtime
Auto Trait Implementations§
impl Freeze for ImageRect
impl RefUnwindSafe for ImageRect
impl Send for ImageRect
impl Sync for ImageRect
impl Unpin for ImageRect
impl UnwindSafe for ImageRect
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