Fields
contents: Vec<u8>
Implementations
sourceimpl BMP
impl BMP
pub fn new(height: i32, width: u32, default_color: Option<[u8; 4]>) -> BMP
pub fn new_from_file(file_path: &str) -> BMP
pub fn num_bytes_to_kilobytes(bytes: u32) -> u32
pub fn composite_colors(color1: [u8; 4], color2: [u8; 4]) -> [u8; 4]
pub fn get_header(&self) -> BITMAPFILEHEADER
pub fn get_size(&self, use_header: bool) -> u32
pub fn get_dib_header(&self) -> Result<DIBHEADER, ErrorKind>
pub fn get_pixel_data(&self) -> Result<VecDeque<Vec<Vec<u8>>>, ErrorKind>
pub fn get_color_of_px(&self, x: usize, y: usize) -> Result<[u8; 4], ErrorKind>
pub fn change_color_of_pixel(
&mut self,
x: u16,
y: u16,
new_color: [u8; 4]
) -> Result<(), ErrorKind>
pub fn change_color_of_pixels(
&mut self,
pixels: Vec<[u16; 2]>,
new_color: [u8; 4]
) -> Result<(), ErrorKind>
pub fn draw_image(&mut self, x: u16, y: u16, bmp2: BMP) -> Result<(), ErrorKind>
pub fn change_opacity(&mut self, opacity: u8) -> Result<(), ErrorKind>
pub fn invert(&mut self, invert_alpha: Option<bool>) -> Result<(), ErrorKind>
pub fn draw_line(
&mut self,
fill: [u8; 4],
p1: [u16; 2],
p2: [u16; 2]
) -> Result<(), ErrorKind>
pub fn draw_rectangle(
&mut self,
fill: Option<[u8; 4]>,
stroke: Option<[u8; 4]>,
p1: [u16; 2],
p2: [u16; 2]
) -> Result<(), ErrorKind>
pub fn draw_ellipse(
&mut self,
center: [u16; 2],
xlength: u16,
ylength: u16,
stroke: [u8; 4],
fill: Option<[u8; 4]>,
guess: bool
) -> Result<(), ErrorKind>
pub fn fill_bucket(
&mut self,
fill: [u8; 4],
x: usize,
y: usize
) -> Result<Vec<[u16; 2]>, ErrorKind>
pub fn save_to_new(self, file_path: &str) -> Result<(), ErrorKind>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BMP
impl Send for BMP
impl Sync for BMP
impl Unpin for BMP
impl UnwindSafe for BMP
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more