mirror of
https://github.com/bspeice/libcvautomation
synced 2025-07-01 13:56:49 -04:00
Fix up the build process in preparation for release 1.0
This commit is contained in:
59
include/opencv1/libcvautomation/libcvautomation.h
Normal file
59
include/opencv1/libcvautomation/libcvautomation.h
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: libcvautomation.h
|
||||
*
|
||||
* Description: Include wrapper for libcvautomation subsections
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: 06/21/2012 12:20:43 PM
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: Bradlee Speice (), bspeice.nc@gmail.com
|
||||
* Organization:
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
#ifndef LIBCVAUTOMATION_H
|
||||
#define LIBCVAUTOMATION_H
|
||||
|
||||
/* C includes */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* OpenCV includes */
|
||||
#include <opencv/cv.h>
|
||||
#include <opencv/highgui.h>
|
||||
|
||||
/* X11 includes */
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
|
||||
/* Define a basic structure to help us with using multiple-picture arguments
|
||||
* Yes, it's a hackish implementation, nobody said you had to use this one. */
|
||||
typedef struct {
|
||||
/* Use one or the other of fileName or cvaImage - cvaImage takes priority */
|
||||
IplImage *cvaImage;
|
||||
char *fileName;
|
||||
|
||||
CvPoint resultPoint;
|
||||
int searchMethod;
|
||||
int tolerance;
|
||||
|
||||
} cvautomationList;
|
||||
|
||||
/* Define another basic structure for points */
|
||||
typedef struct {
|
||||
int x, y;
|
||||
} cvaPoint;
|
||||
|
||||
/* Project component includes */
|
||||
/* The includes come here to make sure all function prototypes have access
|
||||
* to the cvautomationList struct */
|
||||
#include <libcvautomation/libcvautomation-opencv.h>
|
||||
#include <libcvautomation/libcvautomation-xlib.h>
|
||||
#include <libcvautomation/libcvautomation-xtest.h>
|
||||
|
||||
#endif /* LIBCVAUTOMATION_H */
|
56
include/opencv2/libcvautomation/libcvautomation-opencv.h
Normal file
56
include/opencv2/libcvautomation/libcvautomation-opencv.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: libcvautomation-opencv.h
|
||||
*
|
||||
* Description: Function definitions for opencv functionality
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: 06/21/2012 08:34:21 AM
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: Bradlee Speice, bspeice@uncc.edu
|
||||
* Organization: MOSAIC at University of North Carolina at Charlotte
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
#ifndef LIBCVAUTOMATION_OPENCV_H
|
||||
#define LIBCVAUTOMATION_OPENCV_H
|
||||
|
||||
#include <libcvautomation/libcvautomation.h>
|
||||
|
||||
/* It should be noted that the following are the macros for template matching:
|
||||
* CV_TM_SQDIFF (default)
|
||||
* CV_TM_SQDIFF_NORMED
|
||||
* CV_TM_CCORR
|
||||
* CV_TM_CCORR_NORMED
|
||||
* CV_TM_CCOEFF
|
||||
* CV_TM_CCOEFF_NORMED
|
||||
*/
|
||||
|
||||
/* Match a root image and sub image */
|
||||
CvPoint matchSubImage ( IplImage *rootImage, IplImage *subImage, int searchMethod, double tolerance );
|
||||
|
||||
/* Match a root image and sub image, return the center */
|
||||
CvPoint matchSubImage_center ( IplImage *rootImage, IplImage *subImage, int searchMethod, double tolerance );
|
||||
|
||||
/* Match a root image and sub image from filename */
|
||||
CvPoint matchSubImage_location ( const char *rootImage_location, const char *subImage_location, int searchMethod, double tolerance );
|
||||
|
||||
/* Match a root image and sub image from filename, return the center */
|
||||
CvPoint matchSubImage_location_center ( const char *rootImage_location, const char *subImage_location, int searchMethod, double tolerance );
|
||||
|
||||
/* Match a root image and sub images from an array of images */
|
||||
void matchSubImage_a ( IplImage *rootImage, cvautomationList *subImageArray, int listSize );
|
||||
|
||||
/* Match a root image and sub images from an array of images, return the center */
|
||||
void matchSubImage_a_center ( IplImage *rootImage, cvautomationList *subImageArray, int listSize );
|
||||
|
||||
/* Match a root image and sub images from an array of images */
|
||||
void matchSubImage_a_location ( const char *rootImageFileName, cvautomationList *subImageArray, int listSize );
|
||||
|
||||
/* Match a root image and sub images from an array of images, return the center */
|
||||
void matchSubImage_a_location_center ( const char *rootImageFileName, cvautomationList *subImageArray, int listSize );
|
||||
|
||||
#endif /* LIBCVAUTOMATION_OPENCV_H */
|
51
include/opencv2/libcvautomation/libcvautomation-xlib.h
Normal file
51
include/opencv2/libcvautomation/libcvautomation-xlib.h
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: libcvautomation-xlib.h
|
||||
*
|
||||
* Description: Function definitions for X11 operations
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: 06/21/2012 08:34:21 AM
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: Bradlee Speice, bspeice@uncc.edu
|
||||
* Organization: MOSAIC at University of North Carolina at Charlotte
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
|
||||
#ifndef LIBCVAUTOMATION_XLIB_H
|
||||
#define LIBCVAUTOMATION_XLIB_H
|
||||
|
||||
#include <libcvautomation/libcvautomation.h>
|
||||
|
||||
/* It should be noted that the following are the macros for template matching:
|
||||
* CV_TM_SQDIFF (default)
|
||||
* CV_TM_SQDIFF_NORMED
|
||||
* CV_TM_CCORR
|
||||
* CV_TM_CCORR_NORMED
|
||||
* CV_TM_CCOEFF
|
||||
* CV_TM_CCOEFF_NORMED
|
||||
*/
|
||||
|
||||
/* Custom wrapper for XOpenDisplay function */
|
||||
Display* cvaOpenDisplay ( char *displayName );
|
||||
|
||||
/* Custom wrapper for XCloseDisplay funtion */
|
||||
void cvaCloseDisplay ( Display *displayLocation );
|
||||
|
||||
/* Match a sub image using the X11 root window as root */
|
||||
CvPoint matchSubImage_X11( Display *displayLocation, IplImage *subImage, int searchMethod, int tolerance );
|
||||
|
||||
/* Match a sub image using the X11 root window as root, return the center */
|
||||
CvPoint matchSubImage_X11_center( Display *displayLocation, IplImage *subImage, int searchMethod, int tolerance );
|
||||
|
||||
/* Match a sub image using X11 as root, from filename */
|
||||
CvPoint matchSubImage_X11_location( Display *displayLocation, const char *subImage_location, int search_method, int tolerance );
|
||||
|
||||
/* Match a sub image using X11 as root, from filename, return the center */
|
||||
CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char *subImage_location, int search_method, int tolerance );
|
||||
|
||||
#endif /* LIBCVAUTOMATION_XLIB_H */
|
101
include/opencv2/libcvautomation/libcvautomation-xtest.h
Normal file
101
include/opencv2/libcvautomation/libcvautomation-xtest.h
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: libcvautomation-xinput.h
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: 06/26/2012 09:08:41 AM
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: Bradlee Speice (), bspeice.nc@gmail.com
|
||||
* Organization:
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
|
||||
#ifndef LIBCVAUTOMATION_XTEST_H
|
||||
#define LIBCVAUTOMATION_XTEST_H
|
||||
|
||||
#include <libcvautomation/libcvautomation.h>
|
||||
|
||||
/* Make sure that the XTest extension is supported.
|
||||
* If it's not, return 0 (false) */
|
||||
Bool xte_XTestSupported ( Display *displayLocation );
|
||||
|
||||
/* Get the current location of the pointer */
|
||||
cvaPoint xte_pointerLocation ( Display *displayLocation );
|
||||
|
||||
/* Click the mouse where it is currently at */
|
||||
void xte_clickMouse ( Display *displayLocation, int mouseButton );
|
||||
|
||||
/* Click the mouse on an absolute screen location */
|
||||
void xte_clickMouseXY ( Display *displayLocation, int xLocation, int yLocation, int mouseButton );
|
||||
|
||||
/* Click the mouse on a screen location relative to where it currently is */
|
||||
void xte_clickMouseRXY ( Display *displayLocation, int xIncrement, int yIncrement, int mouseButton );
|
||||
|
||||
/* Click the mouse at the top-left corner of an image on the specified display */
|
||||
cvaPoint xte_clickMouseImage ( Display *displayLocation, IplImage *subImage, int mouseButton, int searchMethod, int tolerance );
|
||||
|
||||
/* Click the mouse at the top-left corner of an image on the specified display
|
||||
* where the subImage is a file location */
|
||||
cvaPoint xte_clickMouseImage_location ( Display *displayLocation, const char *fileName, int mouseButton, int searchMethod, int tolerance );
|
||||
|
||||
/* Click the mouse at the center of an image on the specified display */
|
||||
cvaPoint xte_clickMouseImage_center ( Display *displayLocation, IplImage *subImage, int mouseButton, int searchMethod, int tolerance );
|
||||
|
||||
/* Click the mouse at the center of an image on the specified display
|
||||
* where the subImage is a file location */
|
||||
cvaPoint xte_clickMouseImage_location_center ( Display *displayLocation, const char *fileName, int mouseButton, int searchMethod, int tolerance );
|
||||
|
||||
/* Move the mouse to a location and leave it there */
|
||||
void xte_hoverMouseXY ( Display *displayLocation, int xLocation, int yLocation );
|
||||
|
||||
/* Move the mouse to a location relative to where it currently is and leave it there */
|
||||
void xte_hoverMouseRXY ( Display *displayLocation, int xIncrement, int yIncrement );
|
||||
|
||||
/* Move the mouse to a location at the top-left corner of an image on the specified display
|
||||
* but don't click the mouse */
|
||||
cvaPoint xte_hoverMouseImage ( Display *displayLocation, IplImage *subImage, int searchMethod, int tolerance );
|
||||
|
||||
/* Move the mouse to a location at the top-left corner of an image from file on the specified display
|
||||
* but don't click the mouse */
|
||||
cvaPoint xte_hoverMouseImage_location ( Display *displayLocation, const char *filename, int searchMethod, int tolerance );
|
||||
|
||||
/* Move the mouse to a location at the center of an image on the specified display
|
||||
* but don't click the mouse */
|
||||
cvaPoint xte_hoverMouseImage_center ( Display *displayLocation, IplImage *subImage, int searchMethod, int tolerance );
|
||||
|
||||
/* Move the mouse to a location at the center of an image from file on the specified display
|
||||
* but don't click the mouse */
|
||||
cvaPoint xte_hoverMouseImage_location_center ( Display *displayLocation, const char *fileName, int searchMethod, int tolerance );
|
||||
|
||||
/* Push a mouse button down, but don't release it */
|
||||
void xte_mouseDown ( Display *displayLocation, int mouseButton );
|
||||
|
||||
/* Let a mouse button up */
|
||||
void xte_mouseUp ( Display *displayLocation, int mouseButton );
|
||||
|
||||
/* Move the mouse a little bit */
|
||||
void xte_mouseJiggle ( Display *displayLocation );
|
||||
|
||||
/* Press and release a key
|
||||
* Note that we use a string for *key, since keys like "space" are still valid. */
|
||||
void xte_clickKey ( Display *displayLocation, char *key );
|
||||
|
||||
/* Press and release keys in a string */
|
||||
void xte_clickKeyStr ( Display *displayLocation, char *string );
|
||||
|
||||
/* Press a key down */
|
||||
void xte_keyDown ( Display *displayLocation, char *key );
|
||||
|
||||
/* Release a key */
|
||||
void xte_keyUp ( Display *displayLocation, char *key );
|
||||
|
||||
/* Use one of the functions by command name */
|
||||
cvaPoint xte_commandString ( Display *displayLocation, char *command, int mouseButton, int searchMethod, int tolerance );
|
||||
|
||||
#endif /* LIBCVAUTOMATION_XTEST_H */
|
@ -22,19 +22,12 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef USEOPENCV2
|
||||
/* OpenCV2 includes - some filenames are different */
|
||||
/* OpenCV2 includes - some filenames are different
|
||||
* from the OpenCV1 counterparts */
|
||||
#include <opencv2/core/core_c.h>
|
||||
#include <opencv2/highgui/highgui_c.h>
|
||||
#include <opencv2/imgproc/imgproc_c.h>
|
||||
|
||||
#else
|
||||
/* OpenCV includes */
|
||||
#include <opencv/cv.h>
|
||||
#include <opencv/highgui.h>
|
||||
|
||||
#endif /* #ifdef OPENCV2 */
|
||||
|
||||
/* X11 includes */
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
Reference in New Issue
Block a user