esp-idf-st7789 icon indicating copy to clipboard operation
esp-idf-st7789 copied to clipboard

SVG logging

Open wjcarpenter opened this issue 2 years ago • 3 comments

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.

wjcarpenter avatar May 05 '22 01:05 wjcarpenter

Thank you for your PR.

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

nopnop2002 avatar May 05 '22 03:05 nopnop2002

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.)

wjcarpenter avatar May 07 '22 19:05 wjcarpenter

Thank you.

I don't understand SVG yet

nopnop2002 avatar May 08 '22 01:05 nopnop2002