CRM32Pro_IScreenFX Class Reference
[MODULE 9: IScreenFX v4.60, screen FX interface.]

IScreenFX. More...


Detailed Description

IScreenFX.

Screen FX interface system.

List of all members.

Public Member Functions

int Blur (SDL_Surface *surface, int blur_pct)
 Add blur to given surface.
int FadeToColor (unsigned char r, unsigned char g, unsigned char b, unsigned int ms, SDL_Rect *rdst=NULL)
 Fade current CRM32Pro.screen surface to given color using alpha channel in the given time.
int FadeToImage (SDL_Surface *surface, unsigned int ms, SDL_Rect *rdst=NULL, SDL_Rect *rsrc=NULL)
 Fade to given surface from CRM32Pro.screen surface using alpha channel in the given time.
SDL_Surface * Flip (SDL_Surface *src, SDL_Rect *src_rect=NULL, SDL_Surface *dst=NULL, SDL_Rect *dst_rect=NULL)
 Surface flip.
int GammaCorrect (SDL_Surface *surface, int r, int g, int b)
 Set gamma to given surface using RGB.
SDL_Surface * Mirror (SDL_Surface *src, SDL_Rect *src_rect=NULL, SDL_Surface *dst=NULL, SDL_Rect *dst_rect=NULL)
 Surface mirror.
int Noise (SDL_Surface *surface, int noise_pct)
 Add noise to given surface.
SDL_Surface * Resize (SDL_Surface *src, SDL_Rect *src_rect, int smooth, int sx, int sy, SDL_Surface *dst=NULL, SDL_Rect *dst_rect=NULL)
 Resize a surface.
SDL_Surface * Resize (SDL_Surface *src, SDL_Rect *src_rect, int smooth, double fx, double fy, SDL_Surface *dst=NULL, SDL_Rect *dst_rect=NULL)
 Resize a surface.
SDL_Surface * Rotate (SDL_Surface *src, SDL_Rect *src_rect, int smooth, double angle, SDL_Surface *dst=NULL, SDL_Rect *dst_rect=NULL)
 Rotate a surface.
SDL_Surface * RotateResize (SDL_Surface *src, SDL_Rect *src_rect, int smooth, double angle, double zoom, SDL_Surface *dst=NULL, SDL_Rect *dst_rect=NULL)
 Rotate and resize a surface.

Member Function Documentation

int CRM32Pro_IScreenFX::Blur ( SDL_Surface *  surface,
int  blur_pct 
)

Add blur to given surface.

Not supported on OpenGL modes.

Parameters:
surface surface to apply blur effect
blur_pct value of noise to add (0-100)
Returns:
0 Failed
1 Ok
int CRM32Pro_IScreenFX::FadeToColor ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned int  ms,
SDL_Rect *  rdst = NULL 
)

Fade current CRM32Pro.screen surface to given color using alpha channel in the given time.

Parameters:
r red component(0-255) of the desired color to fade.
g green component(0-255) of the desired color to fade.
b blue component(0-255) of the desired color to fade.
ms duration in milliseconds to perform the fade.
rdst optional pointer to SDL_Rect with the area of CRM32Pro.screen where to perform the fade.By default, the whole surface.
Returns:
0 Failed
1 Ok
Examples:
Example03_GUI.cpp, and SpacePong.cpp.
int CRM32Pro_IScreenFX::FadeToImage ( SDL_Surface *  surface,
unsigned int  ms,
SDL_Rect *  rdst = NULL,
SDL_Rect *  rsrc = NULL 
)

Fade to given surface from CRM32Pro.screen surface using alpha channel in the given time.

Parameters:
surface surface to blend with screen. You can not use CRM32Pro.screen in this parameter. This surface can not have alpha per-pixel.
ms duration in milliseconds to perform the fade.
rdst optional pointer to SDL_Rect with the area of CRM32Pro.screen where to perform the fade.By default, the whole surface.
rsrc optional pointer to SDL_Rect with the area of given surface to be used to perform the fade.By default, the whole surface.
Returns:
0 Failed
1 Ok
Examples:
SpacePong.cpp.
SDL_Surface * CRM32Pro_IScreenFX::Flip ( SDL_Surface *  src,
SDL_Rect *  src_rect = NULL,
SDL_Surface *  dst = NULL,
SDL_Rect *  dst_rect = NULL 
)

