YUV overlay and text rendering

Hi,

Is it somehow possible to combine accelerated rendering using
SDL_DisplayYUVOverlay and rendering text using TTF_RenderText_ ?
I can’t figure out how. Any pointers to a solution would be appreciated.
The reason to do so is that I want to show camera images at the lowest
possible cost (CPU-wise), and add an informative text message to the
images.
Thanks beforehand.

Thomas

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Is it somehow possible to combine accelerated rendering using
SDL_DisplayYUVOverlay and rendering text using TTF_RenderText_ ?
I can’t figure out how. Any pointers to a solution would be appreciated.
The reason to do so is that I want to show camera images at the lowest
possible cost (CPU-wise), and add an informative text message to the
images.

You would have to convert the font surface to YUV and render them into
the overlay data before handing it to SDL. The overhead is probably
fairly minimal in this manner. Alternately, you’d have to convert the
YUV data to an RGB surface and blit the font surface onto it before
blitting it to the screen, but that’s probably more expensive since you
lose the hardware overlay.

Here’s a library that will handle this for you:
http://www.libsdl.org/projects/sdlyuvaddon/

Please note that sdlyuvaddon is (somewhat inexplicably) under the GPL
license, which is more restrictive than SDL’s license…but the
techniques are fairly simple and widely available on Google if you have
to write your own version.

–ryan.