#[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 paint_dot(&mut self, cx: f32, cy: f32, brush: Brush)
pub fn paint_dot(&mut self, cx: f32, cy: f32, brush: Brush)
CPU painting: stamp one brush dab centered at (cx, cy) in pixel
coordinates, alpha-over compositing a radial-falloff disc. Only 8-bit
RGBA8/BGRA8 images are painted (other formats are left untouched).
This is the CPU mirror of the GPU brush shader.
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 UnsafeUnpin 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