SDL 3.0
|
Go to the source code of this file.
Functions | |
int | SDLTest_ReadSurfacePixel (SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) |
int | SDLTest_CompareSurfaces (SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error) |
Comparison function of SDL test framework.
This code is a part of the SDL test library, not the main SDL library.
Definition in file SDL_test_compare.h.
int SDLTest_CompareSurfaces | ( | SDL_Surface * | surface, |
SDL_Surface * | referenceSurface, | ||
int | allowable_error | ||
) |
Compares a surface and with reference image data for equality
surface | Surface used in comparison |
referenceSurface | Test Surface used in comparison |
allowable_error | Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. |
int SDLTest_ReadSurfacePixel | ( | SDL_Surface * | surface, |
int | x, | ||
int | y, | ||
Uint8 * | r, | ||
Uint8 * | g, | ||
Uint8 * | b, | ||
Uint8 * | a | ||
) |
Retrieves a single pixel from a surface.
This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.
Like SDL_GetRGBA, this uses the entire 0..255 range when converting color components from pixel formats with less than 8 bits per RGB component.
surface | The surface |
x | Horizontal coordinate, 0 <= x < width |
y | Vertical coordinate, 0 <= y < height |
r | Pointer to location to store red channel, 0-255 |
g | Pointer to location to store green channel, 0-255 |
b | Pointer to location to store blue channel, 0-255 |
a | Pointer to location to store alpha channel, 0-255 |