SR Research Support Site
Data Structures | Macros | Typedefs | Enumerations | Functions
Graphics display options

Data Structures

struct  EYECOLOR
 Represents an RGB color. More...
 
struct  EYEPALETTE
 Represents a palette index. More...
 
struct  EYEPIXELFORMAT
 Represents pixel format of an image or surface. More...
 
struct  EYEBITMAP
 Represents a bitmap image. More...
 
struct  KeyInput
 Keyboard input event structure. More...
 
struct  MouseMotionEvent
 Mouse motion event structure (For future) More...
 
struct  MouseButtonEvent
 Mouse button event structure (For future) More...
 
union  InputEvent
 Union of all input types. More...
 
struct  HOOKFCNS
 Structure used set and get callback functions. More...
 
struct  HOOKFCNS2
 Structure used set and get callback functions. More...
 
struct  _CrossHairInfo
 Structure to hold cross hair information. More...
 

Macros

#define KEYINPUT_EVENT   0x1
 
#define MOUSE_INPUT_EVENT   0x4
 
#define MOUSE_MOTION_INPUT_EVENT   0x5
 
#define MOUSE_BUTTON_INPUT_EVENT   0x6
 
#define ELKMOD_NONE   0x0000
 
#define ELKMOD_LSHIFT   0x0001
 
#define ELKMOD_RSHIFT   0x0002
 
#define ELKMOD_LCTRL   0x0040
 
#define ELKMOD_RCTRL   0x0080
 
#define ELKMOD_LALT   0x0100
 
#define ELKMOD_RALT   0x0200
 
#define ELKMOD_LMETA   0x0400
 
#define ELKMOD_RMETA   0x0800
 
#define ELKMOD_NUM   0x1000
 
#define ELKMOD_CAPS   0x2000
 
#define ELKMOD_MODE   0x4000
 
#define CR_HAIR_COLOR   1
 
#define PUPIL_HAIR_COLOR   2
 
#define PUPIL_BOX_COLOR   3
 
#define SEARCH_LIMIT_BOX_COLOR   4
 
#define MOUSE_CURSOR_COLOR   5
 

Typedefs

typedef enum _EL_CAL_BEEP EL_CAL_BEEP
 Enum used for calibration beeps.
 

Enumerations

enum  IMAGETYPE {
  JPEG, PNG, GIF, BMP,
  XPM
}
 
enum  _EL_CAL_BEEP {
  EL_DC_DONE_ERR_BEEP =-2, EL_CAL_DONE_ERR_BEEP =-1, EL_CAL_DONE_GOOD_BEEP =0, EL_CAL_TARG_BEEP =1,
  EL_DC_DONE_GOOD_BEEP =2, EL_DC_TARG_BEEP =3
}
 Enum used for calibration beeps. More...
 

Functions

INT16 target_mode_display (void)
 
INT16 image_mode_display (void)
 
void setup_graphic_hook_functions (HOOKFCNS *hooks)
 
HOOKFCNSget_all_hook_functions (void)
 
INT16 setup_graphic_hook_functions_V2 (HOOKFCNS2 *hooks)
 
HOOKFCNS2get_all_hook_functions_V2 (void)
 
int get_image_xhair_data (INT16 x[4], INT16 y[4], INT16 *xhairs_on)
 
INT32 eyelink_draw_cross_hair (CrossHairInfo *chi)
 

Detailed Description

Macro Definition Documentation

#define ELKMOD_CAPS   0x2000

Modifier for KeyInput.modifier; Cap lock key

#define ELKMOD_LALT   0x0100

Modifier for KeyInput.modifier; Left Alt

#define ELKMOD_LCTRL   0x0040

Modifier for KeyInput.modifier; left conrol

#define ELKMOD_LMETA   0x0400

Modifier for KeyInput.modifier; Left Meta

#define ELKMOD_LSHIFT   0x0001

Modifier for KeyInput.modifier; Left shift

#define ELKMOD_MODE   0x4000

Modifier for KeyInput.modifier; Mode key

#define ELKMOD_NONE   0x0000

Modifier for KeyInput.modifier; No modifier present

#define ELKMOD_NUM   0x1000

Modifier for KeyInput.modifier; Number lock key

#define ELKMOD_RALT   0x0200

Modifier for KeyInput.modifier; Right alt

#define ELKMOD_RCTRL   0x0080

Modifier for KeyInput.modifier; Right control

#define ELKMOD_RMETA   0x0800

Modifier for KeyInput.modifier; Right Meta

#define ELKMOD_RSHIFT   0x0002

Modifier for KeyInput.modifier; Right shift

#define KEYINPUT_EVENT   0x1

set to InputEvent.type to notify keyboard input event

#define MOUSE_BUTTON_INPUT_EVENT   0x6

set InputEvent.type to notify mouse button input event.

Remarks
For future use.
#define MOUSE_INPUT_EVENT   0x4

set InputEvent.type to notify mouse input event

Remarks
For future use.
#define MOUSE_MOTION_INPUT_EVENT   0x5

set InputEvent.type to notify mouse motion input event

Remarks
For future use.

Enumeration Type Documentation

Enum used for calibration beeps.

Enumerator
EL_DC_DONE_ERR_BEEP 

Drift Correct Done error beep

EL_CAL_DONE_ERR_BEEP 

Calibration Done error beep

EL_CAL_DONE_GOOD_BEEP 

Calibration Done correct beep

EL_CAL_TARG_BEEP 

Calibration target present beep

EL_DC_DONE_GOOD_BEEP 

Drift Correct Done correct beep

EL_DC_TARG_BEEP 

Drift Correct target present beep

Function Documentation

INT32 eyelink_draw_cross_hair ( CrossHairInfo chi)

