[][src]Function libeyelink_sys::eyelink_newest_sample

pub unsafe extern "C" fn eyelink_newest_sample(buf: *mut c_void) -> INT16

@ingroup messaging Gets an integer (unconverted) copy of the last/newest link data (sample or event) seen by \c eyelink_get_next_data().

@param buf Pointer to buffer (\c ISAMPLE, \c ALL_DATA type). @return \c 0 if no data, else \c SAMPLE_TYPE.

\b Example:

\code
ISAMPLE isample;
float x, y;		 // gaze position

if(eyelink_newest_sample(NULL)>0)  // check for new sample update
{
eyelink_newest_sample(&isample);

if (x!=MISSING_DATA)
x = ((float) isample.gx[eye_used])/((float) eyelink_position_prescaler());    // yes: get gaze position from sample
else
x = (float) MISSING_DATA;

if (y!=MISSING_DATA)
y = ((float) isample.gy[eye_used])/((float) eyelink_position_prescaler());
else
y = (float) MISSING_DATA;

...
...
}
\endcode

\sa \c eyelink_get_float_data(), \c eyelink_get_last_data(), \c eyelink_get_next_data(), \c eyelink_get_sample() and \c eyelink_newest_float_sample()