OSVR-Core
Typedefs | Functions
Imaging interface (underlying C API)

Used by the C++ header-only wrappers to send image reports from a device in your plugin. More...

Typedefs

typedef typedefOSVR_EXTERN_C_BEGIN struct OSVR_ImagingDeviceInterfaceObjectOSVR_ImagingDeviceInterface
 Opaque type used in conjunction with a device token to send data on an imaging interface.
 

Functions

OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrDeviceImagingConfigure (OSVR_INOUT_PTR OSVR_DeviceInitOptions opts, OSVR_OUT_PTR OSVR_ImagingDeviceInterface *iface, OSVR_IN OSVR_ChannelCount numSensors OSVR_CPP_ONLY(=1)) OSVR_FUNC_NONNULL((1
 Specify that your device will implement the Imaging interface. More...
 
OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrDeviceImagingReportFrame (OSVR_IN_PTR OSVR_DeviceToken dev, OSVR_IN_PTR OSVR_ImagingDeviceInterface iface, OSVR_IN OSVR_ImagingMetadata metadata, OSVR_IN_PTR OSVR_ImageBufferElement *imageData, OSVR_IN OSVR_ChannelCount sensor, OSVR_IN_PTR OSVR_TimeValue const *timestamp) OSVR_FUNC_NONNULL((1
 Report a frame for a sensor. More...
 

Detailed Description

Used by the C++ header-only wrappers to send image reports from a device in your plugin.

Not intended for direct usage if it can be avoided due to lifetime management and datatypes.

Function Documentation

§ osvrDeviceImagingConfigure()

OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrDeviceImagingConfigure ( OSVR_INOUT_PTR OSVR_DeviceInitOptions  opts,
OSVR_OUT_PTR OSVR_ImagingDeviceInterface iface,
OSVR_IN OSVR_ChannelCount numSensors   OSVR_CPP_ONLY=1 
)

Specify that your device will implement the Imaging interface.

Parameters
optsThe device init options object.
[out]ifaceAn interface object you should retain with the same lifetime as the device token in order to send messages conforming to an imaging interface.
numSensorsThe number of imaging sensors you will be reporting: usually just 1 (multiple channels per sensor supported). This parameter may be subject to external limitations.

§ osvrDeviceImagingReportFrame()

OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode OSVR_PLUGINKIT_EXPORT OSVR_ReturnCode osvrDeviceImagingReportFrame ( OSVR_IN_PTR OSVR_DeviceToken  dev,
OSVR_IN_PTR OSVR_ImagingDeviceInterface  iface,
OSVR_IN OSVR_ImagingMetadata  metadata,
OSVR_IN_PTR OSVR_ImageBufferElement imageData,
OSVR_IN OSVR_ChannelCount  sensor,
OSVR_IN_PTR OSVR_TimeValue const *  timestamp 
)

Report a frame for a sensor.

Takes ownership of the buffer and frees it with the osvrAlignedFree function** when done, so for stability only pass in memory allocated by osvrAlignedAlloc. The C++ wrapper for this function takes care of this automatically.

Parameters
devDevice token
ifaceImaging interface
metadataImage metadata
imageDataA pointer to a copy of the image data, will be destroyed when no longer needed using OpenCV deallocation functions.
sensorSensor number, usually 0
timestampTimestamp correlating to frame.