Convenient function to draw cross hair on camera image. It is very tedious to draw and maintain cross hair drawing. This is due to evolving eyelink camera image protocol and the introduction of newer trackers and still single library handle all eyelink trackers. eyelink_draw_cross_hair fixes this issue by allowing the drawing function to draw to the device contexts and does all magic of extracting cursor info from the tracker.

eyelink_draw_cross_hair calls drawLine(), drawEllipse() and getMouseState() to draw the cross hair. eyelink_draw_cross_hair expects both width(w) and height(h) are correct and the function pointers to drawLine, drawEllipse and getMouseState are not NULL.

Parameters
[in]chiinitialized CrossHairInfo structure.
HOOKFCNS* get_all_hook_functions ( void  )

Returns a pointer to HOOKFCNS, with values that are set by setup_graphic_hook_functions().

This function with combination of setup_graphic_hook_functions can be used to over-ride an existing hook function.

HOOKFCNS2* get_all_hook_functions_V2 ( void  )

Returns a pointer to HOOKFCNS2, with values that are set by setup_graphic_hook_functions_V2().

This function with combination of setup_graphic_hook_functions can be used to over-ride an existing hook function.

int get_image_xhair_data ( INT16  x[4],
INT16  y[4],
INT16 *  xhairs_on 
)
Value is image coord scaled so l,t=0, r,b=8192
Values may be negative or beyond image limits
Value is 0x8000 in X (or L) field if crosshair is not to be drawn
Head camera: indexes 0..3 are markers
Eye camera:
    Index 0 is pupil center
    Index 1 is CR center
    Index 2 is pupil-limit box left, top
    Index 3 is pupil-limit box right, bottom
@param xhairs_on Set to indicate if xhairs enabled on display (may be \c NULL).
@param x array of 4 to be filled to return x data
@param y array of 4 to be filled to return y data
@return Channel number (\c 1 = left, \c 2 = head, \c 3 = right).
INT16 image_mode_display ( void  )

This handles display of the EyeLink camera images. While in imaging mode, it contiuously requests and displays the current camera image. It also displays the camera name and threshold setting. Keys on the subject PC keyboard are sent to the tracker, so the experimenter can use it during setup. It will exit when the tracker leaves imaging mode or disconnects.

Returns
0 if OK, TERMINATE_KEY if pressed, -1 if disconnect.
Remarks
This function not normally used externally. If you need camera setup use do_tracker_setup() or if you need drift correction use do_drift_correct()
void setup_graphic_hook_functions ( HOOKFCNS hooks)

Primary function to setup display graphics hook functions.

Example:

1 INT16 ELCALLTYPE init_expt_graphics(HWND hwnd, DISPLAYINFO *info)
2 {
3  HOOKFCNS fcns;
4  memset(&fcns,0,sizeof(fcns));
5  fcns.setup_cal_display_hook = setup_cal_display;
6  fcns.exit_cal_display_hook = exit_cal_display;
7  fcns.record_abort_hide_hook = record_abort_hide;
8  fcns.setup_image_display_hook = setup_image_display;
9  fcns.image_title_hook = image_title;
10  fcns.draw_image_line_hook = draw_image_line;
11  fcns.set_image_palette_hook = set_image_palette;
12  fcns.exit_image_display_hook= exit_image_display;
13  fcns.clear_cal_display_hook = clear_cal_display;
14  fcns.erase_cal_target_hook = erase_cal_target;
15  fcns.draw_cal_target_hook = draw_cal_target;
16  fcns.cal_target_beep_hook = cal_target_beep;
17  fcns.cal_done_beep_hook = cal_done_beep;
18  fcns.dc_done_beep_hook = dc_done_beep;
19  fcns.dc_target_beep_hook = dc_target_beep;
20  fcns.get_input_key_hook = get_input_key;
21  fcns.alert_printf_hook = alert_printf_hook;
22 
23  setup_graphic_hook_functions(&fcns);
24 
25  return 0;
26 }
INT16 setup_graphic_hook_functions_V2 ( HOOKFCNS2 hooks)

Primary function to setup display graphics hook functions of the second revision of the interface. One of the major difference between this and setup_graphic_hook_functions is, this has fewer functions to implement also, takes extra parameters like the major and minor versions for future enhancements.

\b Example:
<pre>
1 INT16 ELCALLTYPE init_expt_graphics(HWND hwnd, DISPLAYINFO *info)
2 {
3  HOOKFCNS2 fcns;
4  memset(&fcns,0,sizeof(fcns));
5  fcns.major = 1;
6  fcns.minor = 0;
7  fcns.userData = ts;
8 
9  // cam image
10  fcns.draw_image = draw_image;
11  fcns.exit_image_display_hook= exit_image_display;
12  fcns.setup_image_display_hook = setup_image_display;
13 
14 
15 
16  fcns.setup_cal_display_hook = setup_cal_display;
17  fcns.clear_cal_display_hook = clear_display;
18  fcns.erase_cal_target_hook = clear_display;
19  fcns.draw_cal_target_hook = draw_cal_target;
20  fcns.image_title_hook = image_title;
21 
22  fcns.get_input_key_hook = get_input_key;
23  fcns.alert_printf_hook = alert_printf_hook;
24  return setup_graphic_hook_functions_V2(&fcns);
25 }
INT16 target_mode_display ( void  )

This function needs some "helper" graphics to clear the scren and draw the fixation targets. Since C graphics are compiler-dependent, these are found in other C source files.

While tracker is in any mode with fixation targets. Reproduce targets tracker needs. (if local_trigger) Local Spacebar acts as trigger. (if local_control) Local keys echoes to tracker.

Returns
0 if OK, 27 if aborted, TERMINATE_KEY if pressed.

Copyright ©2002-2024, SR Research Ltd.