25 #ifndef INCLUDED_Imaging_h_GUID_5473F500_E901_419D_46D2_62ED5CB57412
26 #define INCLUDED_Imaging_h_GUID_5473F500_E901_419D_46D2_62ED5CB57412
37 #include <boost/shared_ptr.hpp>
38 #include <boost/noncopyable.hpp>
52 #ifndef OSVR_DOXYGEN_EXTERNAL
68 : m_cb(cb), m_userdata(userdata),
72 &ImagingCallbackRegistration::handleRawImagingCallback,
76 class ImagingDeleter {
90 handleRawImagingCallback(
void *userdata,
96 newReport.
sensor = report->sensor;
97 newReport.
metadata = report->state.metadata;
98 newReport.
buffer.reset(report->state.data,
99 ImagingDeleter(self->m_ctx));
100 self->m_cb(self->m_userdata, *timestamp, newReport);
106 friend void osvr::clientkit::registerImagingCallback(
111 #endif // OSVR_DOXYGEN_EXTERNAL
113 inline void registerImagingCallback(
Interface &iface,
116 util::boost_util::DeletablePtr ptr(
127 #endif // INCLUDED_Imaging_h_GUID_5473F500_E901_419D_46D2_62ED5CB57412
Interface handle object. Typically acquired from a ClientContext.
Base class for objects that just need to be generically deletable.
OSVR_EXTERN_C_BEGIN OSVR_ReturnCode osvrClientFreeImage(OSVR_ClientContext ctx, OSVR_ImageBufferElement *buf)
Free an image buffer returned from a callback.
OSVR_ChannelCount sensor
The device sensor number this frame came from.
The user-friendly imaging report. Note that passing this around by value is OK (doesn't copy the imag...
ImageBufferPtr buffer
A shared pointer with custom deleter that owns the underlying image data buffer for the frame...
OSVR_ClientInterface get()
Get the raw OSVR_ClientInterface from this wrapper.
OSVR_ClientContext get()
Gets the bare OSVR_ClientContext.
Class serving to maintain the registration of and wrap a friendly imaging callback.
OSVR_ImagingMetadata metadata
Metadata containing the properties of this frame.
Header providing a C++ wrapper around TimeValueC.h.
Header defining a base class for objects that just need to be generically deletable.
Header containing the inline implementation of Interface.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
ClientContext & getContext()
Get the associated ClientContext.
unsigned char OSVR_ImageBufferElement
Type for raw buffer access to image data.
void takeOwnership(util::boost_util::DeletablePtr const &obj)
Take (shared) ownership of some Deletable object.
OSVR_ReturnCode osvrRegisterImagingCallback(OSVR_ClientInterface iface, OSVR_ImagingCallback cb, void *userdata)
Register a callback for Imaging reports on an interface.
void(* ImagingCallback)(void *userdata, util::time::TimeValue const ×tamp, ImagingReport report)
The user-friendly imaging callback type.