Surface flip.

All color depth are very fast.
If dst is used, it has to match the color depth of src surface. Otherwise, it will not render anything.
With OpenGL modes it never uses dst surface, it always blits the flipped surface using dst_rect to CRM32Pro.screen.

Parameters:
src source surface
src_rect Rect to flip on the source surface. NULL to flip the whole surface.
dst Destination surface used to render the result on it without create a new surface. By default is NULL to create a new surface, however with OpenGL modes, itīs useless as always blits to CRM32Pro.screen.
dst_rect Rect on the destination surface(only x and y are used) to render the result. Only has sense used together with dst or OpenGL modes.
Returns:
NULL Failed. Note that with OpenGL modes it always returns NULL.
any other value, the pointer to a new flipped surface or if dst was specified, it will return dst(just to check it worked)
int CRM32Pro_IScreenFX::GammaCorrect ( SDL_Surface *  surface,
int  r,
int  g,
int  b 
)

Set gamma to given surface using RGB.

Not supported on OpenGL modes.

Parameters:
surface surface to apply gamma filter
r red component
g green component
b blue component
Returns:
0 Failed
1 Ok
SDL_Surface * CRM32Pro_IScreenFX::Mirror ( SDL_Surface *  src,
SDL_Rect *  src_rect = NULL,
SDL_Surface *  dst = NULL,
SDL_Rect *  dst_rect = NULL 
)

Surface mirror.

All color depth are fast.
If dst is used, it has to match the color depth of src surface. Otherwise, it will not render anything.
With OpenGL modes it never uses dst surface, it always blits the mirrored surface using dst_rect to CRM32Pro.screen.

Parameters:
src source surface
src_rect Rect to mirror on the source surface. NULL to mirror the whole surface.
dst Destination surface used to render the result on it without create a new surface. By default is NULL to create a new surface, however with OpenGL modes, itīs useless as always blits to CRM32Pro.screen.
dst_rect Rect on the destination surface(only x and y are used) to render the result. Only has sense used together with dst or OpenGL modes.
Returns:
NULL Failed. Note that with OpenGL modes it always returns NULL.
any other value, the pointer to a new mirror surface or if dst was specified, it will return dst(just to check it worked)
int CRM32Pro_IScreenFX::Noise ( SDL_Surface *  surface,
int  noise_pct 
)

Add noise to given surface.

Not supported on OpenGL modes

Parameters:
surface surface to apply noise effect
noise_pct value of noise to add (0-100)
Returns:
0 Failed
1 Ok
SDL_Surface * CRM32Pro_IScreenFX::Resize ( SDL_Surface *  src,
SDL_Rect *  src_rect,
int  smooth,
int  sx,
int  sy,
SDL_Surface *  dst = NULL,
SDL_Rect *  dst_rect = NULL 
)

Resize a surface.

8bits and 32bits surfaces are very fast. 16bits surfaces are fast and 24bits are slower.
If dst is used, it has to match the color depth of src surface. Otherwise, it will not render anything.
With OpenGL modes it never uses dst surface, it always blits the resized surface using dst_rect to CRM32Pro.screen.

Parameters:
src source surface
src_rect Resize rect in the source surface. NULL to resize the whole surface.
smooth 0 to do nothing. 1 to perform anti-aliasing filter(best quality and slower). It has no sense on 8bits surfaces.
sx Desired width in pixels for the resized surface. Negative value to flip this axis(does not work with smooth filter).
sy Desired height in pixels for the resized surface. Negative value to flip this axis(does not work with smooth filter).
dst Destination surface used to render the result on it without create a new surface. By default is NULL to create a new surface, however with OpenGL modes, itīs useless as always blits to CRM32Pro.screen.
dst_rect Rect on the destination surface(only x and y are used) to render the result. Only has sense used together with dst or OpenGL modes.
Returns:
NULL Failed. Note that with OpenGL modes it always returns NULL.
any other value, the pointer to a new resized surface or if dst was specified, it will return dst(just to check it worked)
SDL_Surface * CRM32Pro_IScreenFX::Resize ( SDL_Surface *  src,
SDL_Rect *  src_rect,
int  smooth,
double  fx,
double  fy,
SDL_Surface *  dst = NULL,
SDL_Rect *  dst_rect = NULL 
)

