Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CoreImage] Update Xcode 13.0 bindings betas 1 and 3 #12601

Merged
merged 6 commits into from Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/CoreImage/CIFilter.cs
Expand Up @@ -185,6 +185,12 @@ internal void SetNInt (string key, nint value)
SetValueForKey (new NSNumber (value), nskey);
}

internal void SetNUInt (string key, nuint value)
{
using (var nskey = new NSString (key))
SetValueForKey (new NSNumber (value), nskey);
}

internal void SetBool (string key, bool value)
{
using (var nskey = new NSString (key))
Expand Down Expand Up @@ -229,6 +235,11 @@ internal nint GetNInt (string key)
return Get<NSNumber> (key)?.NIntValue ?? default (nint);
}

internal nuint GetNUInt (string key)
{
return Get<NSNumber> (key)?.NUIntValue ?? default (nuint);
}

internal bool GetBool (string key)
{
return Get<NSNumber> (key)?.BoolValue ?? default (bool);
Expand Down Expand Up @@ -454,6 +465,8 @@ internal static CIFilter FromName (string? filterName, IntPtr handle)
return new CIMaximumComponent (handle);
case "CIMinimumComponent":
return new CIMinimumComponent (handle);
case "CIPersonSegmentation":
return new CIPersonSegmentation (handle);
case "CIPerspectiveTile":
return new CIPerspectiveTile (handle);
case "CIPerspectiveTransform":
Expand Down Expand Up @@ -506,6 +519,16 @@ internal static CIFilter FromName (string? filterName, IntPtr handle)
return new CIConvolution9Horizontal (handle);
case "CIConvolution9Vertical":
return new CIConvolution9Vertical (handle);
case "CIConvolutionRGB3X3":
return new CIConvolutionRGB3X3 (handle);
case "CIConvolutionRGB5X5":
return new CIConvolutionRGB5X5 (handle);
case "CIConvolutionRGB7X7":
return new CIConvolutionRGB7X7 (handle);
case "CIConvolutionRGB9Horizontal":
return new CIConvolutionRGB9Horizontal (handle);
case "CIConvolutionRGB9Vertical":
return new CIConvolutionRGB9Vertical (handle);
case "CILinearToSRGBToneCurve":
return new CILinearToSRGBToneCurve (handle);
case "CIPerspectiveTransformWithExtent":
Expand Down Expand Up @@ -552,12 +575,16 @@ internal static CIFilter FromName (string? filterName, IntPtr handle)
return new CILinearBurnBlendMode (handle);
case "CILinearDodgeBlendMode":
return new CILinearDodgeBlendMode (handle);
case "CILinearLightBlendMode":
return new CILinearLightBlendMode (handle);
case "CIPerspectiveCorrection":
return new CIPerspectiveCorrection (handle);
case "CIPinLightBlendMode":
return new CIPinLightBlendMode (handle);
case "CISubtractBlendMode":
return new CISubtractBlendMode (handle);
case "CIVividLightBlendMode":
return new CIVividLightBlendMode (handle);
case "CIAccordionFoldTransition":
return new CIAccordionFoldTransition (handle);
case "CIAreaAverage":
Expand Down
243 changes: 238 additions & 5 deletions src/coreimage.cs
Expand Up @@ -441,6 +441,16 @@ interface CIContext_ImageRepresentation {
[return: NullAllowed]
NSData GetHeifRepresentation (CIImage image, CIFormat format, CGColorSpace colorSpace, CIImageRepresentationOptions options);

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0)]
[Export ("HEIF10RepresentationOfImage:colorSpace:options:error:")]
[return: NullAllowed]
NSData GetHeif10Representation (CIImage image, CGColorSpace colorSpace, NSDictionary options, [NullAllowed] out NSError error);

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0)]
[Wrap ("GetHeif10Representation (This, image, colorSpace, options.GetDictionary ()!, out error)")]
[return: NullAllowed]
NSData GetHeif10Representation (CIImage image, CGColorSpace colorSpace, CIImageRepresentationOptions options, [NullAllowed] out NSError error);

[iOS (11,0)][TV (11,0)][Mac (10,13)]
[Export ("PNGRepresentationOfImage:format:colorSpace:options:")]
[return: NullAllowed]
Expand Down Expand Up @@ -475,6 +485,14 @@ interface CIContext_ImageRepresentation {
[Wrap ("WriteHeifRepresentation (This, image, url, format, colorSpace, options.GetDictionary ()!, out error)")]
bool WriteHeifRepresentation (CIImage image, NSUrl url, CIFormat format, CGColorSpace colorSpace, CIImageRepresentationOptions options, [NullAllowed] out NSError error);

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0)]
[Export ("writeHEIF10RepresentationOfImage:toURL:colorSpace:options:error:")]
bool WriteHeif10Representation (CIImage image, NSUrl url, CGColorSpace colorSpace, NSDictionary options, [NullAllowed] out NSError error);

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0)]
[Wrap ("WriteHeif10Representation (This, image, url, colorSpace, options.GetDictionary ()!, out error)")]
bool WriteHeif10Representation (CIImage image, NSUrl url, CGColorSpace colorSpace, CIImageRepresentationOptions options, [NullAllowed] out NSError error);

