本文整理汇总了C++中XnDeviceStream::SetProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ XnDeviceStream::SetProperty方法的具体用法?C++ XnDeviceStream::SetProperty怎么用?C++ XnDeviceStream::SetProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XnDeviceStream
的用法示例。
在下文中一共展示了XnDeviceStream::SetProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setProperty
OniStatus XnOniDevice::setProperty(int propertyId, const void* data, int dataSize)
{
switch (propertyId)
{
case ONI_DEVICE_PROPERTY_IMAGE_REGISTRATION:
{
if (dataSize == sizeof(OniImageRegistrationMode))
{
OniImageRegistrationMode* mode = (OniImageRegistrationMode*)data;
// Find the depth stream in the sensor.
XnDeviceStream* pDepth = NULL;
XnStatus xnrc = m_sensor.GetStream(XN_STREAM_NAME_DEPTH, &pDepth);
if (xnrc != XN_STATUS_OK)
{
return ONI_STATUS_BAD_PARAMETER;
}
// Set the mode in the depth stream.
XnUInt64 val = (*mode == ONI_IMAGE_REGISTRATION_DEPTH_TO_COLOR) ? 1 : 0;
xnrc = pDepth->SetProperty(XN_STREAM_PROPERTY_REGISTRATION, val);
if (xnrc != XN_STATUS_OK)
{
return ONI_STATUS_ERROR;
}
}
else
{
m_driverServices.errorLoggerAppend("Unexpected size: %d != %d\n", dataSize, sizeof(OniImageRegistrationMode));
return ONI_STATUS_ERROR;
}
}
break;
default:
XnStatus nRetVal = m_sensor.DeviceModule()->SetProperty(propertyId, data, dataSize);
if (nRetVal != XN_STATUS_OK)
{
return ONI_STATUS_BAD_PARAMETER;
}
}
return ONI_STATUS_OK;
}