nopnop2002 / esp-idf-st7789

ST7789 Driver for esp-idf
MIT License
254 stars 62 forks source link

SVG logging #30

Open wjcarpenter opened 2 years ago

wjcarpenter commented 2 years ago

I wanted to make some screenshots of some things I was doing with this graphics package, so I implemented a way to get SVG output. If you find it interesting, feel free to add it to the library (or any similar driver libraries you have).

SVG logging sends equivalent SVG directives to the ESP log (usually uart0). It logs at the logging level and with the logging tag specified. That should make it straightforward to use text tools to carve the actual SVG out of the log. There is an optional "cut line" argument to the lcdSvgLoggingEnd. If provided, it is logged as-is and could be used to automatically separate multiple chunks from the overall output.

There is no inherent overall background color. If you want one, you should start with lcdFillScreen() within the SVG logging.

SVG output can be quite verbose (especially for things like text that are drawn a pixel at a time). It also slows things down a huge amount. In fact, it makes things so slow that there are task delays of 1 tick sprinkled throughout to avoid tripping the task watchdog timer.

nopnop2002 commented 2 years ago

Thank you for your PR.

I don't know anything about SVG, so it will take some time to understand this.

wjcarpenter commented 2 years ago

In issue #31, I attached a ZIP of the SVGs for the library's sample app so you can get an idea of what the output looks like. You can also see some examples of my screens here: https://hackaday.io/project/184926-blexmang/log/205726-user-interface-elements (Because I am using a TTGO T-Display in landscape mode, and because that web site doesn't accept graphics as SVGs, I used some common tools to convert them to PNG and rotate them. But they are otherwise identical to the SVGs.)

nopnop2002 commented 2 years ago

Thank you.

I don't understand SVG yet