SDL_stretch - 0.3.0

extern unsigned char*    SDL_GetRowStretchCode    (void)
extern unsigned char*    SDL_NewRowStretchCode    (unsigned size)
unsigned char*    SDL_SetRowStretchCode    (int src_w, int dst_w, int bpp)
unsigned char*    SDL_PutRowStretchCode    (unsigned char* buffer, int buflen, int src_w, int dst_w, int bpp)
void    SDL_RunRowStretchCode    (unsigned char* buffer, unsigned char* src, unsigned char* dst)
void    SDL_StretchRow1    (Uint8 *src, int src_w, Uint8 *dst, int dst_w)
void    SDL_StretchRow2    (Uint16 *src, int src_w, Uint16 *dst, int dst_w)
void    SDL_StretchRow3    (Uint8 *src, int src_w, Uint8 *dst, int dst_w)
void    SDL_StretchRow4    (Uint32 *src, int src_w, Uint32 *dst, int dst_w)
extern char*    SDL_StretchInfo    (void)
extern char*    SDL_StretchRowInfo    (void)
extern int    SDL_StretchSurfaceBlit    (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
extern int    SDL_StretchSurfaceRect    (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
extern int    SDL_StretchSurface_23    (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)

Documentation

extern unsigned char*
SDL_GetRowStretchCode   (void)
extern unsigned char*
SDL_NewRowStretchCode   (unsigned size)
 (/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretchcode.h)


TheRowStretchCode is a shared buffer between Stretch-routines that
use no extra buffer-argument. You should call SDL_SetRowStretchCode
to fill this internal buffer and set a "call"-operation for your target
cpu to execute this static buffer. That is done for effiency
as the RowStretch is often called in a tight loop for each Row
in a rectengular stretch and it is best to not use a variable
argument with an indirect call or a function call that would
build up a callframe and release that callframe later.

If you do not need that effiency, use PutRowStretchCode and RunRowStretchCode
which are also good in a multithreading environment. To allocate a new buffer
for usage with Put/Run you can use the NewRowStretchCode routine which is
also used on NX machines (e.g. AMD64) where the data segment is set to be
not-executable (in that case it will allocate from heap and use mprotect).
if the argument is 0 then a buffer of the default size is allocated. If the
buffer allocation (or mprotect) fails it will return NULL and SDL_SetError.

SDL_NewRowStretchCode -

(/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretchcode.h)

unsigned char*
SDL_SetRowStretchCode   (int src_w, int dst_w, int bpp)
unsigned char*
SDL_PutRowStretchCode   (unsigned char* buffer, int buflen, int src_w, int dst_w, int bpp)
void
SDL_RunRowStretchCode   (unsigned char* buffer, unsigned char* src, unsigned char* dst)
void
SDL_StretchRow1   (Uint8 *src, int src_w, Uint8 *dst, int dst_w)
void
SDL_StretchRow2   (Uint16 *src, int src_w, Uint16 *dst, int dst_w)
void
SDL_StretchRow3   (Uint8 *src, int src_w, Uint8 *dst, int dst_w)
void
SDL_StretchRow4   (Uint32 *src, int src_w, Uint32 *dst, int dst_w)
 (/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretchcode.h)


The SetRowStretchCode is a wrapper around PutRowStretchCode that
uses the Adress and Size of the shared SDL_TheRowStretchCode buffer.
The PutRowStretchCode will fill the given buffer with an assembler
stream that should be called with SDL_RunRowStretchCode. The
assembler stream is usually faster as all the scale decisions are
done in advance of the execution. This helps when a RunCode is
done multiple times with the same src_w/dst_w/bpp pair. All the
pixel-get and pixel-set calls are unrolled in that buffer. Therefore,
the buffer should be big enough - as a rule of thumb use a buffer
of size (src_w+dst_w)*5

If PutCode or SetCode fails, a NULL is returned and SDL_SetError.
Otherwise, the start adress of the machine code buffer is returned,
which is also the input argument of PutCode and RunCode.

SDL_PutRowStretchCode -

SDL_RunRowStretchCode -


If SDL_SetRowStretchCode fails, the SDL_StretchRow1 function must be used instead.
The SDL_StretchRow1 function and its cousins are singular routines that work in
a tight loop to scale a single row. The number specifies the
byte-width of each pixel (it is not a bit-width!).

SDL_StretchRow2 -

SDL_StretchRow3 -

SDL_StretchRow4 -

(/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretchcode.h)

extern char*
SDL_StretchInfo   (void)
 (/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretch.h)


return some informative information.

(/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretch.h)

extern char*
SDL_StretchRowInfo   (void)
 (/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretchcode.h)


return some informative information.

(/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretchcode.h)

extern int
SDL_StretchSurfaceBlit   (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
  Perform a stretch blit between two surfaces of the same format.


NOTE: The SDL_StretchSurfaceBlit function is not safe to call from multiple threads!

The SDL_StretchSurfaceBlit function will stretch a srcrect smoothly to the full area of
the dst surface. If no srcrect is given then the full area of the
src surface is stretched smoothly to the full dst surface. The
dstrect is ignored always.

Remember that this is the inverse meaning, the main SDL lib will
ignore the srcrect and only watch for the dstrect if any.

(/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretch.h)

extern int
SDL_StretchSurfaceRect   (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
  Perform a stretch blit between two surfaces of the same format.


NOTE: The SDL_StretchSurfaceRect function is not safe to call from multiple threads!

The SDL_StretchSurfaceRect function will stretch a srcrect smoothly to the full area of
the dst surface. If no srcrect is given then the full area of the
src surface is stretched smoothly to the full dst surface. The
dstrect is ignored always.

The SDL_StretchSurfaceRect function will also watch for a clip rectangle on the src
surface. This may speed up handling in your programs by creating
a larger src surface with an associated viewframe, and the srcrect
argument needs not be recomputed.

(/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretch.h)

extern int
SDL_StretchSurface_23   (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
 (/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretch.h)


The SDL_StretchSurface_23 function will stretch to 150%. This is not only a fast function
but it is also safe to call from multiple threads. If the srcrect
is given then only that rect is copied. Otherwise the full src
surface is copied to the full dst surface. The dstrect is ignored.

(/vol/8/src/cvs/workspace/SDL_stretch/SDL_stretch.h)