cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

SDL_visualtest_screenshot.h (1408B)


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