[corevideo] Small update for iOS 10 beta 1 (#280)

* [corevideo] Small update for iOS 10 beta 1

and tests for 4CC to enums conversion
This commit is contained in:
Sebastien Pouliot 2016-06-28 16:25:24 -04:00 коммит произвёл GitHub
Родитель a94980dfae
Коммит e3ac382fc7
6 изменённых файлов: 21 добавлений и 49 удалений

Просмотреть файл

@ -84,6 +84,7 @@ namespace XamCore.CoreVideo {
WouldExceedAllocationThreshold = -6689,
PoolAllocationFailed = -6690,
InvalidPoolAttributes = -6691,
Retry = -6692,
Last = -6699,
}
@ -140,6 +141,12 @@ namespace XamCore.CoreVideo {
TwoComponent32Float = 0x32433066, // '2C0f'
CV64RGBAHalf = 0x52476841, // 'RGhA'
CV128RGBAFloat = 0x52476641, // 'RGfA'
// iOS 10
CV30RgbLePackedWideGamut = 0x77333072, // 'w30r'
CV14BayerGrbg = 0x67726234, // 'grb4',
CV14BayerRggb = 0x72676734, // 'rgg4',
CV14BayerBggr = 0x62676734, // 'bgg4',
CV14BayerGbrg = 0x67627234, // 'gbr4',
}
// uint64_t -> CVBase.h

Просмотреть файл

@ -166,6 +166,10 @@ namespace XamCore.CoreVideo {
[Field ("kCVImageBufferTransferFunction_ITU_R_2020")]
NSString TransferFunction_ITU_R_2020 { get; }
[iOS (10,0)][Mac (10,12)]
[Field ("kCVImageBufferTransferFunction_SMPTE_ST_428_1")]
NSString TransferFunction_SMPTE_ST_428_1 { get; }
[Field ("kCVImageBufferChromaLocationTopFieldKey")]
NSString ChromaLocationTopFieldKey { get; }

Просмотреть файл

@ -89,6 +89,7 @@ namespace Introspection
"Blinn",
"Blit",
"Bokeh",
"Bggr", // acronym for Blue, Green, Green, Red
"Bsln",
"Bssid",
"Bzip",
@ -157,8 +158,10 @@ namespace Introspection
"Ftps",
"Func",
"Gadu",
"Gbrg", // acronym for Green-Blue-Reg-Green
"Geocoder",
"Gpp",
"Grbg", // acronym for Green-Red-Blue-Green
"Hdmi",
"Hdr",
"Hevc", // CMVideoCodecType / High Efficiency Video Coding
@ -252,6 +255,7 @@ namespace Introspection
"Requestwith",
"Rgb",
"Rgba",
"Rggb", // acronym for Red, Green, Green, Blue
"Roi",
"Romm", // acronym: Reference Output Medium Metric
"Rpa",

Просмотреть файл

@ -76,6 +76,12 @@ namespace MonoTouchFixtures.CoreVideo {
Assert.That (FourCC ((int) CVPixelFormatType.TwoComponent32Float), Is.EqualTo ("2C0f"), "TwoComponent32Float");
Assert.That (FourCC ((int) CVPixelFormatType.CV64RGBAHalf), Is.EqualTo ("RGhA"), "CV64RGBAHalf");
Assert.That (FourCC ((int) CVPixelFormatType.CV128RGBAFloat), Is.EqualTo ("RGfA"), "CV128RGBAFloat");
Assert.That (FourCC ((int) CVPixelFormatType.CV30RgbLePackedWideGamut), Is.EqualTo ("w30r"), "CV30RbgaLePackedWideGamut");
Assert.That (FourCC ((int) CVPixelFormatType.CV14BayerGrbg), Is.EqualTo ("grb4"), "CV14Bayer_Grbg");
Assert.That (FourCC ((int) CVPixelFormatType.CV14BayerRggb), Is.EqualTo ("rgg4"), "CV14Bayer_Rggb");
Assert.That (FourCC ((int) CVPixelFormatType.CV14BayerBggr), Is.EqualTo ("bgg4"), "CV14Bayer_Bggr");
Assert.That (FourCC ((int) CVPixelFormatType.CV14BayerGbrg), Is.EqualTo ("gbr4"), "CV14Bayer_Gbrg");
}
}
}

Просмотреть файл

@ -1,48 +0,0 @@
//
// Unit tests for PixelFormatType
//
// Authors:
// Sebastien Pouliot <sebastien@xamarin.com>
//
// Copyright 2012 Xamarin Inc. All rights reserved.
//
#if !__WATCHOS__
using System;
#if XAMCORE_2_0
using Foundation;
using CoreVideo;
using ObjCRuntime;
#else
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
using MonoTouch.CoreVideo;
#endif
using NUnit.Framework;
namespace MonoTouchFixtures.CoreVideo {
[TestFixture]
[Preserve (AllMembers = true)]
public class PixelFormatTypeTest {
string FourCC (int value)
{
return new string (new char [] {
(char) (byte) (value >> 24),
(char) (byte) (value >> 16),
(char) (byte) (value >> 8),
(char) (byte) value });
}
[Test]
public void FourCC ()
{
Assert.That (FourCC ((int) CVPixelFormatType.OneComponent8), Is.EqualTo ("L008"), "OneComponent8");
Assert.That (FourCC ((int) CVPixelFormatType.TwoComponent8), Is.EqualTo ("2C08"), "TwoComponent8");
}
}
}
#endif // !__WATCHOS__

Просмотреть файл

@ -165,7 +165,6 @@
<Compile Include="AddressBook\AddressBookTest.cs" />
<Compile Include="CoreMedia\CMTimeTests.cs" />
<Compile Include="UIKit\UIDocumentTest.cs" />
<Compile Include="CoreVideo\PixelFormatTypeTest.cs" />
<Compile Include="UIKit\SplitViewControllerTest.cs" />
<Compile Include="Foundation\UrlTest.cs" />
<Compile Include="UIKit\DictationPhrase.cs" />