diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2019-11-16 19:37:22 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2019-11-16 19:37:22 -0800 |
commit | a6f43bc59fc1292060081d5a4837f5679e1b186f (patch) | |
tree | 20e87bf064a67473a81bedc64a1ef6bd4667ee21 /src/modules/stars | |
parent | 7bbb0fa20ff65a05031886c35646248dc94a38a8 (diff) |
libs/txt: add minimal ascii text renderer
This is as basic as it gets, the only fanciness is it recognizes
newlines and supports horizontal and vertical justification.
As this is intended to be run from potentially threaded fragmenter
renderers, it receives a fragment and *frame* coordinates for the
text to be rendered. If the text doesn't land in the given fragment,
nothing gets drawn.
Currently this is not optimized at all. There's a stubbed out rect
overlap test function which could be used to avoid entering the
text rendering loop for fragments with zero overlap, that's an obvious
low-hanging fruit optimization. After that, skipping characters
that don't overlap would be another obvious thing.
As-is the text render loop is always entered and the bounds-checked
put pixel helper is used. So every fragment will incur the cost of
rendering the full string, even when it's not visible.
For the rtv captions this isn't a particularly huge deal, but stuff
to improve upon in the future.
Diffstat (limited to 'src/modules/stars')
0 files changed, 0 insertions, 0 deletions