SDL_visualtest_screenshot.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* See COPYING.txt for the full license governing this code. */
  2. /**
  3. * \file SDL_visualtest_screenshot.h
  4. *
  5. * Header for the screenshot API.
  6. */
  7. #include "SDL_visualtest_process.h"
  8. #ifndef _SDL_visualtest_screenshot_h
  9. #define _SDL_visualtest_screenshot_h
  10. /* Set up for C function definitions, even when using C++ */
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /**
  15. * Takes a screenshot of each window owned by the process \c pinfo and saves
  16. * it in a file \c prefix-i.png where \c prefix is the full path to the file
  17. * along with a prefix given to each screenshot.
  18. *
  19. * \return 1 on success, 0 on failure.
  20. */
  21. int SDLVisualTest_ScreenshotProcess(SDL_ProcessInfo* pinfo, char* prefix);
  22. /**
  23. * Takes a screenshot of the desktop and saves it into the file with path
  24. * \c filename.
  25. *
  26. * \return 1 on success, 0 on failure.
  27. */
  28. int SDLVisualTest_ScreenshotDesktop(char* filename);
  29. /**
  30. * Compare a screenshot taken previously with SUT arguments \c args that is
  31. * located in \c test_dir with a verification image that is located in
  32. * \c verify_dir.
  33. *
  34. * \return -1 on failure, 0 if the images were not equal, 1 if the images are equal
  35. * and 2 if the verification image is not present.
  36. */
  37. int SDLVisualTest_VerifyScreenshots(char* args, char* test_dir, char* verify_dir);
  38. /* Ends C function definitions when using C++ */
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif /* _SDL_visualtest_screenshot_h */