pub struct BitmapTable<Api: Api = Default, const FREE_ON_DROP: bool = true>(/* private fields */);

Implementations§

source§

impl<Api: Api> BitmapTable<Api, true>

source

pub fn new(count: c_int, width: c_int, height: c_int) -> Result<Self, Error>where Api: Default,

Allocates and returns a new BitmapTable that can hold count width by height Bitmaps.

Equivalent to sys::ffi::playdate_graphics::newBitmapTable.

source

pub fn new_with( api: Api, count: c_int, width: c_int, height: c_int ) -> Result<Self, Error>

Allocates and returns a new BitmapTable that can hold count width by height Bitmaps, using the given api.

Equivalent to sys::ffi::playdate_graphics::newBitmapTable.

source

pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, ApiError>where Api: Default,

Allocates and returns a new BitmapTable from the file at path.

If there is no file at path, the function returns error.

Calls sys::ffi::playdate_graphics::loadBitmapTable.

source

pub fn load_with<P: AsRef<Path>>(api: Api, path: P) -> Result<Self, ApiError>

Allocates and returns a new BitmapTable from the file at path.

If there is no file at path, the function returns error.

Calls sys::ffi::playdate_graphics::loadBitmapTable.

source§

impl<Api: Api, const FOD: bool> BitmapTable<Api, FOD>

source

pub fn load_into<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ApiError>

Loads the image-table at path into the previously allocated this table.

Equivalent to sys::ffi::playdate_graphics::loadIntoBitmapTable.

source

pub fn get<'table, BitApi>( &'table self, index: c_int ) -> Option<Bitmap<BitApi, true>>where Bitmap<BitApi, true>: 'table, BitApi: Default + BitmapApi,

Returns the index bitmap in this table, if index is out of bounds, the function returns None.

Creates new default api access-point.

Equivalent to sys::ffi::playdate_graphics::getTableBitmap.

source

pub fn get_with<'table, BitApi: BitmapApi>( &'table self, api: BitApi, index: c_int ) -> Option<Bitmap<BitApi, true>>where Bitmap<BitApi, true>: 'table,

Returns the index bitmap in this table, if index is out of bounds, the function returns None.

Produced Bitmap uses passed api access-point.

Equivalent to sys::ffi::playdate_graphics::getTableBitmap.

Trait Implementations§

source§

impl<Api: Debug + Api, const FREE_ON_DROP: bool> Debug for BitmapTable<Api, FREE_ON_DROP>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Api: Api, const FOD: bool> Drop for BitmapTable<Api, FOD>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<Api, const FREE_ON_DROP: bool> RefUnwindSafe for BitmapTable<Api, FREE_ON_DROP>where Api: RefUnwindSafe,

§

impl<Api = Default, const FREE_ON_DROP: bool = true> !Send for BitmapTable<Api, FREE_ON_DROP>

§

impl<Api = Default, const FREE_ON_DROP: bool = true> !Sync for BitmapTable<Api, FREE_ON_DROP>

§

impl<Api, const FREE_ON_DROP: bool> Unpin for BitmapTable<Api, FREE_ON_DROP>where Api: Unpin,

§

impl<Api, const FREE_ON_DROP: bool> UnwindSafe for BitmapTable<Api, FREE_ON_DROP>where Api: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.