Struct blit::BlitBuffer
source · pub struct BlitBuffer { /* private fields */ }Expand description
A data structure holding a color and a mask buffer to make blitting on a buffer real fast.
Implementations§
source§impl BlitBuffer
impl BlitBuffer
sourcepub fn from_buffer<S>(src: &[u32], width: S, alpha_treshold: u8) -> Selfwhere
S: ToPrimitive,
pub fn from_buffer<S>(src: &[u32], width: S, alpha_treshold: u8) -> Selfwhere S: ToPrimitive,
Create a instance from a buffer of RGBA data packed in a single u32.
It’s assumed that the alpha channel in the resulting pixel is properly set. The alpha treshold is the offset point at which an alpha value will be used as either a transparent pixel or a colored one.
sourcepub fn from_iter<I, S>(iter: I, width: S, alpha_treshold: u8) -> Selfwhere
I: Iterator<Item = u32>,
S: ToPrimitive,
pub fn from_iter<I, S>(iter: I, width: S, alpha_treshold: u8) -> Selfwhere I: Iterator<Item = u32>, S: ToPrimitive,
Create a instance from a iterator of RGBA data packed in a single u32.
It’s assumed that the alpha channel in the resulting pixel is properly set. The alpha treshold is the offset point at which an alpha value will be used as either a transparent pixel or a colored one.
sourcepub fn pixels_mut(&mut self) -> &mut [u32]
pub fn pixels_mut(&mut self) -> &mut [u32]
Get a mutable reference to the pixel data.
Trait Implementations§
source§impl Blit for BlitBuffer
impl Blit for BlitBuffer
source§impl Clone for BlitBuffer
impl Clone for BlitBuffer
source§fn clone(&self) -> BlitBuffer
fn clone(&self) -> BlitBuffer
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 moreAuto Trait Implementations§
impl RefUnwindSafe for BlitBuffer
impl Send for BlitBuffer
impl Sync for BlitBuffer
impl Unpin for BlitBuffer
impl UnwindSafe for BlitBuffer
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