Go to the documentation of this file.
43 int bpp, bpp_reference;
46 int sampleErrorX = 0, sampleErrorY = 0, sampleDist = 0;
49 char imageFilename[128];
50 char referenceFilename[128];
63 if (allowable_error<0) {
71 bpp =
surface->format->BytesPerPixel;
83 dist += (R-Rd)*(R-Rd);
84 dist += (
G-Gd)*(
G-Gd);
85 dist += (B-Bd)*(B-Bd);
88 if (dist > allowable_error) {
105 SDLTest_LogError(
"Comparison of pixels with allowable error of %i failed %i times.", allowable_error, ret);
106 SDLTest_LogError(
"First detected occurrence at position %i,%i with a squared RGB-difference of %i.", sampleErrorX, sampleErrorY, sampleDist);
111 SDLTest_LogError(
"Surfaces from failed comparison saved as '%s' and '%s'", imageFilename, referenceFilename);
#define SDL_UnlockSurface
A collection of pixels used in software blitting.
static SDL_Surface * referenceSurface
static int _CompareSurfaceCount
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
Compares a surface and with reference image data for equality.
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(1)
Prints given message with a timestamp in the TEST category and the ERROR priority.
#define SDL_SaveBMP(surface, file)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)