|
| 1 | +# gfx-convert tool |
| 2 | + |
| 3 | +This tool is used to convert SVG or PNG file into eraw.bin which can be loaded |
| 4 | +by EGT code directly to make graphic render fast. Usually this tool is running |
| 5 | +on your Linux host PC, because it has no meaning if you convert graphics on |
| 6 | +embedded target. |
| 7 | + |
| 8 | +## Usage Example |
| 9 | + |
| 10 | +1. Before using this tool, please make sure that you've followed the egt build |
| 11 | +instruction to build egt library ready. |
| 12 | +``` |
| 13 | + git clone --recursive https://github.com/linux4sam/egt.git |
| 14 | + cd egt |
| 15 | + ./autogen.sh |
| 16 | + ./configure |
| 17 | + make |
| 18 | +``` |
| 19 | +2. Make the gfx-convert tool. |
| 20 | +``` |
| 21 | + cd egt/tool/gfx-convert |
| 22 | + make |
| 23 | +``` |
| 24 | +3. Start the gfx-convert, of course, you can run ./gfx-convert -h to get help. |
| 25 | + |
| 26 | +``` |
| 27 | + ./gfx-convert -s |
| 28 | + ./gfx-convert -i png picture1.png |
| 29 | + ./gfx-convert -i png picture2.png |
| 30 | + ...... |
| 31 | + ./gfx-convert -i png pictureN.png |
| 32 | + ./gfx-convert file.svg |
| 33 | + ./gfx-convert -e |
| 34 | +``` |
| 35 | +4. When conversion finished, copy ./eraw.h to source code to include in your |
| 36 | +application cpp code, and copy ./eraw.bin to the target. At last your application |
| 37 | +will read eraw.bin on target to get the graphics data. |
| 38 | + |
| 39 | +5. The generated eraw.h has an array inidicating the graphics id with offset and |
| 40 | +length, and it has an array index in the comment. So when you are coding, you could |
| 41 | +use the array index directly without iterating the array to find the graphics you |
| 42 | +want. There is an example in egt/examples/motorcycledash.cpp, please refer to that |
| 43 | +to learn how to use the eraw.h and eraw.bin. |
| 44 | + |
| 45 | +## License |
| 46 | + |
| 47 | +EGT is released under the terms of the `Apache 2` license. See the [COPYING](../COPYING) |
| 48 | +file for more information. |
0 commit comments