pub struct BitmapTable<Api: Api = Default, const FREE_ON_DROP: bool = true>(/* private fields */);Implementations§
Source§impl<Api: Api> BitmapTable<Api, true>
impl<Api: Api> BitmapTable<Api, true>
Sourcepub fn new(count: c_int, width: c_int, height: c_int) -> Result<Self, Error>where
Api: Default,
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.
Sourcepub fn new_with(
api: Api,
count: c_int,
width: c_int,
height: c_int,
) -> Result<Self, Error>
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.
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self, ApiError>where
Api: Default,
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.
Sourcepub fn load_with<P: AsRef<Path>>(api: Api, path: P) -> Result<Self, ApiError>
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.
Source§impl<Api: Api, const FOD: bool> BitmapTable<Api, FOD>
impl<Api: Api, const FOD: bool> BitmapTable<Api, FOD>
Sourcepub fn load_into<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ApiError>
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.
Sourcepub fn get<'table, BitApi>(
&'table self,
index: c_int,
) -> Option<Bitmap<BitApi, true>>
pub fn get<'table, BitApi>( &'table self, index: c_int, ) -> Option<Bitmap<BitApi, true>>
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.
Sourcepub fn get_with<'table, BitApi: BitmapApi>(
&'table self,
api: BitApi,
index: c_int,
) -> Option<Bitmap<BitApi, true>>where
Bitmap<BitApi, true>: 'table,
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.
Sourcepub fn info<'table, BitApi: BitmapApi>(
&'table self,
count: Option<&mut c_int>,
width: Option<&mut c_int>,
)
pub fn info<'table, BitApi: BitmapApi>( &'table self, count: Option<&mut c_int>, width: Option<&mut c_int>, )
Returns the bitmap table’s image count in the count if not None
and number of cells across in the width (ditto) if not None .
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>
impl<Api: Debug + Api, const FREE_ON_DROP: bool> Debug for BitmapTable<Api, FREE_ON_DROP>
Auto Trait Implementations§
impl<Api, const FREE_ON_DROP: bool> Freeze for BitmapTable<Api, FREE_ON_DROP>where
Api: Freeze,
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,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
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.