This is a feature request for being able to query basic information out of a LCDBitmapTable, possibly allowing access to the source image directly.
I have found at runtime that I’d like to do things like:
Draw the source image directly (eg: a tile picker in a tilemap editor)
Know what the tile size is
Know how many total tiles there are
Today, the only way to know this information is to bake it in somehow; either hard code it, or by providing some supplemental file that might describe this info.
It may suffice to have an API in the form of something like:
LCDBitmap* playdate->graphics-> getTableBitmap(LCDBitmapTable* table, int n);
perhaps? The compiler chops up the source image into cells and compiles those into LCDBitmaps, then packs them together with a small header and an offset table to make the LCDBitmapTable. So the original image doesn't exist as an LCDBitmap, but all of the component images are loaded into memory--getTableBitmap() is a quick lookup returning a pointer to the requested bitmap.
The one thing missing from the API is a way to get the number of bitmaps available or the original dimensions of the source image. You can do
int numBitmaps = 0;
while ( pd->graphics->getTableBitmap(table, numBitmaps) != NULL )
++numBitmaps;
to count the images (not as efficient as simply copying the value out of the header but it'll be quite fast if your table size isn't ridiculous), but we don't have a way to get the "cellsWide" value. I'll file a feature request for that!