/*	motion.h
 *
 *	Include file for motion.c
 *      Copyright 2000 by Jeroen Vreeken (pe1rxq@amsat.org)
 *      This software is distributed under the GNU public license version 2
 *      See also the file 'COPYING'.
 *
 */

/* Includes */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <linux/videodev.h>

#include <jpeglib.h>

/* Default picture settings */
#define DEF_WIDTH       352
#define DEF_HEIGHT      288
#define DEF_QUALITY     50
#define DEF_CHANGES     1500

#define DEF_MAXFRAMERATE	100
#define DEF_NOISELEVEL	32

/* Minimum time between two 'actions' (email, sms, external) */
#define DEF_GAP         60*5 /* 5 minutes */

/* video4linux stuff */
#define NORM_DEFAULT    0
#define NORM_PAL        0
#define NORM_NTSC       1
#define NORM_SECAM      2
#define IN_DEFAULT      8
#define IN_TV           0
#define IN_COMPOSITE    1
#define IN_COMPOSITE2   2
#define IN_SVIDEO       3

#define VIDEO_DEVICE            "/dev/video0"

int draw_text (char *image, int startx, int starty, int height, int width, char *text);

struct coord {
	int x;
	int y;
};

struct coord locate_diffs_center (char *out, int width, int height);

#ifdef TRACKING
	int track_center(void);
	int track_move(char *image_out, int width, int height);
#endif
