pub struct Screenshot {
pub bytes: Bytes,
pub size: Size<u32>,
pub scale_factor: f64,
}
Expand description
Data of a screenshot, captured with window::screenshot()
.
The bytes
of this screenshot will always be ordered as RGBA
in the sRGB
color space.
Fields§
§bytes: Bytes
The bytes of the Screenshot
.
size: Size<u32>
The size of the Screenshot
in physical pixels.
scale_factor: f64
The scale factor of the Screenshot
. This can be useful when converting between widget
bounds (which are in logical pixels) to crop screenshots.
Implementations§
Source§impl Screenshot
impl Screenshot
Trait Implementations§
Source§impl AsRef<[u8]> for Screenshot
impl AsRef<[u8]> for Screenshot
Source§impl Clone for Screenshot
impl Clone for Screenshot
Source§fn clone(&self) -> Screenshot
fn clone(&self) -> Screenshot
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 Screenshot
impl Debug for Screenshot
Source§impl From<Screenshot> for Bytes
impl From<Screenshot> for Bytes
Source§fn from(screenshot: Screenshot) -> Self
fn from(screenshot: Screenshot) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for Screenshot
impl RefUnwindSafe for Screenshot
impl Send for Screenshot
impl Sync for Screenshot
impl Unpin for Screenshot
impl UnwindSafe for Screenshot
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)