CRM32Pro SDK
v5.22
|
IScreenFX. More...
IScreenFX.
Screen FX interface system.
Public Member Functions | |
int | Blur (SDL_Surface *surface, int blur_pct) |
Add blur to given surface. More... | |
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. More... | |
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. More... | |
SDL_Surface * | Flip (SDL_Surface *src, SDL_Rect *src_rect=NULL, SDL_Surface *dst=NULL, SDL_Rect *dst_rect=NULL) |
Surface flip. More... | |
int | GammaCorrect (SDL_Surface *surface, int r, int g, int b) |
Set gamma to given surface using RGB. More... | |
SDL_Surface * | Mirror (SDL_Surface *src, SDL_Rect *src_rect=NULL, SDL_Surface *dst=NULL, SDL_Rect *dst_rect=NULL) |
Surface mirror. More... | |
int | Noise (SDL_Surface *surface, int noise_pct) |
Add noise to given surface. More... | |
void | RenderFX (SDL_Surface *src, SDL_Surface *dst, int effect) |
Render simple special fx per surface. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int CRM32Pro_IScreenFX::Blur | ( | SDL_Surface * | surface, |
int | blur_pct | ||
) |
Add blur to given surface.
Not supported on OpenGL modes.
surface | surface to apply blur effect |
blur_pct | value of noise to add (0-100) |
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.
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. |
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.
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. |
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.
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. |
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.
surface | surface to apply gamma filter |
r | red component |
g | green component |
b | blue component |
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.
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. |
int CRM32Pro_IScreenFX::Noise | ( | SDL_Surface * | surface, |
int | noise_pct | ||
) |
Add noise to given surface.
Not supported on OpenGL modes
surface | surface to apply noise effect |
noise_pct | value of noise to add (0-100) |
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)
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.
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. |
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.
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. |
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.
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. |
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.
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. |