50 строки
1.1 KiB
C#
50 строки
1.1 KiB
C#
|
//
|
|||
|
// AVDepthDataTests.cs
|
|||
|
//
|
|||
|
// Authors:
|
|||
|
// Alex Soto <alexsoto@microsoft.com>
|
|||
|
//
|
|||
|
//
|
|||
|
// Copyright 2017 Xamarin Inc. All rights reserved.
|
|||
|
//
|
|||
|
|
|||
|
#if XAMCORE_2_0 && !__WATCHOS__
|
|||
|
|
|||
|
using System;
|
|||
|
using NUnit.Framework;
|
|||
|
|
|||
|
using AVFoundation;
|
|||
|
using Foundation;
|
|||
|
using ImageIO;
|
|||
|
|
|||
|
namespace MonoTouchFixtures.AVFoundation {
|
|||
|
|
|||
|
[TestFixture]
|
|||
|
[Preserve (AllMembers = true)]
|
|||
|
public class AVDepthDataTests {
|
|||
|
|
|||
|
[Test]
|
|||
|
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");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|