BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying  (Read 10331 times)

Turby

  • Newbie
  • *
  • Posts: 4
    • View Profile

Hi,

I'm working on a embedded system using a Teensy 4.1 with SD Card, and Riverdi 7" 1024x600 EVE4 BT817 display with 512Mb flash chip. I'm also using the excellent EVE library from Rudolph.

The idea is to place a standard JPG or PNG file on to the SD card with a known name eg boot.jpg and this is displayed at startup.

When the power is applied the SD card is scanned for the file boot.jpg and then the image is transferred from SD Card to the EVE flash, and then removed from the SD card.

The next time the power is cycled the boot image is displayed from flash.

So my questions are:
1.Is this actually possible with large 1024x600 jpg / png images
2. How do I transfer the file boot.jpg from SD card to Image flash using the Rudolph library ? I Assume I need to do this in chunks
3. Do I need to convert image into ASTC format or can I leave as native JPG / PNG ?
4. Lastly how do I display image directly from flash using the Rudolph library ?

For info, my test app using the Rudolph library is working perfectly so far on the Teensy 4.1 using DMA and have got my ASTC 5x5 icon font working well.

Hopefully someone (like Rudolph) and point me in the right direction!





Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 389
    • View Profile
Re: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying
« Reply #1 on: July 26, 2021, 03:55:20 PM »

Hello,

the BT81x can only display ASTC compressed images directly from flash and 1024x600 is too large for RAM_G, at least in full color, so you need to convert the images to ASTC first.

In my example code I am using EVE_cmd_flashupdate() to write an flash image with an UTF-8 font from RAM_G to the external flash. This flash image is zlib compressed which in case of the example has two reasons, the first is that the .glyph files are highly compressable due to a combination of redundant structures since every glyh is one image and depending on the font there are a number of empty glyphs.
The second reason is that CMD_INFLATE only works with correct data, so the data also gets verified.

I have a function EVE_memWrite_sram_buffer() as means of transferring data from the host to EVE.
So first you just loop thru reading the data from sd-card to a buffer and writing that buffer to RAM_G in EVE.
And then you call EVE_cmd_flashupdate() to write that data from RAM_G to the flash.

Noteworthy is that CMD_FLASHREAD only accepts data in multiples of 4096.
And it helps to have the binary blob already in place that is needed by EVE to initialise the flash to full speed.

Annother consideration is that the ASTC format needs to be fixed.
On the one side to make the flash-layout planable, on the other side to display it correctly.
I usually go with 8x8 which is 2 bits per pixel, so a 1024x600 image would come out as 150k compressed.
Note, table 12 in the programming guide is partly wrong: https://en.wikipedia.org/wiki/Adaptive_scalable_texture_compression
Logged

Turby

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying
« Reply #2 on: August 02, 2021, 12:25:14 AM »

Thanks for the tips Rudolph,

I have managed to load several compressed ASTC 5x5 images into flash, each of which contain a number of "stacked" images. I can then display any these stacked images directly from flash just like a font. I have also managed to load a small PNG file from SD card to RAM_G (using EVE_cmd_loadimage) , though even a single 224 x 224 png comes out at 100KB which limits its effectiveness. I'm wondering if I can use flash with EVE_cmd_loadimage.

I'm working on a 7" 1024x600 display and have found that the largest font 31 is quite small, is there a way to display zoomed font bitmaps using the inbuilt fonts ?

I notice that the largest font that EVE Asset Builder can convert is limited to a size of 255, which come out at "only" 190 pixels high. Is this a feature of EAB ?
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying
« Reply #3 on: August 02, 2021, 11:04:03 AM »

Hello,

Unfortunately it is not possible to scale the inbuilt fonts in an efficient manner, we would recommend converting these to a larger point size with the font conversion tool.
I can provide the details on the font files used for the inbuilt fonts if desired.

And yes currently the largest conversion possible in EAB is 255, is this too small for your application?

Best Regards,
BRT Community
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 389
    • View Profile
Re: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying
« Reply #4 on: August 02, 2021, 12:03:35 PM »

I'm wondering if I can use flash with EVE_cmd_loadimage.

There is OPT_FLASH or in case of my library EVE_OPT_FLASH which makes the flash memory the source
for image data but I am not aware that I ever used this feature.

Quote
I'm working on a 7" 1024x600 display and have found that the largest font 31 is quite small,

31 is not the largest font, 34 is.
But in order to use 32 to 34 you need to use CMD_ROMFONT to assign these to a bitmap-handle.
Logged

Turby

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying
« Reply #5 on: August 03, 2021, 09:38:44 AM »

Thanks for the tips on font sizes 32 to 34, not sure how I missed that - these larger sizes are very useful.

Regards limit of 255 font size in EAB, this size is very close to what I need, so will make do with it, though I'm sure others would find it useful to be able to go larger particularly when converting symbol based fonts. Would it be possible to also extend EAB by having the option to specify font size by pixel height as well ?

Kind regards
Toby
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying
« Reply #6 on: August 03, 2021, 11:44:03 AM »

Hello,

Thanks for the tips on font sizes 32 to 34, not sure how I missed that - these larger sizes are very useful.

Regards limit of 255 font size in EAB, this size is very close to what I need, so will make do with it, though I'm sure others would find it useful to be able to go larger particularly when converting symbol based fonts. Would it be possible to also extend EAB by having the option to specify font size by pixel height as well ?

Kind regards
Toby

I will suggest this as a feature update for EAB to the development team.

Best Regards,
BRT Community
Logged

LaZorraBRT

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying
« Reply #7 on: August 18, 2021, 02:25:27 AM »

I would like to second the vote on upping the font size, I know that would be helpful for my project, thank you!

T
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: Moving 1024x600 JPG / PNG from SD Card to Flash then displaying
« Reply #8 on: August 20, 2021, 11:27:58 AM »

Hello,

I've chased the developers up on this to see if we can make it happen.

I would like to second the vote on upping the font size, I know that would be helpful for my project, thank you!

T

Best Regards,
BRT Community
Logged