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]
pub fn blit(&self, dst: &mut [u32], dst_width: usize, offset: (i32, i32))
[src]
Blit the image on a buffer using bitwise operations--this is a lot faster than
blit_with_mask_color
.
pub fn blit_rect(
&self,
dst: &mut [u32],
dst_width: usize,
offset: (i32, i32),
sub_rect: (i32, i32, i32, i32)
)
[src]
&self,
dst: &mut [u32],
dst_width: usize,
offset: (i32, i32),
sub_rect: (i32, i32, i32, i32)
)
Blit a section of the image on a buffer.
pub fn from_buffer(src: &[u32], width: i32, mask_color: Color) -> Self
[src]
Create a instance from a buffer of Color
data.
pub 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.
pub 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.
pub fn 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.
pub fn size(&self) -> (i32, i32)
[src]
Get the size of the buffer in pixels.