visualtest/include/SDL_visualtest_screenshot.h
author Philipp Wiesemann
Mon, 07 Dec 2015 21:43:16 +0100
changeset 9955 cd98cb69906d
parent 7924 fcb86d323770
child 11382 2c50e79b19e0
permissions -rw-r--r--
Fixed outdated information in README for test programs.

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