OSVR-Core  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Imaging interface (underlying C API)

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. More...

Typedefs

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

Functions

OSVR_ReturnCode osvrDeviceImagingConfigure (OSVR_DeviceInitOptions opts, OSVR_ImagingDeviceInterface *iface, OSVR_ChannelCount numSensors=1)
 Specify that your device will implement the Imaging interface. More...
 
OSVR_ReturnCode osvrDeviceImagingReportFrame (OSVR_DeviceToken dev, OSVR_ImagingDeviceInterface iface, OSVR_ImagingMetadata metadata, OSVR_ImageBufferElement *imageData, OSVR_ChannelCount sensor, 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. 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

OSVR_ReturnCode osvrDeviceImagingConfigure ( OSVR_DeviceInitOptions  opts,
OSVR_ImagingDeviceInterface iface,
OSVR_ChannelCount  numSensors = 1 
)

#include <osvr/PluginKit/ImagingInterfaceC.h>

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.
OSVR_ReturnCode osvrDeviceImagingReportFrame ( OSVR_DeviceToken  dev,
OSVR_ImagingDeviceInterface  iface,
OSVR_ImagingMetadata  metadata,
OSVR_ImageBufferElement imageData,
OSVR_ChannelCount  sensor,
OSVR_TimeValue const *  timestamp 
)

#include <osvr/PluginKit/ImagingInterfaceC.h>

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.