[][src]Struct libeyelink_sys::HOOKFCNS2

#[repr(C)]pub struct HOOKFCNS2 {
    pub major: c_int,
    pub minor: c_int,
    pub userData: *mut c_void,
    pub setup_cal_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>,
    pub exit_cal_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>,
    pub setup_image_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void, width: INT16, height: INT16) -> INT16>,
    pub image_title_hook: Option<unsafe extern "C" fn(userData: *mut c_void, title: *mut c_char) -> INT16>,
    pub draw_image: Option<unsafe extern "C" fn(userData: *mut c_void, width: INT16, height: INT16, pixels: *mut byte) -> INT16>,
    pub exit_image_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>,
    pub clear_cal_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>,
    pub erase_cal_target_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>,
    pub draw_cal_target_hook: Option<unsafe extern "C" fn(userData: *mut c_void, x: f32, y: f32) -> INT16>,
    pub play_target_beep_hook: Option<unsafe extern "C" fn(userData: *mut c_void, beep_type: EL_CAL_BEEP) -> INT16>,
    pub get_input_key_hook: Option<unsafe extern "C" fn(userData: *mut c_void, event: *mut InputEvent) -> INT16>,
    pub alert_printf_hook: Option<unsafe extern "C" fn(userData: *mut c_void, msg: *const c_char) -> INT16>,
    pub reserved1: c_int,
    pub reserved2: c_int,
    pub reserved3: c_int,
    pub reserved4: c_int,
}

@ingroup display \brief Structure used set and get callback functions

Structure used set and get callback functions so that the calibration graphics can be drawn.

Fields

major: c_int

Major version. At the moment the version number must be set to 1

minor: c_int

Minor version. At the moment the version number must be set to 0

userData: *mut c_void

The value set here will be passed to every single call back functions

setup_cal_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>

This function is called to setup calibration/validation display. This function called before any calibration routines are called. @param userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

@return 0 upon success.

exit_cal_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>

This is called to release any resources that are not required beyond calibration. Beyond this call, no calibration functions will be called. @return 0 upon success.

setup_image_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void, width: INT16, height: INT16) -> INT16>

This function is responsible for initializing any resources that are required for camera setup.

@param userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

@param width width of the source image to expect. @param height height of the source image to expect. @return -1 if failed, 0 otherwise.

image_title_hook: Option<unsafe extern "C" fn(userData: *mut c_void, title: *mut c_char) -> INT16>

This function is called to update any image title change. @param threshold if -1 the entire tile is in the title string otherwise, the threshold of the current image. @param title if threshold is -1, the title contains the whole title for the image. Otherwise only the camera name is given. @return 0 upon success.

draw_image: Option<unsafe extern "C" fn(userData: *mut c_void, width: INT16, height: INT16, pixels: *mut byte) -> INT16>

This function is called to supply the image. @param userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

@param width width of the picture. @param height height of the picture. @param pixels pixels pointer to the pixel data. The size of the pixel data can be calculate by widthheight4. The image comes in RGBA(network order) format. @return 0 upon success.

exit_image_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>

This is called to notify that all camera setup things are complete. Any resources that are allocated in setup_image_display can be released in this function. @param userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

@return 0 upon success.

clear_cal_display_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>

Called to clear the calibration display. @param userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

@return 0 upon success.

erase_cal_target_hook: Option<unsafe extern "C" fn(userData: *mut c_void) -> INT16>

This function is responsible for erasing the target that was drawn by the last call to draw_cal_target. @param userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

@return 0 upon success.

draw_cal_target_hook: Option<unsafe extern "C" fn(userData: *mut c_void, x: f32, y: f32) -> INT16>

This function is responsible for the drawing of the target for calibration,validation and drift correct at the given coordinate. @param userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

@param x x coordinate of the target. @param y y coordinate of the target. @remark The x and y are relative to what is sent to the tracker for the command screen_pixel_coords. @return 0 upon success.

play_target_beep_hook: Option<unsafe extern "C" fn(userData: *mut c_void, beep_type: EL_CAL_BEEP) -> INT16>

@param userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

This function is called to signal new target. @return 0 upon success.

get_input_key_hook: Option<unsafe extern "C" fn(userData: *mut c_void, event: *mut InputEvent) -> INT16>

This is called to check for keyboard input. In this function:

\arg check if there are any input events \arg if there are input events, fill key_input and return 1. otherwise return 0. If 1 is returned this will be called again to check for more events.

@param[in] userData User context data set on userData field of HOOKFCNS2 set at the time of call to setup_graphic_hook_functions.

@param[out] key_input fill in the InputEvent structure to return key,modifier values. @return if there is a key, return 1 otherwise return 0. return -1 if there is an error.

@remark Special keys and modifiers should match the following code.

\b Special \b keys:

@code

#define F1_KEY    0x3B00
#define F2_KEY    0x3C00
#define F3_KEY    0x3D00
#define F4_KEY    0x3E00
#define F5_KEY    0x3F00
#define F6_KEY    0x4000
#define F7_KEY    0x4100
#define F8_KEY    0x4200
#define F9_KEY    0x4300
#define F10_KEY   0x4400

#define PAGE_UP    0x4900
#define PAGE_DOWN  0x5100
#define CURS_UP    0x4800
#define CURS_DOWN  0x5000
#define CURS_LEFT  0x4B00
#define CURS_RIGHT 0x4D00

#define ESC_KEY   0x001B
#define ENTER_KEY 0x000D

@endcode

Modifier: If you are using SDL you do not need to modify the modifier value as they match the value.

@code
#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

@endcode
alert_printf_hook: Option<unsafe extern "C" fn(userData: *mut c_void, msg: *const c_char) -> INT16>

This function is called whenever alert_printf is called. In windows, if no callback is set calls MessageBox function. In other platforms, if no call back is set prints out to console.

reserved1: c_intreserved2: c_intreserved3: c_intreserved4: c_int

Trait Implementations

impl Clone for HOOKFCNS2[src]

impl Copy for HOOKFCNS2[src]

impl Debug for HOOKFCNS2[src]

impl Default for HOOKFCNS2[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.