2020-10-20 04:43 AM
I'm using a texture mapper to rotate an arrow inside a circle. That works perfectly well as long as the arrow is included as image asset and this image is directly set as image in the texture mapper.
As soon as I remove the arrow from the assets and place it on the SD card to have it dynamically loaded as dynamic bitmap, the following happens:
This happens for RGB, ARGB as well as L8 images (it does not matter if alpha is included in the clut or not). Dynamic bitmaps do not seem to be supported by TextureMapper.
Is this a bug?
Is there a plan in which version the TouchGFX TextureMapper supports dynamic bitmaps?
Kind regards,
Klemens Pleiner
2020-10-23 06:19 AM
A Dynamic Bitmap is also just a bitmap, so it should work. Is TextureMapper feature enabled for the format you want? In "Config" tab of the designer.
2020-11-10 01:11 AM
Hello Martin,
thanks for the answer!
I've switched to TouchGFX 4.15 and the problem still persists. In the TouchGFX Designer on Config => Framework Features ALL checkboxes are checked. So the TextureMapper should be able to use dynamic L8ARGB images. But obviously it doesn't.
It still works, as long as the image is included as image asset :(
Maybe the problem is triggered by the place where my dynamic bitmap cache is located:
I'm using the STM32L4R9I Discovery board and I've created the dynamic bitmap cache in the PSRAM of this board. Maybe that's the problem?
(I was unable to put the display buffer into the PSRAM. Thus I have the display buffer still in the internal RAM, but the dynamic bitmap cache must be located in the PSRAM as I don't have plenty of internal RAM left.)
2020-11-10 03:13 AM
Can you show me a screenshot of what it looks like? Your application wouldn't happen to be rotated, would it?
2020-11-10 04:00 AM
OK, the zip archive attached to this reply contains the following files:
Here are some code snippets:
// I've removed all the error treatment to have it shorter:
BitmapId BitmapLoader::load(const TCHAR* path, Bitmap::BitmapFormat bitmapFormat, Bitmap::ClutFormat clutFormat)
{
BitmapId result = BITMAP_INVALID;
uint8_t bytes[2];
UINT bytesRead;
FRESULT fResult;
uint16_t width, height;
fResult = f_open(&file, path, FA_OPEN_EXISTING | FA_READ);
fResult = f_read(&file, bytes, 2, &bytesRead);
width = bytes[0] + ((uint16_t)(bytes[1]) << 8);
fResult = f_read(&file, bytes, 2, &bytesRead);
height = bytes[0] + ((uint16_t)(bytes[1]) << 8);
result = Bitmap::dynamicBitmapCreate(width, height, bitmapFormat, clutFormat);
fResult = f_read(&file, Bitmap::dynamicBitmapGetAddress(result), f_size(&file) - 4, &bytesRead);
f_close(&file);
return result;
}
ar00BpmArrow.setBitmap(Bitmap(bitmapIdwhite_arrow));
float bpmAngle = 2.10 * bpm / maxBpm - 1.05;
ar00BpmArrow.updateAngles(0, 0, bpmAngle);
ar00BpmArrow.invalidate();
What exactly do you mean with "rotated application"?
The display orientation in TouchGFX Designer => Config => Display is set to landscape, but the display is square.
Do you need anything else?
Thank you very much for your interest & help!
2021-01-21 01:04 AM
Hi again!
In the meantime we moved the project from the disco board to our "real" hardware where we have much more PSRAM which is also much faster. But the problem still persists:
Interesting is the following: I use TextureMappers in other screens to rotate images loaded as dynamic bitmap to the dynamic bitmap cache (located in the PSRAM). Whenever those images are larger (greater width and greater height compared to white_arrow.png) everything works as expected.
So my workaround is to store this single image in the internal flash.