#ifndef const_h_DEFINED
#define const_h_DEFINED
// const.h - This file contains all the constants used in the Emotional_Interaction project



// Code Modality: execution on AIBO or off-line
#define AIBO_YES
// Code Modality: time recording
#define TIME_REC
// Code Modality: function tracking
//#define FUNC_TRACK

// Initialization
#define INIT_FILE "INIT.INI"
#define INITPER_FILE "INITPER.INI"
#ifdef AIBO_YES
#define INIT_FOLDER "/MS/OPEN-R/MW/CONF/"
#define INITPER_FOLDER "/MS/OPEN-R/MW/CONF/"
#else
#define INIT_FOLDER "./MS/OPEN-R/MW/CONF/"
#define INITPER_FOLDER "./MS/OPEN-R/MW/CONF/"
#endif

#define AUS_FILE "AUS.INI"
#define EMO_FILE "EMO.INI"

// About images...

// BMP FILES
#define BMP_HEADER_OFFSET 54
#define MAX_LENGTH_FILE 128

#ifdef AIBO_YES
#define DATA_FOLDER "/MS/OPEN-R/MW/DATA/P/"
#else
#define DATA_FOLDER "./MS/OPEN-R/MW/DATA/P/"
#endif

#define FILES_TO_BE_PROCESSED  "input.txt"

// Colors...
#define BLACK   0
#define WHITE   255
#define NUM_COL 256

// Widths and heights of major image formats
#define WIDTH_L   52
#define HEIGHT_L  40
#define WIDTH_M   104
#define HEIGHT_M  80
#define WIDTH_H   208
#define HEIGHT_H  160
// Expanded H-layer
#define WIDTH_EH  416
#define HEIGHT_EH 320

// Left  and right eye
#define LEFT  0
#define RIGHT 1

// Feature code
#define MOUTH 0
#define EYE   1

// Crop borders...
#define NO_BORDER 0
#define SMALL_BORDER 4
#define LARGE_BORDER 20


// Scaling...

// For SobelX() and SobelY() functions
#define SOBEL_SUM 1020
#define SOBEL_DIV 8

// For MouthMap() function
#define MOUTH_SCALE 16646400


// Correlation methods
#define CC     1          // Cross Correlation
#define SSD    2          // Sum of squared differences
#define SAD    3          // Sum of absolute differences
#define NCCF   4          // Normalized Cross Correlation

// Number of blocks for the block matching algorithm
#define MOUTH_BL_NUM    6
#define EYEBROW_BL_NUM  3
#define ALL_BL_NUM      (MOUTH_BL_NUM + 2 * EYEBROW_BL_NUM)

// Direction intervals
#define EAST    5.0
#define WEST  175.0
#define MIN_N  85.0
#define MAX_N  95.0
#define MIN_S  -95.0
#define MAX_S  -85.0

// Eyes aperture
#define NEUTRAL_EYE 0
#define CLOSING_EYE 1
#define OPENING_EYE 2
#define NO_EYE  3

// Action units...

// Direction codes
#define DIR_N    1
#define DIR_S    2
#define DIR_E    3
#define DIR_W    4
#define DIR_NE   5
#define DIR_SE   6
#define DIR_NW   7
#define DIR_SW   8

// Parts of face
#define UPPER    1
#define LOWER    2
#define EYES     3

// Number of AU managed...
#define AU_NUM 13

// Number of emotions...
#define EM_NUM 6

// Number of AIBO's emotional states...
#define STATE_NUM 4

// Number of AIBO's possible personalities
// and correspondent configuration filenames...
#define PER_NUM 4
#define PERFILE0 "FRIENDLY.PER"
#define PERFILE1 "CRUSTY.PER"
#define PERFILE2 "MELANCH.PER"
#define PERFILE3 "RANDOM.PER"
#define PERFILES {"FRIENDLY.PER", "CRUSTY.PER", "MELANCH.PER", "RANDOM.PER"}

// Intro sound names...
#define INTRO_NEUTRAL_WAV    202
#define INTRO_EXPRESSION_WAV 203

// Motion names...
#define SLEEP           0
#define SITTING         1
#define STANDING        2
#define NEUTRAL_MOTION  3
#define JOYFUL_MOTION   4
#define SAD_MOTION      5
#define ANGRY_MOTION    6
#define ENDING		7
#define STARTING        8


// Various costants
#define MAX_DOUBLE 1.7E+308
#define PI 3.14159265



// Macro for printing
#ifdef AIBO_YES
       #define PRN(x)              OSYSPRINT(x)
#else
       #define PRN(x)              printf x
#endif


// Renaming types...
#ifndef AIBO_YES
typedef unsigned char byte;
typedef char sbyte;
typedef unsigned short word;
typedef unsigned long longword;
typedef long slongword;
#endif


#endif // const_h_DEFINED
