public override NativeArray <XRTextureDescriptor> GetTextureDescriptors(XRTextureDescriptor defaultDescriptor, Allocator allocator) { var remote = ARKitStreamReceiver.Instance; if (remote == null) { return(new NativeArray <XRTextureDescriptor>(0, allocator)); } var yTex = remote.YTextrue; var cbcrTex = remote.CbCrTexture; if (yTex == null || cbcrTex == null) { return(new NativeArray <XRTextureDescriptor>(0, allocator)); } var arr = new NativeArray <XRTextureDescriptor>(2, allocator); arr[0] = new TextureDescriptor(yTex, _TEXTURE_Y); arr[1] = new TextureDescriptor(cbcrTex, _TEXTURE_CB_CR); return(arr); }
public override bool TryGetHumanDepth(out XRTextureDescriptor humanDepthDescriptor) { if (ARKitStreamReceiver.Instance == null) { humanDepthDescriptor = default(XRTextureDescriptor); return(false); } var tex = ARKitStreamReceiver.Instance.DepthTexture; if (tex == null) { humanDepthDescriptor = default(XRTextureDescriptor); return(false); } humanDepthDescriptor = new TextureDescriptor(tex, 0); return(true); }
public static void ImplicitTest() { TextureDescriptor d1 = new TextureDescriptor() { nativeTexture = new IntPtr(99), width = 10, height = 20, mipmapCount = 1, format = TextureFormat.R8, propertyNameId = 30 }; XRTextureDescriptor xr = d1; Debug.Log(xr); TextureDescriptor d2 = xr; Assert.AreEqual(d1, d2); }
public override bool TryGetHumanStencil(out XRTextureDescriptor humanStencilDescriptor) { var recevier = ARKitReceiver.Instance; if (recevier == null) { humanStencilDescriptor = default(XRTextureDescriptor); return(false); } var tex = recevier.StencilTexture; if (tex == null) { humanStencilDescriptor = default(XRTextureDescriptor); return(false); } humanStencilDescriptor = new TextureDescriptor(tex, 0); return(true); }