Skip to content
Permalink
Browse files

PupilEyeTracker: Add documentation for subscribeFrames() and unsubscr…

…ibeFrames()
  • Loading branch information
skalarproduktraum committed Feb 12, 2020
1 parent 1a22b0e commit a836b9e13d02f78070f4f9ed4acba94c1a5cbfbb
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/main/kotlin/graphics/scenery/controls/eyetracking/PupilEyeTracker.kt
@@ -335,6 +335,15 @@ class PupilEyeTracker(val calibrationType: CalibrationType, val host: String = "
}
}

/**
* Subscribes to the frames seen by the eye tracking cameras, which
* [onReceiveAction] containing a lambda that takes the eye ID and a byte
* array containing the compressed RGB texture data from one frame. [onReceiveAction]
* will be called for each frame receive by all eye cameras, until
* [unsubscribeFrames] is called.
*
* TODO: Automatically decompress the frame data received from Pupil.
*/
fun subscribeFrames(onReceiveAction: (Int, ByteArray) -> Unit) {
notify(hashMapOf(
"subject" to "start_plugin",
@@ -347,7 +356,9 @@ class PupilEyeTracker(val calibrationType: CalibrationType, val host: String = "
onReceiveFrame = onReceiveAction
}


/**
* Unsubscribes from receiving frames from the eye tracking cameras.
*/
fun unsubscribeFrames() {
notify(hashMapOf(
"subject" to "stop_plugin",

0 comments on commit a836b9e

Please sign in to comment.
You can’t perform that action at this time.