Struct crankstart::graphics::Bitmap
source · pub struct Bitmap { /* private fields */ }
Implementations§
source§impl Bitmap
impl Bitmap
pub fn get_data(&self) -> Result<BitmapData, Error>
pub fn draw( &self, location: ScreenPoint, flip: LCDBitmapFlip ) -> Result<(), Error>
pub fn draw_scaled( &self, location: ScreenPoint, scale: Vector2D<f32> ) -> Result<(), Error>
sourcepub fn draw_rotated(
&self,
location: ScreenPoint,
degrees: f32,
center: Vector2D<f32>,
scale: Vector2D<f32>
) -> Result<(), Error>
pub fn draw_rotated( &self, location: ScreenPoint, degrees: f32, center: Vector2D<f32>, scale: Vector2D<f32> ) -> Result<(), Error>
Draw the Bitmap
to the given location
, rotated degrees
about the center
point,
scaled up or down in size by scale
. center
is given by two numbers between 0.0 and
1.0, where (0, 0) is the top left and (0.5, 0.5) is the center point.
sourcepub fn rotated(
&self,
degrees: f32,
scale: Vector2D<f32>
) -> Result<Bitmap, Error>
pub fn rotated( &self, degrees: f32, scale: Vector2D<f32> ) -> Result<Bitmap, Error>
Return a copy of self, rotated by degrees
and scaled up or down in size by scale
.
pub fn tile( &self, location: ScreenPoint, size: ScreenSize, flip: LCDBitmapFlip ) -> Result<(), Error>
pub fn clear(&self, color: LCDColor) -> Result<(), Error>
pub fn transform( &self, rotation: f32, scale: Vector2D<f32> ) -> Result<Bitmap, Error>
pub fn into_color( &self, bitmap: Bitmap, top_left: Point2D<i32> ) -> Result<LCDColor, Error>
pub fn load(&self, path: &str) -> Result<(), Error>
pub fn check_mask_collision( &self, my_location: ScreenPoint, my_flip: LCDBitmapFlip, other: Bitmap, other_location: ScreenPoint, other_flip: LCDBitmapFlip, rect: ScreenRect ) -> Result<bool, Error>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Bitmap
impl !Send for Bitmap
impl !Sync for Bitmap
impl Unpin for Bitmap
impl !UnwindSafe for Bitmap
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more