コード例 #1
0
ファイル: eyetracker.go プロジェクト: BreamIO/gobii
// 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
}
コード例 #2
0
ファイル: eyetracker.go プロジェクト: BreamIO/gobii
// 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
}