浏览代码

Disable raw images if acquisition fails

/4.0
Tim Mowrer 5 年前
当前提交
fe040717
共有 1 个文件被更改,包括 22 次插入14 次删除
  1. 36
      Assets/Scripts/TestCameraImage.cs

36
Assets/Scripts/TestCameraImage.cs


void UpdateHumanDepthImage()
{
if (occlusionManager == null)
if (m_RawHumanDepthImage == null)
if (!occlusionManager.TryAcquireHumanDepthCpuImage(out XRCpuImage image))
return;
using (image)
if (occlusionManager && occlusionManager.TryAcquireHumanDepthCpuImage(out XRCpuImage image))
UpdateRawImage(m_RawHumanDepthImage, image);
using (image)
{
UpdateRawImage(m_RawHumanDepthImage, image);
}
}
else
{
m_RawHumanDepthImage.enabled = false;
if (occlusionManager == null)
return;
if (!occlusionManager.TryAcquireHumanStencilCpuImage(out XRCpuImage image))
return;
using (image)
if (occlusionManager && occlusionManager.TryAcquireHumanStencilCpuImage(out XRCpuImage image))
{
using (image)
{
UpdateRawImage(m_RawHumanStencilImage, image);
}
}
else
UpdateRawImage(m_RawHumanStencilImage, image);
m_RawHumanStencilImage.enabled = false;
}
}

// "Apply" the new pixel data to the Texture2D.
texture.Apply();
// Make sure it's enabled.
rawImage.enabled = true;
}
void OnCameraFrameReceived(ARCameraFrameEventArgs eventArgs)

正在加载...
取消
保存