Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
Functions
API_C

Application Programming Interface to be used by C SR applications. More...

Functions

SRAPI SR_camera createCamera (SRContext context)
 Creates a functional Camera instance. More...
 
SRAPI SR_camera createCameraByDescriptor (SRContext context, SR_cameraDescriptor descriptor)
 Creates a Camera instance to provide feedback about the Eyetracker. More...
 
SRAPI SR_videoListener createVideoListener (SR_camera camera, void(*acceptVideoCallback)(SR_videoFrame))
 Create a new callback function to listen to a specific camera. More...
 
SRAPI void deleteVideoListener (SR_videoListener videoListener)
 Cleans up underlying object instances used to facilitate video update callbacks. More...
 
SRAPI SRContext newSRContext ()
 Construct an instance of SRContext, the environment in which created senses are kept track of. More...
 
SRAPI SRContext newSRContextLensPreference (bool lensPreference)
 Construct an instance of SRContext, the environment in which created senses are kept track of. More...
 
SRAPI void initializeSRContext (SRContext context)
 Initialize all senses. More...
 
SRAPI void deleteSRContext (SRContext context)
 Delete and clean up the instance of SRContext. More...
 
SRAPI SR_systemSense createSystemSense (SRContext context)
 Creates a functional SystemSense instance. More...
 
SRAPI SR_systemEventListener createSystemEventListener (SR_systemSense systemSense, void(*acceptSystemEventCallback)(SR_systemEvent))
 Add a new callback function to listen to a specific systemSense. More...
 
SRAPI void deleteSystemEventListener (SR_systemEventListener systemEventListener)
 Cleans up underlying object instances used to facilitate system event update callbacks. More...
 
SRAPI SR_screen createScreen (SRContext context)
 Creates a functional Screen instance. More...
 
SRAPI const int getResolutionHeight (SR_screen screen)
 Returns resolution height of screen instance as seen by user. More...
 
SRAPI const int getResolutionWidth (SR_screen screen)
 Returns resolution width of screen instance as seen by user. More...
 
SRAPI const int getPhysicalResolutionHeight (SR_screen screen)
 Returns physical resolution height of screen instance. More...
 
SRAPI const int getPhysicalResolutionWidth (SR_screen screen)
 Returns physical resolution width of screen instance. More...
 
SRAPI const float getPhysicalSizeHeight (SR_screen screen)
 Returns physical screen height in cm. More...
 
SRAPI const float getPhysicalSizeWidth (SR_screen screen)
 Returns physical screen width in cm. More...
 
SRAPI const float getDotPitch (SR_screen screen)
 Returns distance between pixels in cm. More...
 
SRAPI SR_switchableLensHint createSwitchableLensHint (SRContext context)
 Creates a functional SwitchableLensHints instance. More...
 
SRAPI void lensEnableHint (SR_switchableLensHint lensHint)
 
SRAPI void lensDisableHint (SR_switchableLensHint lensHint)
 
SRAPI void deleteSwitchableLensHint (SR_switchableLensHint lensHint)
 Cleans up underlying object instances used to facilitate indicating lens switch preferance. More...
 
SRAPI SR_eyeTracker createEyeTracker (SRContext context)
 Creates a functional EyeTracker instance. More...
 
SRAPI SR_eyePairListener createEyePairListener (SR_eyeTracker eyeTracker, void(*acceptEyePairCallback)(SR_eyePair))
 Create a new callback function to listen to a specific eyetracker. More...
 
SRAPI void deleteEyePairListener (SR_eyePairListener eyePairListener)
 Cleans up underlying object instances used to facilitate eye position update callbacks. More...
 
SRAPI SR_headTracker createHeadTracker (SRContext context)
 Creates a functional Headtracker instance. More...
 
SRAPI SR_headListener createHeadListener (SR_headTracker headTracker, void(*acceptHeadCallback)(SR_head))
 Create a new callback function to listen to a specific headtracker. More...
 
SRAPI void deleteHeadListener (SR_headListener headListener)
 Cleans up underlying object instances used to facilitate head position update callbacks. More...
 
SRAPI SR_handTracker createHandTracker (SRContext context)
 Creates a functional HandTracker instance. More...
 
