[SDL] Convert opencv IplImage * to SDL_Texture * (SDL 1.3)

Justin Coleman jmcoleman at gmail.com
Sat Jul 17 17:32:51 PDT 2010


I think I have some old code for accessing opencv images, I could post
it Monday if you like, assuming you don't get anything better before
then.

On Sat, Jul 17, 2010 at 8:18 PM, Alex Barry <alex.barry at gmail.com> wrote:
> Well, I bit the bullet and decided to work on some software using SDL 1.3
> I'm under the impression that to render to a window, you need to use
> textures.  Well, after searching the wiki and SDL_video.h, there doesn't
> seem to be a way to directly access pixels from a texture to convert an
> image.  I noticed there seems to be a lot of code that still uses
> SDL_Surface * and even found a a function that converts a surface to a
> texture.  Is that the proper way to do things, so does anyone have a
> suggestion?
> I'm using opencv to capture a webcam and do some shape tracking, but I find
> SDL has much better event handling and graphic display.
> I'm also not sure of the pixel format from the IplImage - I did a few
> searches and the best I hear is that it is BGR format...SDL_Texture has some
> options to use that, but I'm not sure what BGR format it is (the wiki lists
> a few different versions...)
>
> Any help would be appreciated.
> Take care,
> -Alex
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>



More information about the SDL mailing list