6 namespace oni {
namespace driver {
11 m_oniType(sensorType),
51 else m_videoMode.pixelFormat = ONI_PIXEL_FORMAT_GRAY8;
115 return ONI_STATUS_OK;
118 #if defined(RS2_TRACE_NOT_SUPPORTED_CMDS) 121 return ONI_STATUS_NOT_SUPPORTED;
141 return ONI_STATUS_ERROR;
147 return ONI_STATUS_ERROR;
150 if (
getDevice()->getRegistrationMode() == ONI_IMAGE_REGISTRATION_DEPTH_TO_COLOR)
158 float point[3] = {0, 0, 0};
159 float transformed_point[3] = { 0 };
168 pixel[0] = (float)depthX;
169 pixel[1] = (float)depthY;
177 *pColorX = (int)pixel[0];
178 *pColorY = (int)pixel[1];
183 return ONI_STATUS_OK;
227 && sp.
format == pixelFormat
250 && sp.
format == pixelFormat
251 && sp.
width == reqMode->resolutionX
252 && sp.
height == reqMode->resolutionY
264 const int tableSize = (int)(table.size() *
sizeof(
uint16_t));
265 if (dst && size && *size >= tableSize)
269 memcpy(dst, &table[0], tableSize);
279 if (src && size >= 0)
281 const int elemCount = size /
sizeof(
uint16_t);
284 table.resize(elemCount);
285 memcpy(&table[0], src, elemCount *
sizeof(
uint16_t));
static void rs2_transform_point_to_point(float to_point[3], const struct rs2_extrinsics *extrin, const float from_point[3])
#define RS2_PROJECT_POINT_TO_PIXEL
virtual OniStatus invoke(int commandId, void *data, int dataSize)
float rs2_get_option(const rs2_options *options, rs2_option option, rs2_error **error)
bool setTable(const void *src, int size, std::vector< uint16_t > &table)
std::vector< uint16_t > m_d2s
bool getTable(void *dst, int *size, const std::vector< uint16_t > &table)
virtual OniStatus start()
static void rs2_fov(const struct rs2_intrinsics *intrin, float to_fov[2])
void updateConfiguration()
OniSensorType convertStreamType(rs2_stream type)
void rs2_get_extrinsics(const rs2_stream_profile *from, const rs2_stream_profile *to, rs2_extrinsics *extrin, rs2_error **error)
rs2_extrinsics m_extrinsicsDepthToColor
virtual OniStatus convertDepthToColorCoordinates(StreamBase *colorStream, int depthX, int depthY, OniDepthPixel depthZ, int *pColorX, int *pColorY)
Rs2StreamProfileInfo * getCurrentProfile()
class Rs2Device * getDevice()
#define rsTraceError(format,...)
static void rs2_deproject_pixel_to_point(float point[3], const struct rs2_intrinsics *intrin, const float pixel[2], float depth)
virtual OniBool isCommandSupported(int commandId)
void rs2_delete_sensor(rs2_sensor *sensor)
std::vector< Rs2StreamProfileInfo > m_profiles
rs2_format
A stream's format identifies how binary data is encoded within a frame.
#define rsLogDebug(format,...)
Rs2Stream(OniSensorType sensorType)
void rs2_get_video_stream_intrinsics(const rs2_stream_profile *mode, rs2_intrinsics *intrinsics, rs2_error **error)
bool m_needUpdateExtrinsicsDepthToColor
GLenum GLenum GLsizei void * table
#define rsTraceFunc(format,...)
static void rs2_project_point_to_pixel(float pixel[2], const struct rs2_intrinsics *intrin, const float point[3])
class Rs2Device * m_device
rs2_intrinsics m_intrinsics
OniSensorType getOniType() const
OniStatus initialize(class Rs2Device *device, rs2_sensor *sensor, int sensorId, int streamId, std::vector< Rs2StreamProfileInfo > *profiles)
const rs2_stream_profile * profile
std::vector< uint16_t > m_s2d
OniPixelFormat convertPixelFormat(rs2_format type)
const unsigned short D2S[]
bool isVideoModeSupported(OniVideoMode *reqMode)