SRAPI SR_handPoseListener createHandPoseListener (SR_handTracker handTracker, void(*acceptHandPoseCallback)(SR_handPose))
 Create a new callback function to listen to a specific handtracker. More...
 
SRAPI void deleteHandPoseListener (SR_handPoseListener handPoseListener)
 Cleans up underlying object instances used to facilitate hand pose update callbacks. More...
 
SRAPI SR_handEventListener createHandEventListener (SR_handTracker handTracker, void(*acceptHandEventCallback)(SR_handEvent))
 Create a new callback function to listen to a specific handtracker. More...
 
SRAPI void deleteHandEventListener (SR_handEventListener handEventListener)
 Cleans up underlying object instances used to facilitate hand event update callbacks. More...
 
SRAPI const char * getSRPlatformVersion ()
 Get the full version SR Platform in [MAJOR].[MINOR].[PATCH].[GIT_HASH]. More...
 

Detailed Description

Application Programming Interface to be used by C SR applications.

Function Documentation

◆ createCamera()

SRAPI SR_camera createCamera ( SRContext  context)

Creates a functional Camera instance.

Parameters
contextis the environment in which created senses are kept track of
Returns
SR_camera ( void* ) which is the address of the C++ SR::Camera implementation. It can be used to provide streams of video data

The Camera class is abstract and requires a device specific implementation to be used in applications. This function constructs an Camera suitable for use in your application on the current device.

◆ createCameraByDescriptor()

SRAPI SR_camera createCameraByDescriptor ( SRContext  context,
SR_cameraDescriptor  descriptor 
)

Creates a Camera instance to provide feedback about the Eyetracker.

Parameters
contextis the environment in which created senses are kept track of
Returns
SR_camera ( void* ) which is the address of the C++ SR::Camera implementation coupled to the Eyetracker application

◆ createEyePairListener()