[iOS (11,0)][TV (11,0)][Mac (10,13)]
[Export ("writePNGRepresentationOfImage:toURL:format:colorSpace:options:error:")]
bool WritePngRepresentation (CIImage image, NSUrl url, CIFormat format, CGColorSpace colorSpace, NSDictionary options, [NullAllowed] out NSError error);
Expand Down Expand Up @@ -629,43 +647,239 @@ interface CIFilter : NSSecureCoding, NSCopying {

// CIRAWFilter (CIFilter)

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[iOS (10,0)]
[TV (10,0)]
[Static]
[Export ("filterWithImageURL:options:")]
CIFilter CreateRawFilter (NSUrl url, NSDictionary options);

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[iOS (10,0)]
[TV (10,0)]
[Static]
[Wrap ("CreateRawFilter (url, options.GetDictionary ()!)")]
CIFilter CreateRawFilter (NSUrl url, CIRawFilterOptions options);

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[iOS (10,0)]
[TV (10,0)]
[Static]
[Export ("filterWithImageData:options:")]
CIFilter CreateRawFilter (NSData data, NSDictionary options);

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[iOS (10,0)]
[TV (10,0)]
[Static]
[Wrap ("CreateRawFilter (data, options.GetDictionary ()!)")]
CIFilter CreateRawFilter (NSData data, CIRawFilterOptions options);

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
[Static]
[Export ("filterWithCVPixelBuffer:properties:options:")]
CIFilter CreateRawFilter (CVPixelBuffer pixelBuffer, NSDictionary properties, NSDictionary options);

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
[Static]
[Wrap ("CreateRawFilter (pixelBuffer, properties, options.GetDictionary ()!)")]
CIFilter CreateRawFilter (CVPixelBuffer pixelBuffer, NSDictionary properties, CIRawFilterOptions options);
}

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0)]
public enum CIRawDecoderVersion : long {

[Field ("CIRAWDecoderVersionNone")]
VersionNone,

[Field ("CIRAWDecoderVersion8")]
Version8,

[Field ("CIRAWDecoderVersion8DNG")]
Version8Dng,

[Field ("CIRAWDecoderVersion7")]
Version7,

[Field ("CIRAWDecoderVersion7DNG")]
Version7Dng,

[Field ("CIRAWDecoderVersion6")]
Version6,

[Field ("CIRAWDecoderVersion6DNG")]
Version6Dng,
}

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0)]
[BaseType (typeof(CIFilter), Name="CIRAWFilter")]
interface CIRawFilter : CIFilterProtocol
{
[Static]
[Export ("supportedCameraModels")]
string[] SupportedCameraModels { get; }

[Export ("supportedDecoderVersions")]
string[] SupportedDecoderVersions { get; }

[Export ("nativeSize")]
CGSize NativeSize { get; }

[Export ("properties")]
NSDictionary Properties { get; }

[Export ("orientation", ArgumentSemantic.Assign)]
CGImagePropertyOrientation Orientation { get; set; }

[Export ("draftModeEnabled")]
bool DraftModeEnabled { [Bind ("isDraftModeEnabled")] get; set; }

[Export ("decoderVersion", ArgumentSemantic.Retain)]
string DecoderVersion { get; set; }

[Export ("scaleFactor")]
float ScaleFactor { get; set; }

[Export ("exposure")]
float Exposure { get; set; }

[Export ("baselineExposure")]
float BaselineExposure { get; set; }

[Export ("shadowBias")]
float ShadowBias { get; set; }

[Export ("boostAmount")]
float BoostAmount { get; set; }

[Export ("boostShadowAmount")]
float BoostShadowAmount { get; set; }

[Export ("gamutMappingEnabled")]
bool GamutMappingEnabled { [Bind ("isGamutMappingEnabled")] get; set; }

[Export ("lensCorrectionSupported")]
bool LensCorrectionSupported { [Bind ("isLensCorrectionSupported")] get; }

[Export ("lensCorrectionEnabled")]
bool LensCorrectionEnabled { [Bind ("isLensCorrectionEnabled")] get; set; }

[Export ("luminanceNoiseReductionSupported")]
bool LuminanceNoiseReductionSupported { [Bind ("isLuminanceNoiseReductionSupported")] get; }

[Export ("luminanceNoiseReductionAmount")]
float LuminanceNoiseReductionAmount { get; set; }

[Export ("colorNoiseReductionSupported")]
bool ColorNoiseReductionSupported { [Bind ("isColorNoiseReductionSupported")] get; }

[Export ("colorNoiseReductionAmount")]
float ColorNoiseReductionAmount { get; set; }

[Export ("sharpnessSupported")]
bool SharpnessSupported { [Bind ("isSharpnessSupported")] get; }

[Export ("sharpnessAmount")]
float SharpnessAmount { get; set; }

[Export ("contrastSupported")]
bool ContrastSupported { [Bind ("isContrastSupported")] get; }

[Export ("contrastAmount")]
float ContrastAmount { get; set; }

[Export ("detailSupported")]
bool DetailSupported { [Bind ("isDetailSupported")] get; }

[Export ("detailAmount")]
float DetailAmount { get; set; }

[Export ("moireReductionSupported")]
bool MoireReductionSupported { [Bind ("isMoireReductionSupported")] get; }

[Export ("moireReductionAmount")]
float MoireReductionAmount { get; set; }

[Export ("localToneMapSupported")]
bool LocalToneMapSupported { [Bind ("isLocalToneMapSupported")] get; }

[Export ("localToneMapAmount")]
float LocalToneMapAmount { get; set; }

[Export ("extendedDynamicRangeAmount")]
float ExtendedDynamicRangeAmount { get; set; }

[Export ("neutralChromaticity", ArgumentSemantic.Assign)]
CGPoint NeutralChromaticity { get; set; }

[Export ("neutralLocation", ArgumentSemantic.Assign)]
CGPoint NeutralLocation { get; set; }

[Export ("neutralTemperature")]
float NeutralTemperature { get; set; }

[Export ("neutralTint")]
float NeutralTint { get; set; }

[NullAllowed, Export ("linearSpaceFilter", ArgumentSemantic.Retain)]
CIFilter LinearSpaceFilter { get; set; }

[NullAllowed, Export ("previewImage")]
CIImage PreviewImage { get; }

[NullAllowed, Export ("portraitEffectsMatte")]
CIImage PortraitEffectsMatte { get; }

[NullAllowed, Export ("semanticSegmentationSkinMatte")]
CIImage SemanticSegmentationSkinMatte { get; }

[NullAllowed, Export ("semanticSegmentationHairMatte")]
CIImage SemanticSegmentationHairMatte { get; }

[NullAllowed, Export ("semanticSegmentationGlassesMatte")]
CIImage SemanticSegmentationGlassesMatte { get; }

[NullAllowed, Export ("semanticSegmentationSkyMatte")]
CIImage SemanticSegmentationSkyMatte { get; }

[NullAllowed, Export ("semanticSegmentationTeethMatte")]
CIImage SemanticSegmentationTeethMatte { get; }

[Static]
[Export ("filterWithImageURL:")]
[return: NullAllowed]
CIRawFilter Create (NSUrl url);

[Static]
[Export ("filterWithImageData:identifierHint:")]
[return: NullAllowed]
CIRawFilter Create (NSData data, [NullAllowed] string identifierHint);

[Static]
[Export ("filterWithCVPixelBuffer:properties:")]
[return: NullAllowed]
CIRawFilter Create (CVPixelBuffer buffer, NSDictionary properties);
}

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[TV (10,0)]
[Static]
[Internal]
Expand Down Expand Up @@ -792,6 +1006,9 @@ interface CIRawFilterKeys {
NSString ActiveKeysKey { get; }
}

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CIRawFilter' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CIRawFilter' instead.")]
[TV (10,0)]
[StrongDictionary ("CIRawFilterKeys")]
interface CIRawFilterOptions {
Expand Down Expand Up @@ -2252,6 +2469,13 @@ interface CIImageProvider {
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // avoid crashes
interface CIKernel {

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0)]
[Static]
[Export ("kernelsWithMetalString:error:")]
[return: NullAllowed]
CIKernel[] FromMetalSource (string source, [NullAllowed] out NSError error);

[Deprecated (PlatformName.iOS, 12, 0)]
[Deprecated (PlatformName.MacOSX, 10, 14)]
[Static, Export ("kernelsWithString:")]
Expand Down Expand Up @@ -2291,7 +2515,7 @@ interface CIKernel {
[Export ("name")]
string Name { get; }

#if MONOMAC
#if MONOMAC || __MACCATALYST__
[Export ("setROISelector:")]
void SetRegionOfInterestSelector (Selector aMethod);
#endif
Expand Down Expand Up @@ -9353,11 +9577,20 @@ interface CILinearLightBlendMode : CIFilterProtocol {
[Mac (12,0)]
[MacCatalyst (15,0)]
[BaseType (typeof (CIFilter))]
interface CIPersonSegmentation : CIFilterProtocol {
interface CIPersonSegmentation : CIPersonSegmentationProtocol {
}

[CoreImageFilterProperty ("inputQualityLevel")]
// 0 == accurate, 1 == balanced, 2 == fast
int QualityLevel { get; set; }
[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0)]
[Protocol (Name="CIPersonSegmentation")]
interface CIPersonSegmentationProtocol : CIFilterProtocol {

[Abstract]
[NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)]
CIImage InputImage { get; set; }

[Abstract]
[Export ("qualityLevel")]
nuint QualityLevel { get; set; }
}

[CoreImageFilter]
Expand Down