Public Member Functions

CRM32Pro_IScreenFX Class Reference
[MODULE 9: IScreenFX v4.70, 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.
void RenderFX (SDL_Surface *src, SDL_Surface *dst, int effect)
 Render simple special fx per 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 * 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 * 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.
This method work on two different ways: with dst it will only render the output to that surface and without it, it will return a new flipped surface.

Parameters:
src source surface
src_rect Rect to flip on the source surface. NULL to flip the whole surface.
dst Destination surface used to blit there the flipped surface. It will also avoid to create a new surface. With OpenGL modes, it will always blit 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.
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.
This method work on two different ways: with dst it will only render the output to that surface and without it, it will return a new mirrored surface.

Parameters:
src source surface
src_rect Rect to mirror on the source surface. NULL to mirror the whole surface.
dst Destination surface used to blit there the mirrored surface. It will also avoid to create a new surface. With OpenGL modes, it will always blit 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.
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
void CRM32Pro_IScreenFX::RenderFX ( SDL_Surface *  src,
SDL_Surface *  dst,
int  iFX 
)

Render simple special fx per surface.

Note it needs a fast CPU.
In OpenGL modes some effects are disabled (check FXSCREEN_xx definition)

Parameters:
src source surface to do the selected special fx
dst destination surface to dump the selected special fx. In OpenGL modes, itīs useless as always blits to CRM32Pro.screen
iFX type of special fx to apply. See FXSCREEN_xx definition.
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.
This method work on two different ways: with dst it will only render the output to that surface and without it, it will return a new resized surface.

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 blit there the resized surface. It will also avoid to create a new surface. With OpenGL modes, it will always blit 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.
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,
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.
This method work on two different ways: with dst it will only render the output to that surface and without it, it will return a new resized surface.

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 blit there the resized surface. It will also avoid to create a new surface. With OpenGL modes, it will always blit 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.
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.
This method work on two different ways: with dst it will only render the output to that surface and without it, it will return a new rotated surface.

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 blit there the rotated surface. It will also avoid to create a new surface. With OpenGL modes, it will always blit 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.
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.
This method work on two different ways: with dst it will only render the output to that surface and without it, it will return a new rotated/resized surface.

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 blit there the rotated/resized surface. It will also avoid to create a new surface. With OpenGL modes, it will always blit 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.
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:
 All Classes Functions Variables