public void AvailableDepthDataTypesTest()
        {
#if !MONOMAC
            TestRuntime.AssertDevice();
#endif
            TestRuntime.AssertXcodeVersion(9, 0);

            // xamarinmonkey.heic is the new photo format, also this one includes depth data
            var imgdata = NSData.FromUrl(NSBundle.MainBundle.GetUrlForResource("xamarinmonkey", "heic", "CoreImage"));
            Assert.NotNull(imgdata, "imgdata");

            var imageSource = CGImageSource.FromData(imgdata);
            Assert.NotNull(imageSource, "imageSource");

            // fetching the image count works around a crash in CopyAuxiliaryDataInfo on macOS 10.15 (https://github.com/xamarin/maccore/issues/1802).
            Assert.AreNotEqual(0, imageSource.ImageCount, "ImageCount");

            var info = imageSource.CopyAuxiliaryDataInfo(0, CGImageAuxiliaryDataType.Disparity);
            Assert.NotNull(info, "info");

            NSError err;
            var     depthData = AVDepthData.Create(info, out err);
            Assert.NotNull(depthData, "depthData");
            Assert.NotNull(depthData.AvailableDepthDataTypes, "AvailableDepthDataTypes");
        }
Beispiel #2
0
        public void AvailableDepthDataTypesTest()
        {
#if !MONOMAC
            TestRuntime.AssertDevice();
#endif
            TestRuntime.AssertXcodeVersion(9, 0);

            // xamarinmonkey.heic is the new photo format, also this one includes depth data
            var imgdata = NSData.FromUrl(NSBundle.MainBundle.GetUrlForResource("xamarinmonkey", "heic", "CoreImage"));
            Assert.NotNull(imgdata, "imgdata");

            var imageSource = CGImageSource.FromData(imgdata);
            Assert.NotNull(imageSource, "imageSource");

            var info = imageSource.CopyAuxiliaryDataInfo(0, CGImageAuxiliaryDataType.Disparity);
            Assert.NotNull(info, "info");

            NSError err;
            var     depthData = AVDepthData.Create(info, out err);
            Assert.NotNull(depthData, "depthData");
            Assert.NotNull(depthData.AvailableDepthDataTypes, "AvailableDepthDataTypes");
        }
Beispiel #3
0
        public void AvailableDepthDataTypesTest()
        {
            TestRuntime.AssertDevice();
            TestRuntime.AssertXcodeVersion(9, 0);

            // xamarinmonkey.heic is the new photo format, also this one includes depth data
            var imgdata = NSData.FromFile("CoreImage/xamarinmonkey.heic");

            Assert.NotNull(imgdata, "imgdata");

            var imageSource = CGImageSource.FromData(imgdata);

            Assert.NotNull(imageSource, "imageSource");

            var info = imageSource.CopyAuxiliaryDataInfo(0, CGImageAuxiliaryDataType.Disparity);

            Assert.NotNull(info, "info");

            NSError err;
            var     depthData = AVDepthData.Create(info, out err);

            Assert.NotNull(depthData, "depthData");
            Assert.NotNull(depthData.AvailableDepthDataTypes, "AvailableDepthDataTypes");
        }