Tobii Pro SDK C API
get_and_set_display_area.c
#include <stdio.h>
#include <string.h>
void get_display_area_example(TobiiResearchEyeTracker* eyetracker) {
TobiiResearchStatus status = tobii_research_get_display_area(eyetracker, &display_area);
char* serial_number = NULL;
tobii_research_get_serial_number(eyetracker, &serial_number);
printf("Got display area from tracker with serial number %s with status %i:\n", serial_number, status);
printf("Bottom Left: (%f, %f, %f)\n",
display_area.bottom_left.x,
display_area.bottom_left.y,
display_area.bottom_left.z);
printf("Bottom Right: (%f, %f, %f)\n",
display_area.bottom_right.x,
display_area.bottom_right.y,
display_area.bottom_right.z);
printf("Height: %f\n", display_area.height);
printf("Top Left: (%f, %f, %f)\n",
display_area.top_left.x,
display_area.top_left.y,
display_area.top_left.z);
printf("Top Right: (%f, %f, %f)\n",
display_area.top_right.x,
display_area.top_right.y,
display_area.top_right.z);
printf("Width: %f\n", display_area.width);
// To set the display area it is possible to either use a previously saved instance of
// the type TobiiResearchDisplayArea, or create a new one as shown below.
TobiiResearchDisplayArea new_display_area;
// For simplicity we are using the same values that are already set on the eye tracker.
memcpy(&new_display_area.top_left, &display_area.top_left, sizeof(display_area.top_left));
memcpy(&new_display_area.top_right, &display_area.top_right, sizeof(display_area.top_right));
memcpy(&new_display_area.bottom_left, &display_area.bottom_left, sizeof(display_area.bottom_left));
status = tobii_research_set_display_area(eyetracker, &new_display_area);
}
TobiiResearchPoint3D::y
float y
Definition: tobii_research.h:402
TobiiResearchDisplayArea::bottom_left
TobiiResearchPoint3D bottom_left
Definition: tobii_research_eyetracker.h:186
tobii_research_get_serial_number
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_serial_number(TobiiResearchEyeTracker *eyetracker, char **serial_number)
Gets the serial number of the eye tracker. All physical eye trackers have a unique serial number.
tobii_research_eyetracker.h
Functionality for an eye tracker.
TobiiResearchPoint3D::x
float x
Definition: tobii_research.h:398
tobii_research_free_string
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_string(char *str)
Free memory allocation for a string allocated by the SDK.
TobiiResearchDisplayArea::top_left
TobiiResearchPoint3D top_left
Definition: tobii_research_eyetracker.h:201
tobii_research_set_display_area
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_set_display_area(TobiiResearchEyeTracker *eyetracker, const TobiiResearchDisplayArea *display_area)
Sets the display area of the eye tracker. It is strongly recommended to use Eye Tracker Manager to ca...
TobiiResearchEyeTracker
struct TobiiResearchEyeTracker TobiiResearchEyeTracker
Definition: tobii_research.h:310
TobiiResearchDisplayArea::top_right
TobiiResearchPoint3D top_right
Definition: tobii_research_eyetracker.h:206
TobiiResearchPoint3D::z
float z
Definition: tobii_research.h:406
tobii_research_get_display_area
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_display_area(TobiiResearchEyeTracker *eyetracker, TobiiResearchDisplayArea *display_area)
Gets the size and corners of the display area.
TobiiResearchDisplayArea::width
float width
Definition: tobii_research_eyetracker.h:211
TobiiResearchDisplayArea::bottom_right
TobiiResearchPoint3D bottom_right
Definition: tobii_research_eyetracker.h:191
TobiiResearchDisplayArea::height
float height
Definition: tobii_research_eyetracker.h:196
TobiiResearchDisplayArea
Definition: tobii_research_eyetracker.h:182
TobiiResearchStatus
TobiiResearchStatus
Definition: tobii_research.h:45