#[repr(C)]pub struct RawImage {
pub pixels: RawImageData,
pub width: usize,
pub height: usize,
pub premultiplied_alpha: bool,
pub data_format: RawImageFormat,
pub tag: U8Vec,
}Fields§
§pixels: RawImageData§width: usize§height: usize§premultiplied_alpha: bool§data_format: RawImageFormat§tag: U8VecImplementations§
Source§impl RawImage
impl RawImage
Sourcepub fn null_image() -> Self
pub fn null_image() -> Self
Returns a null / empty image
Sourcepub fn allocate_mask(size: LayoutSize) -> Self
pub fn allocate_mask(size: LayoutSize) -> Self
Allocates a width * height, single-channel mask, used for drawing CPU image masks
Sourcepub fn into_loaded_image_source(self) -> Option<(ImageData, ImageDescriptor)>
pub fn into_loaded_image_source(self) -> Option<(ImageData, ImageDescriptor)>
Encodes a RawImage as BGRA8 bytes and premultiplies it if the alpha is not premultiplied
Returns None if the width * height * BPP does not match
TODO: autovectorization fails spectacularly, need to manually optimize!
Trait Implementations§
Source§impl PartialOrd for RawImage
impl PartialOrd for RawImage
impl StructuralPartialEq for RawImage
Auto Trait Implementations§
impl Freeze for RawImage
impl RefUnwindSafe for RawImage
impl Send for RawImage
impl Sync for RawImage
impl Unpin for RawImage
impl UnwindSafe for RawImage
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,
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