pub struct Bitmap { /* private fields */ }
Expand description
Byte owning bitmap
Implementations§
source§impl Bitmap
impl Bitmap
sourcepub fn from_image_file(filename: &str) -> Result<Bitmap>
pub fn from_image_file(filename: &str) -> Result<Bitmap>
sourcepub fn from_image_bytes(bytes: &[u8]) -> Result<Bitmap>
pub fn from_image_bytes(bytes: &[u8]) -> Result<Bitmap>
sourcepub fn from(bitmap: &dyn BitmapData) -> Bitmap
pub fn from(bitmap: &dyn BitmapData) -> Bitmap
sourcepub fn put(&mut self, x: u32, y: u32, pixel: Pixel)
pub fn put(&mut self, x: u32, y: u32, pixel: Pixel)
Set a pixel color
x and y coordinates are assumed to be inside of bitmap
Arguments
x
- x coordinate
y
- y coordinate
pixel
- color applied
sourcepub fn merge(&mut self, x_pos: i32, y_pos: i32, bitmap: &dyn BitmapData)
pub fn merge(&mut self, x_pos: i32, y_pos: i32, bitmap: &dyn BitmapData)
Merge another bitmap on this bitmap
Pixels are either replaced or meld upon the pixel alpha channel.
x_pos, y_pos or source bitmap extents does not have to be inside of this bitmap.
Arguments
x_pos
- x coordinate
y_pos
- y coordinate
bitmap
- source bitmap