zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_stretch.c File Reference
#include "SDL_config.h"
#include "SDL_video.h"
#include "SDL_blit.h"

Go to the source code of this file.

Macros

#define DEFINE_COPY_ROW(name, type)
 

Functions

static void copy_row3 (Uint8 *src, int src_w, Uint8 *dst, int dst_w)
 
int SDL_SoftStretch (SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect)
 Perform a fast, low quality, stretch blit between two surfaces of the same pixel format. More...
 

Macro Definition Documentation

#define DEFINE_COPY_ROW (   name,
  type 
)
Value:
static void name(type *src, int src_w, type *dst, int dst_w) \
{ \
int pos, inc; \
type pixel = 0; \
\
pos = 0x10000; \
inc = (src_w << 16) / dst_w; \
for ( i=dst_w; i>0; --i ) { \
while ( pos >= 0x10000L ) { \
pixel = *src++; \
pos -= 0x10000L; \
} \
*dst++ = pixel; \
pos += inc; \
} \
}
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
Definition: gl2ext.h:845
EGLImageKHR EGLint * name
Definition: eglext.h:284
GLenum GLenum dst
Definition: glew.h:2396
int
Definition: SDL_systhread.c:37
for(;;)
GLenum src
Definition: glew.h:2396
int i
Definition: pngrutil.c:1377
while(1)

Definition at line 151 of file SDL_stretch.c.

Function Documentation

static void copy_row3 ( Uint8 src,
int  src_w,
Uint8 dst,
int  dst_w 
)
static

Definition at line 177 of file SDL_stretch.c.

References i.

Referenced by SDL_SoftStretch().

int SDL_SoftStretch ( SDL_Surface src,
const SDL_Rect srcrect,
SDL_Surface dst,
const SDL_Rect dstrect 
)

Perform a fast, low quality, stretch blit between two surfaces of the same pixel format.

Note
This function uses a static buffer, and is not thread-safe.

Definition at line 203 of file SDL_stretch.c.

References SDL_PixelFormat::BytesPerPixel, copy_row3(), SDL_Surface::format, SDL_PixelFormat::format, SDL_Rect::h, SDL_Surface::h, if(), NULL, SDL_Surface::pitch, SDL_Surface::pixels, pop, SDL_FALSE, SDL_LockSurface(), SDL_MUSTLOCK, SDL_SetError(), SDL_TRUE, SDL_UnlockSurface(), SDL_Rect::w, SDL_Surface::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by SDL_LowerBlitScaled(), and SDL_SW_CopyYUVToRGB().