Pitch in SDL_CreateRGBSurfaceFrom

Hey

I consider making a small library binding OpenCV/IPL (Intels Open Computer
Vision Library) with SDL.
The idea is to make it easy and simple to blit images from OpenCV to a
accelerated window (this works pretty poorly in OpenCV’s gui part).
I have not been able to find any of this, but if it exists, I would like to
know before I waste my time :slight_smile:

IPL stores the imagedata like SDL, with the color channels interleaved and
and a pitch on the end of every ImageLine.
All the info needed for SDL_CreateRGBSurfaceFrom is contained in the IPL
header.
Clearly I try to avoid any dataconversion.
Performance for the OpenCV/IPL part is more inportant to me, than
performance for the SDL part.

My questions is:

In IPL the pitch exists for performance reasons of loops, MMX and the like.
As I understand the pitch in SDL exists to enhance performance of blits. In
SDL_CreateRGBSurfaceFrom you can set the pitch arbitrary, but what are the
consequenses of setting another pitch in an SDL_Surface than the one that
would be set automatically by SDL_CreateSurface? Purely performance?

How can I create a SDL_Surface with the same pixelformat as the IPL image
from existing pixeldata?

Thx
Martin