Trait blit::ToBlitBuffer
source · pub trait ToBlitBuffer {
// Required methods
fn to_blit_buffer_with_alpha(&self, alpha_treshold: u8) -> BlitBuffer;
fn to_blit_buffer_with_mask_color(&self, mask_color: u32) -> BlitBuffer;
}
Expand description
Convert external image types to a specialized buffer optimized for blitting.
Can be used to create a custom implementation if you want different image or other formats.
Required Methods§
sourcefn to_blit_buffer_with_alpha(&self, alpha_treshold: u8) -> BlitBuffer
fn to_blit_buffer_with_alpha(&self, alpha_treshold: u8) -> BlitBuffer
Convert the image to a custom BlitBuffer
type which is optimized for applying the blitting operations.
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.
sourcefn to_blit_buffer_with_mask_color(&self, mask_color: u32) -> BlitBuffer
fn to_blit_buffer_with_mask_color(&self, mask_color: u32) -> BlitBuffer
Convert the image to a custom BlitBuffer
type which is optimized for applying the blitting operations.
Ignore the alpha channel if set and use only a single color for transparency.