Struct allegro::bitmap::Bitmap

source ·
pub struct Bitmap { /* private fields */ }

Implementations§

source§

impl Bitmap

source

pub fn new(_: &Core, w: i32, h: i32) -> Result<Bitmap, ()>

source

pub fn load(_: &Core, filename: &str) -> Result<Bitmap, ()>

source

pub unsafe fn wrap(bmp: *mut ALLEGRO_BITMAP, own: bool) -> Bitmap

Wraps an Allegro bitmap.

source

pub unsafe fn clone_and_wrap(bmp: *mut ALLEGRO_BITMAP) -> Result<Bitmap, ()>

source

pub fn maybe_clone(&self) -> Result<Bitmap, ()>

Trait Implementations§

source§

impl BitmapLike for Bitmap

source§

fn get_allegro_bitmap(&self) -> *mut ALLEGRO_BITMAP

source§

fn create_sub_bitmap( &self, x: i32, y: i32, w: i32, h: i32 ) -> Result<Weak<SubBitmap>, ()>

Creates a sub-bitmap of the current bitmap. Note that the parent bitmap will panic upon destruction if any strong references to its sub-bitmaps are held at that time.
source§

fn get_width(&self) -> i32

source§

fn get_height(&self) -> i32

source§

fn get_format(&self) -> PixelFormat

source§

fn get_flags(&self) -> BitmapFlags

source§

fn get_pixel(&self, x: i32, y: i32) -> Color

source§

fn convert_mask_to_alpha(&self, mask_color: Color)

source§

fn is_compatible_bitmap(&self) -> bool

Returns if this bitmap is compatible with the current display. This comes into play when you have multiple displays in a single thread, and have created bitmaps for different displays. A bitmap created for one display may or may not be compatible with the other display. If the bitmap is not compatible, drawing it will be slow.
source§

impl Clone for Bitmap

source§

fn clone(&self) -> Bitmap

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Drop for Bitmap

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for Bitmap

source§

impl Sync for Bitmap

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.