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, dst: &mut Vec<u32>, dst_size: (i32, i32), offset: (i32, i32))
[src]
Blit the image on a buffer using bitwise operations--this is a lot faster than
blit_with_mask_color
.
fn blit_rect(
&self,
dst: &mut Vec<u32>,
dst_size: (i32, i32),
offset: (i32, i32),
sub_rect: (i32, i32, i32, i32)
)
[src]
&self,
dst: &mut Vec<u32>,
dst_size: (i32, i32),
offset: (i32, i32),
sub_rect: (i32, i32, i32, i32)
)
Blit a section of the image on a buffer.
fn from_u32(src: &[u32], width: i32, mask_color: u32) -> Self
[src]
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) -> (i32, i32)
[src]
Get the size of the buffer in pixels.