Struct playdate_graphics::bitmap::table::BitmapTable
source · 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>>where
Bitmap<BitApi, true>: 'table,
BitApi: Default + BitmapApi,
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.
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.
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> 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.