How to reverse an image

Is there a way in SDL to “reverse” and image, as in flip it
horizontally? Ex; > becomes < ?

One way is to blit it in 1-pixel-wide stripes.
Read from (x,0) and write to (dest_x + (width - 1 - i), dest_y)…On Fri, Nov 30, 2007 at 03:00:50PM -0600, Michael Sullivan wrote:

Is there a way in SDL to “reverse” and image, as in flip it
horizontally? Ex; > becomes < ?


-bill!
bill at newbreedsoftware.com
http://www.newbreedsoftware.com/

Yes, one way to do it is like Bill explained. I’ve made my own flipping
function before. LazyFoo has a good example in his tutorials.
http://lazyfoo.net/SDL_tutorials/lesson31/index.php

For an easy way out, you can use the sdl_gfx library, but if all you need is
flipping, writing your own little function is probably better as you wont
have extra dependancies.

Also, code to invert an image has been posted before:

http://lists.libsdl.org/pipermail/sdl-libsdl.org/2002-September/030534.html

-Eric