Struct blit::BlitBuffer
[−]
[src]
pub struct BlitBuffer { /* fields omitted */ }
A data structure holding a color and a mask buffer to make blitting on a buffer real fast.
Methods
impl BlitBuffer
[src]
fn blit(
&self,
buffer: &mut Vec<u32>,
buffer_size: (usize, usize),
pos: (i32, i32)
)
[src]
&self,
buffer: &mut Vec<u32>,
buffer_size: (usize, usize),
pos: (i32, i32)
)
Blit the image on a buffer using bitwise operations--this is a lot faster than
blit_with_mask_color
.
fn save<P>(&self, path: P) -> Result<(), Box<Error>> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Saves the buffer to a file at the path specified. A custom binary format is used for this.
fn open<P>(path: P) -> Result<Self, Box<Error>> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Create a new buffer from a file at the path specified. The file needs to be the custom binary format.
fn load_from_memory(buffer: &[u8]) -> Result<Self, Box<Error>>
[src]
Create a new buffer from a file at the path specified. The array needs to be the custom binary format.
fn size(&self) -> (usize, usize)
[src]
Get the size of the buffer in pixels.