SDL_gfx: I:/Sources/sdlgfx/SDL_gfxBlitFunc.c File Reference

SDL_gfx 2.0.25

- Main Page
- Data Structures
- Files

- File List
- Globals

Functions | Variables
I:/Sources/sdlgfx/SDL_gfxBlitFunc.c File Reference
`#include "SDL_gfxBlitFunc.h"`

Go to the source code of this file.

## Functions
void | _SDL_gfxBlitBlitterRGBA (SDL_gfxBlitInfo *info)
| Internal blitter using adjusted destination alpha during RGBA->RGBA blits.
int | _SDL_gfxBlitRGBACall (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
| Internal blitter setup wrapper for RGBA->RGBA blits.
int | SDL_gfxBlitRGBA (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
| Blitter for RGBA->RGBA blits with alpha adjustment.
int | SDL_gfxSetAlpha (SDL_Surface *src, Uint8 a)
| Sets the alpha channel in a 32 bit surface.
int | SDL_gfxMultiplyAlpha (SDL_Surface *src, Uint8 a)
| Multiply the alpha channel in a 32bit surface.
## Variables
const unsigned int | GFX_ALPHA_ADJUST_ARRAY [256]
| Alpha adjustment table for custom blitter.

## Function Documentation

void _SDL_gfxBlitBlitterRGBA | ( | SDL_gfxBlitInfo * | info | ) |

Internal blitter using adjusted destination alpha during RGBA->RGBA blits.

Performs the blit based on the 'info' structure and applies the transfer function to the destination 'a' values.

Parameters:

  info | The blit info to use.

Definition at line 306 of file SDL_gfxBlitFunc.c.

int _SDL_gfxBlitRGBACall | ( | SDL_Surface * | src,
|  | SDL_Rect * | srcrect,
|  | SDL_Surface * | dst,
|  | SDL_Rect * | dstrect
| ) |  |

Internal blitter setup wrapper for RGBA->RGBA blits.

Sets up the blitter info based on the 'src' and 'dst' surfaces and rectangles.

Parameters:

  src | The source surface.
  srcrect | The source rectangle.
  dst | The destination surface.
  dstrect | The destination rectangle.

Returns:
  Returns 1 if blit was performed, 0 otherwise.

Definition at line 356 of file SDL_gfxBlitFunc.c.

int SDL_gfxBlitRGBA | ( | SDL_Surface * | src,
|  | SDL_Rect * | srcrect,
|  | SDL_Surface * | dst,
|  | SDL_Rect * | dstrect
| ) |  |

Blitter for RGBA->RGBA blits with alpha adjustment.

Verifies the input 'src' and 'dst' surfaces and rectangles and performs blit. The destination clip rectangle is honored.

Parameters:

  src | The source surface.
  srcrect | The source rectangle.
  dst | The destination surface.
  dstrect | The destination rectangle.

Returns:
  Returns 1 if blit was performed, 0 otherwise, or -1 if an error occured.

Definition at line 411 of file SDL_gfxBlitFunc.c.

int SDL_gfxMultiplyAlpha | ( | SDL_Surface * | src,
|  | Uint8 | a
| ) |  |

Multiply the alpha channel in a 32bit surface.

Helper function that multiplies the alpha channel in a 32 bit surface with a constant value. The final alpha is always scaled to the range 0-255 (i.e. the factor is a/256).

Only 32 bit surfaces can be used with this function.

Parameters:

  src | Pointer to the target surface to change.
  a | The alpha value to multiply with. When a is 255, this function is a NoOp.

Returns:
  Returns 1 if alpha was changed, 0 otherwise. Returns -1 if input surface is invalid.

Definition at line 587 of file SDL_gfxBlitFunc.c.

int SDL_gfxSetAlpha | ( | SDL_Surface * | src,
|  | Uint8 | a
| ) |  |

Sets the alpha channel in a 32 bit surface.

Helper function that sets the alpha channel in a 32 bit surface to a constant value. Only 32 bit surfaces can be used with this function.

Parameters:

  src | Pointer to the target surface to change.
  a | The alpha value to set.

Returns:
  Returns 1 if alpha was changed, -1 otherwise.

Definition at line 524 of file SDL_gfxBlitFunc.c.

## Variable Documentation

const unsigned int GFX_ALPHA_ADJUST_ARRAY[256]

Alpha adjustment table for custom blitter.

The table provides values for a modified, non-linear transfer function which maintain brightness.

Definition at line 39 of file SDL_gfxBlitFunc.c.