pub struct BitmapInfo {
pub pixels: Size,
pub scale: f64,
pub format: Option<ImageFormat>,
pub has_alpha: bool,
}Expand description
What a decoded image is, in the terms every backend can answer
(Toolkit::image_info, docs/images.md).
pixels is the image’s own pixel size, not the points it draws at: an asset that stages at
2× reports twice its point size and a scale of 2, so an app sizing a frame divides. Bytes
carry no density, so a decoded buffer always answers scale: 1.0.
Fields§
§pixels: Size§scale: f64Pixels per point (1.0 for decoded bytes; 2 or 3 for a catalog/drawable asset that staged a density variant).
format: Option<ImageFormat>The encoded format it came from, where the backend knows or ImageFormat::sniff said.
has_alpha: boolTrait Implementations§
Source§impl Clone for BitmapInfo
impl Clone for BitmapInfo
Source§fn clone(&self) -> BitmapInfo
fn clone(&self) -> BitmapInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BitmapInfo
Source§impl Debug for BitmapInfo
impl Debug for BitmapInfo
Source§impl Default for BitmapInfo
impl Default for BitmapInfo
Source§fn default() -> BitmapInfo
fn default() -> BitmapInfo
Returns the “default value” for a type. Read more
Source§impl PartialEq for BitmapInfo
impl PartialEq for BitmapInfo
impl StructuralPartialEq for BitmapInfo
Auto Trait Implementations§
impl Freeze for BitmapInfo
impl RefUnwindSafe for BitmapInfo
impl Send for BitmapInfo
impl Sync for BitmapInfo
impl Unpin for BitmapInfo
impl UnsafeUnpin for BitmapInfo
impl UnwindSafe for BitmapInfo
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