Ejemplo n.º 1
0
// Calculates the result of the calibration and stores it in the tracker.
//
// The callback is called with a Error if called without a prior successful StartCalibration call.
//
// If another calibration call is in the pipeline, this call will block until it is done.
// This is to protect user data from corruption and garbage collection.
// Please understand.
func (e *GazeTracker) ComputeAndSetCalibration(callback Callback) {
	e.calibrationLock.Lock()
	e.calibrationCallback = callback //Store it to avoid GC sweep.
	C.tobiigaze_calibration_compute_and_set_async(e.cPtr(),
		C.breamio_get_callback(),
		unsafe.Pointer(e)) //unsafe reference to the tracker. Needed to get the real callback later
}
Ejemplo n.º 2
0
// Removes a point from the current calibration.
//
// The callback is called with a Error if called without a prior successful StartCalibration call.
//
// If another calibration call is in the pipeline, this call will block until it is done.
// This is to protect user data from corruption and garbage collection.
// Please understand.
func (e *GazeTracker) RemovePointFromCalibration(point *Point2D, callback Callback) {
	e.calibrationLock.Lock()
	e.calibrationCallback = callback //Store it to avoid GC sweep.
	C.tobiigaze_calibration_remove_point_async(e.cPtr(),
		&C.struct_tobiigaze_point_2d{(C.double)(point.x), (C.double)(point.y)},
		C.breamio_get_callback(),
		unsafe.Pointer(e)) //unsafe reference to the tracker. Needed to get the real callback later
}