FTDI Community

General Category => Discussion - Software => Topic started by: rascalito on July 14, 2022, 07:20:48 AM

Title: Compressing to ASTC on Linux.
Post by: rascalito on July 14, 2022, 07:20:48 AM
Hello!

I'm using Ubuntu 22.04.
I'm using a lot of bitmaps, and the easiest way to use bitmaps seems to be to compress
them to ASTC, and store them directly in flash.
As the process of adding a new bitmap is quite time consuming, I have made a php script
that takes one raw image and its associated json. It then creates a pair of .h / .c files
and adds a record in a bitmaplist.h / .cp. files.
Now the next step I would like is a way to directly compress my images on Linux.
It also creats in each .h / .cpp file a structure which contains the file name, data pointer, position
in flash, etc... and also spits out the percentage of flash that has been used. And beside this,
drawing a single image is done with a single command with 2 parameters, one being a rectangle,
and the other is this structure.
Example:
Rect R(x, y, w, h);
BitmapInfo * bmi = BitmapList->FindBMI("MyLogo");
if(bmi) SysLCD->DrawBitmap(R, bmi);
Is there a command-line tool that I can run from the terminal (and therefore from a php script)?

Next question:
How do I choose an encoding method?
I choosed ASTC8x8 at random and it works, but is there logical way to choose an encoding scheme?

Last one:
I have chosen ASTC8x8. When the bitmap dimensions are mutliple of 8, it's just fine. When not,
the size is rounded up to the next multiple of 8. In this case, what will the added image border
look like?

Thanks!

R
Title: Re: Compressing to ASTC on Linux.
Post by: rascalito on July 14, 2022, 08:14:04 AM
Hello!

Sorry, just replying to a part of my own post.
Compressing in ASTC format on Ubuntu:
1. Install by
sudo apt install astcenc
2. Run astcenc.
-> This will list a couple of examples which will be good to start before learning how
to tune the bitmaps for a given purpose.

Now the other questions remain: how to choose the right ASTC format.

Regards,

R

Title: Re: Compressing to ASTC on Linux.
Post by: FTDI Community on July 14, 2022, 09:13:24 AM
Hello,

This is the FTDI Community.

For EVE related questions please post on our Bridgetek Community:

www.brtcommunity.com (http://www.brtcommunity.com)

Best Regards,
FTDI Community