SRAPI SR_eyePairListener createEyePairListener ( SR_eyeTracker  eyeTracker,
void(*)(SR_eyePair acceptEyePairCallback 
)

Create a new callback function to listen to a specific eyetracker.

Parameters
eyeTrackeris the address of the C++ SR::EyeTracker implementation to connect with. It is provided by the createEyeTracker function.
acceptEyePairCallbackis a function pointer to a callback function which will be called when new SR_eyePair data is available.
Returns
SR_eyePairListener ( void* ) which should be used to clean up the underlying objects used to facilitate the eye position update callbacks.

◆ createEyeTracker()

SRAPI SR_eyeTracker createEyeTracker ( SRContext  context)

Creates a functional EyeTracker instance.

Parameters
contextis the environment in which created senses are kept track of
Returns
SR_eyeTracker ( void* ) which is the address of the C++ SR::EyeTracker implementation. It can be used to provide streams of eye position data

The EyeTracker class is abstract and requires a device specific implementation to be used in applications. This function constructs an EyeTracker suitable for use in your application on the current device.

◆ createHandEventListener()

SRAPI SR_handEventListener createHandEventListener ( SR_handTracker  handTracker,
void(*)(SR_handEvent acceptHandEventCallback 
)

Create a new callback function to listen to a specific handtracker.

Parameters
handTrackeris the address of the C++ SR::HandTracker implementation to connect with. It is provided by the createHandTracker function.
acceptHandEventCallbackis a function pointer to a callback function which will be called when new SR_handEvent data is available.
Returns
SR_handEventListener ( void* ) which should be used to clean up the underlying objects used to facilitate the hand event update callbacks.

◆ createHandPoseListener()

SRAPI SR_handPoseListener createHandPoseListener ( SR_handTracker  handTracker,
void(*)(SR_handPose acceptHandPoseCallback 
)

Create a new callback function to listen to a specific handtracker.

Parameters
handTrackeris the address of the C++ SR::HandTracker implementation to connect with. It is provided by the createHandTracker function.
acceptHandPoseCallbackis a function pointer to a callback function which will be called when new SR_handPose data is available.
Returns
SR_handPoseListener ( void* ) which should be used to clean up the underlying objects used to facilitate the hand pose update callbacks.

◆ createHandTracker()

SRAPI SR_handTracker createHandTracker ( SRContext  context)

Creates a functional HandTracker instance.

Parameters
contextis the environment in which created senses are kept track of
Returns
SR_handTracker ( void* ) which is the address of the C++ SR::HandTracker implementation. It can be used to provide streams of hand data

The HandTracker class is abstract and requires a device specific implementation to be used in applications. This function constructs an HandTracker suitable for use in your application on the current device.

◆ createHeadListener()

SRAPI SR_headListener createHeadListener ( SR_headTracker  headTracker,
void(*)(SR_head acceptHeadCallback 
)

Create a new callback function to listen to a specific headtracker.

Parameters
headtrackeris the address of the C++ SR::HeadTracker implementation to connect with. It is provided by the createHeadTracker function.
acceptHeadCallbackis a function pointer to a callback function which will be called when new SR_head data is available.
Returns
SR_headListener ( void* ) which should be used to clean up the underlying objects used to facilitate the head position update callbacks.

◆ createHeadTracker()

SRAPI SR_headTracker createHeadTracker ( SRContext  context)

Creates a functional Headtracker instance.

Parameters
contextis the environment in which created senses are kept track of
Returns
SR_headtracker ( void* ) which is the address of the C++ SR::Headtracker implementation. It can be used to provide streams of head position data

The Headtracker class is abstract and requires a device specific implementation to be used in applications. This function constructs an HeadTracker suitable for use in your application on the current device.

◆ createScreen()

SRAPI SR_screen createScreen ( SRContext  context)

Creates a functional Screen instance.

Parameters
contextis the environment in which created senses are kept track of
Returns
SR_screen ( void* ) which is the address of the C++ SR::Screen implementation. It can be used to provide screen data.

The screen class reads the current screen parameters and makes calls to get those parameters available.

◆ createSwitchableLensHint()

SRAPI SR_switchableLensHint createSwitchableLensHint ( SRContext  context)

Creates a functional SwitchableLensHints instance.

Parameters
contextis the environment in which created senses are kept track of
Returns
pointer to instance of underlying SR::SwitchableLensHint

◆ createSystemEventListener()

SRAPI SR_systemEventListener createSystemEventListener ( SR_systemSense  systemSense,
void(*)(SR_systemEvent acceptSystemEventCallback 
)

Add a new callback function to listen to a specific systemSense.

Parameters
systemSenseis the address of the C++ SR::SystemSense implementation to connect with. It is provided by the createSystemSense function.
acceptSystemEventCallbackis a function pointer to a callback function which will be called when new SR_systemEvent data is available.
Returns
SR_systemEventListener ( void* ) which should be used to clean up the underlying objects used to facilitate the hand event update callbacks.

◆ createSystemSense()

SRAPI SR_systemSense createSystemSense ( SRContext  context)

Creates a functional SystemSense instance.

Parameters
contextis the environment in which created senses are kept track of
Returns
SR_systemSense ( void* ) which is the address of the C++ SR::SystemSense implementation. It can be used to provide streams of system event data.

◆ createVideoListener()

SRAPI SR_videoListener createVideoListener ( SR_camera  camera,
void(*)(SR_videoFrame acceptVideoCallback 
)

Create a new callback function to listen to a specific camera.

Parameters
camerais the address of the C++ SR::Camera implementation to connect with. It is provided by the createCamera function.
acceptVideoCallbackis a function pointer to a callback function which will be called when new SR_videoFrame data is available.
Returns
SR_videoListener ( void* ) which should be used to clean up the underlying objects used to facilitate the video update callbacks.

◆ deleteEyePairListener()

SRAPI void deleteEyePairListener ( SR_eyePairListener  eyePairListener)

Cleans up underlying object instances used to facilitate eye position update callbacks.

Parameters
eyePairListener( void* ) provided by the createEyePairListener function.

◆ deleteHandEventListener()

SRAPI void deleteHandEventListener ( SR_handEventListener  handEventListener)

Cleans up underlying object instances used to facilitate hand event update callbacks.

Parameters
handEventListener( void* ) provided by the createHandEventListener function.

◆ deleteHandPoseListener()

SRAPI void deleteHandPoseListener ( SR_handPoseListener  handPoseListener)

Cleans up underlying object instances used to facilitate hand pose update callbacks.

Parameters
handPoseListener( void* ) provided by the createHandPoseListener function.

◆ deleteHeadListener()

SRAPI void deleteHeadListener ( SR_headListener  headListener)

Cleans up underlying object instances used to facilitate head position update callbacks.

Parameters
headListener( void* ) provided by the creaeteHeadListener function.

◆ deleteSRContext()

SRAPI void deleteSRContext ( SRContext  context)

Delete and clean up the instance of SRContext.

Parameters
contextis provided from newSRContext

◆ deleteSwitchableLensHint()

SRAPI void deleteSwitchableLensHint ( SR_switchableLensHint  lensHint)

Cleans up underlying object instances used to facilitate indicating lens switch preferance.

Parameters
lensHint( void* ) provided by the createSwitchableLensHint function.

◆ deleteSystemEventListener()

SRAPI void deleteSystemEventListener ( SR_systemEventListener  systemEventListener)

Cleans up underlying object instances used to facilitate system event update callbacks.

Parameters
systemEventListener( void* ) provided by the createSystemEventListener function.

◆ deleteVideoListener()

SRAPI void deleteVideoListener ( SR_videoListener  videoListener)

Cleans up underlying object instances used to facilitate video update callbacks.

Parameters
videoListener( void* ) provided by the createVideoListener function.

◆ getDotPitch()

SRAPI const float getDotPitch ( SR_screen  screen)

Returns distance between pixels in cm.

Parameters
screen( SR::Screen* ) is the screen object created through the C API.
Returns
( const float ) Distance between pixels in screen.

◆ getPhysicalResolutionHeight()

SRAPI const int getPhysicalResolutionHeight ( SR_screen  screen)

Returns physical resolution height of screen instance.

Parameters
screen( SR::Screen* ) is the screen object created through the C API.
Returns
( const int ) Screen physical resolution height.

◆ getPhysicalResolutionWidth()

SRAPI const int getPhysicalResolutionWidth ( SR_screen  screen)

Returns physical resolution width of screen instance.

Parameters
screen( SR::Screen* ) is the screen object created through the C API.
Returns
( const int ) Screen physical resolution width.

◆ getPhysicalSizeHeight()

SRAPI const float getPhysicalSizeHeight ( SR_screen  screen)

Returns physical screen height in cm.

Parameters
screen( SR::Screen* ) is the screen object created through the C API.
Returns
( const float ) Screen physical height.

◆ getPhysicalSizeWidth()

SRAPI const float getPhysicalSizeWidth ( SR_screen  screen)

Returns physical screen width in cm.

Parameters
screen( SR::Screen* ) is the screen object created through the C API.
Returns
( const float ) Screen physical width.

◆ getResolutionHeight()

SRAPI const int getResolutionHeight ( SR_screen  screen)

Returns resolution height of screen instance as seen by user.

Parameters
screen( SR::Screen* ) is the screen object created through the C API.
Returns
( const int ) Screen resolution height.

◆ getResolutionWidth()

SRAPI const int getResolutionWidth ( SR_screen  screen)

Returns resolution width of screen instance as seen by user.

Parameters
screen( SR::Screen* ) is the screen object created through the C API.
Returns
( const int ) Screen resolution width.

◆ getSRPlatformVersion()

SRAPI const char * getSRPlatformVersion ( )

Get the full version SR Platform in [MAJOR].[MINOR].[PATCH].[GIT_HASH].

Returns
the full version SR Platform

◆ initializeSRContext()

SRAPI void initializeSRContext ( SRContext  context)

Initialize all senses.

Parameters
contextis provided from newSRContext

Call after all objects and senses have been added.

◆ lensDisableHint()

SRAPI void lensDisableHint ( SR_switchableLensHint  lensHint)

Expresses preference to disable the lens to minimize the effect on the light transmitted through it

◆ lensEnableHint()

SRAPI void lensEnableHint ( SR_switchableLensHint  lensHint)

Expresses preference to enable the lens such that it affects the light transmitted through it

◆ newSRContext()

SRAPI SRContext newSRContext ( )

Construct an instance of SRContext, the environment in which created senses are kept track of.

Returns
a new instance of SRContext

◆ newSRContextLensPreference()

SRAPI SRContext newSRContextLensPreference ( bool  lensPreference)

Construct an instance of SRContext, the environment in which created senses are kept track of.

Parameters
lensPreferenceis the initial lens preference. If it is set to false and there are no other applications which prefer the lens to be turned on, it will start in off state.
Returns
a new instance of SRContext