Resize a surface.

8bits and 32bits surfaces are very fast. 16bits surfaces are fast and 24bits are slower.
If dst is used, it has to match the color depth of src surface. Otherwise, it will not render anything.
With OpenGL modes it never uses dst surface, it always blits the resized surface using dst_rect to CRM32Pro.screen.

Parameters:
src source surface
src_rect Resize rect in the source surface. NULL to resize the whole surface.
smooth 0 to do nothing. 1 to perform anti-aliasing filter(best quality and slower). It has no sense on 8bits surfaces.
fx Resize factor in X axis. Example: 1.0 means to do nothing. Negative value to flip this axis(does not work with smooth filter).
fy Resize factor in Y axis. Example: 2.0 means to duplicate this coordinate. Negative value to flip this axis(does not work with smooth filter).
dst Destination surface used to render the result on it without create a new surface. By default is NULL to create a new surface, however with OpenGL modes, itīs useless as always blits to CRM32Pro.screen.
dst_rect Rect on the destination surface(only x and y are used) to render the result. Only has sense used together with dst or OpenGL modes.
Returns:
NULL Failed. Note that with OpenGL modes it always returns NULL.
any other value, the pointer to a new resized surface or if dst was specified, it will return dst(just to check it worked)
SDL_Surface * CRM32Pro_IScreenFX::Rotate ( SDL_Surface *  src,
SDL_Rect *  src_rect,
int  smooth,
double  angle,
SDL_Surface *  dst = NULL,
SDL_Rect *  dst_rect = NULL 
)

Rotate a surface.

8bits and 32bits surfaces are fast. 16bits surfaces are normal speed and 24bits are slower.
If dst is used, it has to match the color depth of src surface. Otherwise, it will not render anything.
With OpenGL modes it never uses dst surface, it always blits the resized surface using dst_rect to CRM32Pro.screen.

Parameters:
src source surface
src_rect Rect to rotate on the source surface. NULL to rotate the whole surface.
smooth 0 to do nothing. 1 to perform anti-aliasing filter(best quality and slower). It has no sense on 8bits surfaces.
angle Desired rotation on degrees
dst Destination surface used to render the result on it without create a new surface. By default is NULL to create a new surface, however with OpenGL modes, itīs useless as always blits to CRM32Pro.screen.
dst_rect Rect on the destination surface(only x and y are used) to render the result. Only has sense used together dst or OpenGL modes.
Returns:
NULL Failed. Note that with OpenGL modes it always returns NULL.
any other value, the pointer to a new rotated surface or if dst was specified, it will return dst(just to check it worked)
SDL_Surface * CRM32Pro_IScreenFX::RotateResize ( SDL_Surface *  src,
SDL_Rect *  src_rect,
int  smooth,
double  angle,
double  zoom,
SDL_Surface *  dst = NULL,
SDL_Rect *  dst_rect = NULL 
)

Rotate and resize a surface.

8bits and 32bits surfaces are fast. 16bits surfaces are normal speed and 24bits are slower.
If dst is used, it has to match the color depth of src surface. Otherwise, it will not render anything.
With OpenGL modes it never uses dst surface, it always blits the resized surface using dst_rect to CRM32Pro.screen.

Parameters:
src source surface
src_rect Rect to rotate/resize on the source surface. NULL to rotate/resize the whole surface.
smooth 0 to do nothing. 1 to perform anti-aliasing filter(best quality and slower). It has no sense on 8bits surfaces.
angle Desired rotation in degrees
zoom Resize factor in X and Y axes. Examples: 1.0 means to do nothing. 2.0 means to duplicate both axes.
dst Destination surface used to render the result on it without create a new surface. By default is NULL to create a new surface, , however with OpenGL modes, itīs useless as always blits to CRM32Pro.screen.
dst_rect Rect on the destination surface(only x and y are used) to render the result. Only has sense used together dst or OpenGL modes.
Returns:
NULL Failed. Note that with OpenGL modes it always returns NULL.
any other value, the pointer to a new rotated/resized surface or if dst was specified, it will return dst(just to check it worked)

The documentation for this class was generated from the following files:

Generated on Mon Dec 21 17:04:40 2009 for CRM32Pro SDK v5.00 by  doxygen 1.6.1