[coreimage] Add new API from iOS 10 beta 1 (#263)
* CIRAWFilter support is new in iOS 10 but was, mostly, already supported on OSX, however the API were not bound.
This commit is contained in:
Родитель
7b7bb6722e
Коммит
56d35304fd
|
@ -27,6 +27,7 @@
|
||||||
using XamCore.Foundation;
|
using XamCore.Foundation;
|
||||||
using XamCore.CoreGraphics;
|
using XamCore.CoreGraphics;
|
||||||
using XamCore.CoreFoundation;
|
using XamCore.CoreFoundation;
|
||||||
|
using XamCore.ObjCRuntime;
|
||||||
#if !MONOMAC
|
#if !MONOMAC
|
||||||
using XamCore.Metal;
|
using XamCore.Metal;
|
||||||
using XamCore.OpenGLES;
|
using XamCore.OpenGLES;
|
||||||
|
@ -73,26 +74,20 @@ namespace XamCore.CoreImage {
|
||||||
|
|
||||||
public int? CIImageFormat {
|
public int? CIImageFormat {
|
||||||
get {
|
get {
|
||||||
return GetInt32Value (CIContext.WorkingFormat);
|
return GetInt32Value (CIContext.WorkingFormatField);
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
SetNumberValue (CIContext.WorkingFormat, value);
|
SetNumberValue (CIContext.WorkingFormatField, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Advice ("Not available on OSX")]
|
[Mac (10,12)]
|
||||||
public bool? PriorityRequestLow {
|
public bool? PriorityRequestLow {
|
||||||
get {
|
get {
|
||||||
#if MONOMAC
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
return GetBoolValue (CIContext.PriorityRequestLow);
|
return GetBoolValue (CIContext.PriorityRequestLow);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
#if !MONOMAC
|
|
||||||
SetBooleanValue (CIContext.PriorityRequestLow, value);
|
SetBooleanValue (CIContext.PriorityRequestLow, value);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,14 +99,38 @@ namespace XamCore.CoreImage {
|
||||||
SetBooleanValue (CIContext.HighQualityDownsample, value);
|
SetBooleanValue (CIContext.HighQualityDownsample, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[iOS (7,0)]
|
||||||
|
public bool? OutputPremultiplied {
|
||||||
|
get {
|
||||||
|
return GetBoolValue (CIContext.OutputPremultiplied);
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
SetBooleanValue (CIContext.OutputPremultiplied, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
public bool? CacheIntermediates {
|
||||||
|
get {
|
||||||
|
return GetBoolValue (CIContext.CacheIntermediates);
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
SetBooleanValue (CIContext.CacheIntermediates, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public partial class CIContext {
|
public partial class CIContext {
|
||||||
|
|
||||||
|
public CIContext (CIContextOptions options) :
|
||||||
|
this (options?.Dictionary)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public static CIContext FromContext (CGContext ctx, CIContextOptions options)
|
public static CIContext FromContext (CGContext ctx, CIContextOptions options)
|
||||||
{
|
{
|
||||||
NSDictionary dict = options == null ? null : options.Dictionary;
|
return FromContext (ctx, options?.Dictionary);
|
||||||
|
|
||||||
return FromContext (ctx, dict);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CIContext FromContext (CGContext ctx)
|
public static CIContext FromContext (CGContext ctx)
|
||||||
|
@ -138,6 +157,7 @@ namespace XamCore.CoreImage {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MONOMAC
|
#if MONOMAC
|
||||||
|
[Deprecated (PlatformName.MacOSX, 10, 11)]
|
||||||
public CGLayer CreateCGLayer (CGSize size)
|
public CGLayer CreateCGLayer (CGSize size)
|
||||||
{
|
{
|
||||||
return CreateCGLayer (size, null);
|
return CreateCGLayer (size, null);
|
||||||
|
@ -145,7 +165,7 @@ namespace XamCore.CoreImage {
|
||||||
#else
|
#else
|
||||||
public static CIContext FromOptions (CIContextOptions options)
|
public static CIContext FromOptions (CIContextOptions options)
|
||||||
{
|
{
|
||||||
return FromOptions (options == null ? null : options.Dictionary);
|
return FromOptions (options?.Dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CGImage CreateCGImage (CIImage image, CGRect fromRect, CIFormat ciImageFormat, CGColorSpace colorSpace)
|
public CGImage CreateCGImage (CIImage image, CGRect fromRect, CIFormat ciImageFormat, CGColorSpace colorSpace)
|
||||||
|
|
|
@ -640,6 +640,18 @@ namespace XamCore.CoreImage {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
static public CIFilter CreateRawFilter (NSUrl url, CIRawFilterOptions options)
|
||||||
|
{
|
||||||
|
return CreateRawFilter (url, options?.Dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
static public CIFilter CreateRawFilter (NSData data, CIRawFilterOptions options)
|
||||||
|
{
|
||||||
|
return CreateRawFilter (data, options?.Dictionary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MONOMAC && !XAMCORE_3_0
|
#if MONOMAC && !XAMCORE_3_0
|
||||||
|
|
|
@ -217,39 +217,4 @@ namespace XamCore.CoreImage {
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// convenience enum (fields are used) but also a `typedef int` -> CIImage.h
|
|
||||||
public enum CIFormat {
|
|
||||||
ARGB8 = 0,
|
|
||||||
RGBAh = 1,
|
|
||||||
#if MONOMAC
|
|
||||||
RGBA16 = 2,
|
|
||||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBAf instead")]
|
|
||||||
RGBAf = 3,
|
|
||||||
|
|
||||||
// Please, do not add values into MonoMac/iOS without adding an explicit value
|
|
||||||
#elif !XAMCORE_3_0
|
|
||||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kBGRA8 instead")]
|
|
||||||
BGRA8 = 2 ,
|
|
||||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBA8 instead")]
|
|
||||||
RGBA8 = 3,
|
|
||||||
// Please, do not add values into MonoMac/iOS without adding an explicit value
|
|
||||||
#endif
|
|
||||||
kRGBAf = 4,
|
|
||||||
kBGRA8 = 5,
|
|
||||||
kRGBA8 = 6,
|
|
||||||
ABGR8 = 7,
|
|
||||||
A8 = 11,
|
|
||||||
A16 = 12,
|
|
||||||
Ah = 13,
|
|
||||||
Af = 14,
|
|
||||||
R8 = 15,
|
|
||||||
R16 = 16,
|
|
||||||
Rh = 17,
|
|
||||||
Rf = 18,
|
|
||||||
RG8 = 19,
|
|
||||||
RG16 = 20,
|
|
||||||
RGh = 21,
|
|
||||||
RGf = 22
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,4 +37,39 @@ namespace XamCore.CoreImage {
|
||||||
RightBottom = 7,
|
RightBottom = 7,
|
||||||
LeftBottom = 8
|
LeftBottom = 8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// convenience enum (fields are used) but also a `typedef int` -> CIImage.h
|
||||||
|
public enum CIFormat {
|
||||||
|
ARGB8 = 0,
|
||||||
|
RGBAh = 1,
|
||||||
|
#if MONOMAC
|
||||||
|
RGBA16 = 2,
|
||||||
|
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBAf instead")]
|
||||||
|
RGBAf = 3,
|
||||||
|
|
||||||
|
// Please, do not add values into MonoMac/iOS without adding an explicit value
|
||||||
|
#elif !XAMCORE_3_0
|
||||||
|
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kBGRA8 instead")]
|
||||||
|
BGRA8 = 2 ,
|
||||||
|
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBA8 instead")]
|
||||||
|
RGBA8 = 3,
|
||||||
|
// Please, do not add values into MonoMac/iOS without adding an explicit value
|
||||||
|
#endif
|
||||||
|
kRGBAf = 4,
|
||||||
|
kBGRA8 = 5,
|
||||||
|
kRGBA8 = 6,
|
||||||
|
ABGR8 = 7,
|
||||||
|
A8 = 11,
|
||||||
|
A16 = 12,
|
||||||
|
Ah = 13,
|
||||||
|
Af = 14,
|
||||||
|
R8 = 15,
|
||||||
|
R16 = 16,
|
||||||
|
Rh = 17,
|
||||||
|
Rf = 18,
|
||||||
|
RG8 = 19,
|
||||||
|
RG16 = 20,
|
||||||
|
RGh = 21,
|
||||||
|
RGf = 22
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
459
src/coreimage.cs
459
src/coreimage.cs
|
@ -56,10 +56,22 @@ namespace XamCore.CoreImage {
|
||||||
[Export ("colorWithRed:green:blue:alpha:")]
|
[Export ("colorWithRed:green:blue:alpha:")]
|
||||||
CIColor FromRgba (nfloat red, nfloat green, nfloat blue, nfloat alpha);
|
CIColor FromRgba (nfloat red, nfloat green, nfloat blue, nfloat alpha);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("colorWithRed:green:blue:alpha:colorSpace:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
CIColor FromRgba (nfloat red, nfloat green, nfloat blue, nfloat alpha, CGColorSpace colorSpace);
|
||||||
|
|
||||||
[Static]
|
[Static]
|
||||||
[Export ("colorWithRed:green:blue:")]
|
[Export ("colorWithRed:green:blue:")]
|
||||||
CIColor FromRgb (nfloat red, nfloat green, nfloat blue);
|
CIColor FromRgb (nfloat red, nfloat green, nfloat blue);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("colorWithRed:green:blue:colorSpace:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
CIColor FromRgb (nfloat red, nfloat green, nfloat blue, CGColorSpace colorSpace);
|
||||||
|
|
||||||
[Static]
|
[Static]
|
||||||
[Export ("colorWithString:")]
|
[Export ("colorWithString:")]
|
||||||
CIColor FromString (string representation);
|
CIColor FromString (string representation);
|
||||||
|
@ -72,10 +84,18 @@ namespace XamCore.CoreImage {
|
||||||
[Export ("initWithRed:green:blue:")]
|
[Export ("initWithRed:green:blue:")]
|
||||||
IntPtr Constructor (nfloat red, nfloat green, nfloat blue);
|
IntPtr Constructor (nfloat red, nfloat green, nfloat blue);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("initWithRed:green:blue:colorSpace:")]
|
||||||
|
IntPtr Constructor (nfloat red, nfloat green, nfloat blue, CGColorSpace colorSpace);
|
||||||
|
|
||||||
[iOS (9,0)][Mac (10,11)]
|
[iOS (9,0)][Mac (10,11)]
|
||||||
[Export ("initWithRed:green:blue:alpha:")]
|
[Export ("initWithRed:green:blue:alpha:")]
|
||||||
IntPtr Constructor (nfloat red, nfloat green, nfloat blue, nfloat alpha);
|
IntPtr Constructor (nfloat red, nfloat green, nfloat blue, nfloat alpha);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("initWithRed:green:blue:alpha:colorSpace:")]
|
||||||
|
IntPtr Constructor (nfloat red, nfloat green, nfloat blue, nfloat alpha, CGColorSpace colorSpace);
|
||||||
|
|
||||||
[Export ("numberOfComponents")]
|
[Export ("numberOfComponents")]
|
||||||
nint NumberOfComponents { get; }
|
nint NumberOfComponents { get; }
|
||||||
|
|
||||||
|
@ -97,6 +117,60 @@ namespace XamCore.CoreImage {
|
||||||
[Export ("blue")]
|
[Export ("blue")]
|
||||||
nfloat Blue { get; }
|
nfloat Blue { get; }
|
||||||
|
|
||||||
|
// the above are the component of a CIColor instance
|
||||||
|
// while the one below are CIColor convenience helpers
|
||||||
|
// conflicting names means we have to keep the *Color suffix on them
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("blackColor")]
|
||||||
|
CIColor BlackColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("whiteColor")]
|
||||||
|
CIColor WhiteColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("grayColor")]
|
||||||
|
CIColor GrayColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("redColor")]
|
||||||
|
CIColor RedColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("greenColor")]
|
||||||
|
CIColor GreenColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("blueColor")]
|
||||||
|
CIColor BlueColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("cyanColor")]
|
||||||
|
CIColor CyanColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("magentaColor")]
|
||||||
|
CIColor MagentaColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("yellowColor")]
|
||||||
|
CIColor YellowColor { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Static]
|
||||||
|
[Export ("clearColor")]
|
||||||
|
CIColor ClearColor { get; }
|
||||||
|
|
||||||
[Export ("stringRepresentation")]
|
[Export ("stringRepresentation")]
|
||||||
string StringRepresentation ();
|
string StringRepresentation ();
|
||||||
|
|
||||||
|
@ -141,6 +215,15 @@ namespace XamCore.CoreImage {
|
||||||
[Internal, Static]
|
[Internal, Static]
|
||||||
[Export ("contextWithCGContext:options:")]
|
[Export ("contextWithCGContext:options:")]
|
||||||
CIContext FromContext (CGContext ctx, [NullAllowed] NSDictionary options);
|
CIContext FromContext (CGContext ctx, [NullAllowed] NSDictionary options);
|
||||||
|
|
||||||
|
[Static, Internal]
|
||||||
|
[Export ("contextWithOptions:")]
|
||||||
|
CIContext FromOptions ([NullAllowed] NSDictionary dictionary);
|
||||||
|
|
||||||
|
[Internal]
|
||||||
|
[Export ("initWithOptions:")]
|
||||||
|
IntPtr Constructor ([NullAllowed] NSDictionary options);
|
||||||
|
|
||||||
#if !MONOMAC
|
#if !MONOMAC
|
||||||
[Static]
|
[Static]
|
||||||
[Wrap ("FromOptions ((NSDictionary) null)")]
|
[Wrap ("FromOptions ((NSDictionary) null)")]
|
||||||
|
@ -154,10 +237,6 @@ namespace XamCore.CoreImage {
|
||||||
[Export ("contextWithEAGLContext:options:")]
|
[Export ("contextWithEAGLContext:options:")]
|
||||||
CIContext FromContext (EAGLContext eaglContext, [NullAllowed] NSDictionary dictionary);
|
CIContext FromContext (EAGLContext eaglContext, [NullAllowed] NSDictionary dictionary);
|
||||||
|
|
||||||
[Static, Internal]
|
|
||||||
[Export ("contextWithOptions:")]
|
|
||||||
CIContext FromOptions ([NullAllowed] NSDictionary dictionary);
|
|
||||||
|
|
||||||
[Export ("render:toCVPixelBuffer:")]
|
[Export ("render:toCVPixelBuffer:")]
|
||||||
void Render (CIImage image, CVPixelBuffer buffer);
|
void Render (CIImage image, CVPixelBuffer buffer);
|
||||||
|
|
||||||
|
@ -193,6 +272,11 @@ namespace XamCore.CoreImage {
|
||||||
[return: Release ()]
|
[return: Release ()]
|
||||||
CGImage CreateCGImage (CIImage image, CGRect fromRect, int /* CIFormat = int */ ciImageFormat, [NullAllowed] CGColorSpace colorSpace);
|
CGImage CreateCGImage (CIImage image, CGRect fromRect, int /* CIFormat = int */ ciImageFormat, [NullAllowed] CGColorSpace colorSpace);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("createCGImage:fromRect:format:colorSpace:deferred:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
CGImage CreateCGImage (CIImage image, CGRect fromRect, CIFormat format, [NullAllowed] CGColorSpace colorSpace, bool deferred);
|
||||||
|
|
||||||
#if MONOMAC
|
#if MONOMAC
|
||||||
[Internal, Export ("createCGLayerWithSize:info:")]
|
[Internal, Export ("createCGLayerWithSize:info:")]
|
||||||
CGLayer CreateCGLayer (CGSize size, [NullAllowed] NSDictionary info);
|
CGLayer CreateCGLayer (CGSize size, [NullAllowed] NSDictionary info);
|
||||||
|
@ -207,10 +291,11 @@ namespace XamCore.CoreImage {
|
||||||
#if MONOMAC
|
#if MONOMAC
|
||||||
[Export ("reclaimResources")]
|
[Export ("reclaimResources")]
|
||||||
void ReclaimResources ();
|
void ReclaimResources ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
[Export ("clearCaches")]
|
[Export ("clearCaches")]
|
||||||
void ClearCaches ();
|
void ClearCaches ();
|
||||||
#endif
|
|
||||||
|
|
||||||
[Internal, Field ("kCIContextOutputColorSpace", "+CoreImage")]
|
[Internal, Field ("kCIContextOutputColorSpace", "+CoreImage")]
|
||||||
NSString OutputColorSpace { get; }
|
NSString OutputColorSpace { get; }
|
||||||
|
@ -221,15 +306,13 @@ namespace XamCore.CoreImage {
|
||||||
[Internal, Field ("kCIContextUseSoftwareRenderer", "+CoreImage")]
|
[Internal, Field ("kCIContextUseSoftwareRenderer", "+CoreImage")]
|
||||||
NSString UseSoftwareRenderer { get; }
|
NSString UseSoftwareRenderer { get; }
|
||||||
|
|
||||||
#if !MONOMAC
|
[iOS (8,0)][Mac (10,12)]
|
||||||
[iOS (8,0)]
|
|
||||||
[Internal, Field ("kCIContextPriorityRequestLow", "+CoreImage")]
|
[Internal, Field ("kCIContextPriorityRequestLow", "+CoreImage")]
|
||||||
NSString PriorityRequestLow { get; }
|
NSString PriorityRequestLow { get; }
|
||||||
#endif
|
|
||||||
|
|
||||||
[iOS (8,0)]
|
[iOS (8,0)]
|
||||||
[Internal, Field ("kCIContextWorkingFormat", "+CoreImage")]
|
[Internal, Field ("kCIContextWorkingFormat", "+CoreImage")]
|
||||||
NSString WorkingFormat { get; }
|
NSString WorkingFormatField { get; }
|
||||||
|
|
||||||
[iOS (9,0)][Mac (10,11)]
|
[iOS (9,0)][Mac (10,11)]
|
||||||
[Internal]
|
[Internal]
|
||||||
|
@ -259,6 +342,43 @@ namespace XamCore.CoreImage {
|
||||||
[iOS (9,0)][Mac (10,11)]
|
[iOS (9,0)][Mac (10,11)]
|
||||||
[Export ("workingColorSpace")]
|
[Export ("workingColorSpace")]
|
||||||
CGColorSpace WorkingColorSpace { get; }
|
CGColorSpace WorkingColorSpace { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("workingFormat")]
|
||||||
|
CIFormat WorkingFormat { get; }
|
||||||
|
|
||||||
|
[iOS (7,0)]
|
||||||
|
[Internal]
|
||||||
|
[Field ("kCIContextOutputPremultiplied", "+CoreImage")]
|
||||||
|
NSString OutputPremultiplied { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Internal]
|
||||||
|
[Field ("kCIContextCacheIntermediates", "+CoreImage")]
|
||||||
|
NSString CacheIntermediates { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category]
|
||||||
|
[BaseType (typeof (CIContext))]
|
||||||
|
interface CIContext_ImageRepresentation {
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("TIFFRepresentationOfImage:format:colorSpace:options:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
NSData GetTiffRepresentation (CIImage image, CIFormat format, CGColorSpace colorSpace, NSDictionary options);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("JPEGRepresentationOfImage:colorSpace:options:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
NSData GetJpegRepresentation (CIImage image, CGColorSpace colorSpace, NSDictionary options);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("writeTIFFRepresentationOfImage:toURL:format:colorSpace:options:error:")]
|
||||||
|
bool WriteTiffRepresentation (CIImage image, NSUrl url, CIFormat format, CGColorSpace colorSpace, NSDictionary options, out NSError error);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("writeJPEGRepresentationOfImage:toURL:colorSpace:options:error:")]
|
||||||
|
bool WriteJpegRepresentation (CIImage image, NSUrl url, CGColorSpace colorSpace, NSDictionary options, [NullAllowed] out NSError error);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BaseType (typeof (NSObject))]
|
[BaseType (typeof (NSObject))]
|
||||||
|
@ -278,10 +398,10 @@ namespace XamCore.CoreImage {
|
||||||
NSDictionary Attributes { get; }
|
NSDictionary Attributes { get; }
|
||||||
|
|
||||||
[Export ("name")]
|
[Export ("name")]
|
||||||
string Name { get;
|
string Name {
|
||||||
#if MONOMAC
|
get;
|
||||||
set;
|
[iOS (10,0)]
|
||||||
#endif
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Static]
|
[Static]
|
||||||
|
@ -358,6 +478,202 @@ namespace XamCore.CoreImage {
|
||||||
|
|
||||||
[Export ("valueForKey:"), Internal]
|
[Export ("valueForKey:"), Internal]
|
||||||
NSObject ValueForKey (NSString key);
|
NSObject ValueForKey (NSString key);
|
||||||
|
|
||||||
|
// CIRAWFilter (CIFilter)
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("filterWithImageURL:options:")]
|
||||||
|
CIFilter CreateRawFilter (NSUrl url, NSDictionary options);
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("filterWithImageData:options:")]
|
||||||
|
CIFilter CreateRawFilter (NSData data, NSDictionary options);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Static]
|
||||||
|
[Internal]
|
||||||
|
interface CIRawFilterKeys {
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputAllowDraftModeKey")]
|
||||||
|
NSString AllowDraftModeKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputDecoderVersionKey")]
|
||||||
|
NSString VersionKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCISupportedDecoderVersionsKey")]
|
||||||
|
NSString SupportedDecoderVersionsKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputBoostKey")]
|
||||||
|
NSString BoostKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputBoostShadowAmountKey")]
|
||||||
|
NSString BoostShadowAmountKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputNeutralChromaticityXKey")]
|
||||||
|
NSString NeutralChromaticityXKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputNeutralChromaticityYKey")]
|
||||||
|
NSString NeutralChromaticityYKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputNeutralTemperatureKey")]
|
||||||
|
NSString NeutralTemperatureKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputNeutralTintKey")]
|
||||||
|
NSString NeutralTintKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputNeutralLocationKey")]
|
||||||
|
NSString NeutralLocationKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputScaleFactorKey")]
|
||||||
|
NSString ScaleFactorKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputIgnoreImageOrientationKey")]
|
||||||
|
NSString IgnoreImageOrientationKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputImageOrientationKey")]
|
||||||
|
NSString ImageOrientationKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputEnableSharpeningKey")]
|
||||||
|
NSString EnableSharpeningKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputEnableChromaticNoiseTrackingKey")]
|
||||||
|
NSString EnableChromaticNoiseTrackingKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputNoiseReductionAmountKey")]
|
||||||
|
NSString NoiseReductionAmountKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
[Field ("kCIInputEnableVendorLensCorrectionKey")]
|
||||||
|
NSString EnableVendorLensCorrectionKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
[Field ("kCIInputLuminanceNoiseReductionAmountKey")]
|
||||||
|
NSString LuminanceNoiseReductionAmountKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
[Field ("kCIInputColorNoiseReductionAmountKey")]
|
||||||
|
NSString ColorNoiseReductionAmountKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
[Field ("kCIInputNoiseReductionSharpnessAmountKey")]
|
||||||
|
NSString NoiseReductionSharpnessAmountKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
[Field ("kCIInputNoiseReductionContrastAmountKey")]
|
||||||
|
NSString NoiseReductionContrastAmountKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
[Field ("kCIInputNoiseReductionDetailAmountKey")]
|
||||||
|
NSString NoiseReductionDetailAmountKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIInputLinearSpaceFilter")]
|
||||||
|
NSString LinearSpaceFilterKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIOutputNativeSizeKey")]
|
||||||
|
NSString OutputNativeSizeKey { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
[Field ("kCIActiveKeys")]
|
||||||
|
NSString ActiveKeysKey { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[StrongDictionary ("CIRawFilterKeys")]
|
||||||
|
interface CIRawFilterOptions {
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
bool AllowDraftMode { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
string Version { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
NSDictionary[] SupportedDecoderVersions { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
float Boost { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
float BoostShadowAmount { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
float NeutralChromaticityX { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
float NeutralChromaticityY { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
float NeutralTemperature { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
float NeutralTint { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
CIVector NeutralLocation { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
float ScaleFactor { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
bool IgnoreImageOrientation { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
int ImageOrientation { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
bool EnableSharpening { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
bool EnableChromaticNoiseTracking { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
double NoiseReductionAmount { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
bool EnableVendorLensCorrection { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
double LuminanceNoiseReductionAmount { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
double ColorNoiseReductionAmount { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
double NoiseReductionSharpnessAmount { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
double NoiseReductionContrastAmount { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,10)]
|
||||||
|
[Field ("kCIInputNoiseReductionDetailAmountKey")]
|
||||||
|
double NoiseReductionDetailAmount { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
CIFilter LinearSpaceFilter { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
CIVector OutputNativeSize { get; set; }
|
||||||
|
|
||||||
|
[iOS (10,0)]
|
||||||
|
NSSet ActiveKeys { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Since (5,0)]
|
[Since (5,0)]
|
||||||
|
@ -1219,6 +1535,123 @@ namespace XamCore.CoreImage {
|
||||||
[Export ("imageWithMTLTexture:options:")]
|
[Export ("imageWithMTLTexture:options:")]
|
||||||
CIImage FromMetalTexture (IMTLTexture texture, [NullAllowed] NSDictionary<NSString, NSObject> options);
|
CIImage FromMetalTexture (IMTLTexture texture, [NullAllowed] NSDictionary<NSString, NSObject> options);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageByClampingToRect:")]
|
||||||
|
CIImage CreateByClamping (CGRect rect);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageByColorMatchingColorSpaceToWorkingSpace:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
CIImage CreateByColorMatchingColorSpaceToWorkingSpace (CGColorSpace colorSpace);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageByColorMatchingWorkingSpaceToColorSpace:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
CIImage CreateByColorMatchingWorkingSpaceToColorSpace (CGColorSpace colorSpace);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageByPremultiplyingAlpha")]
|
||||||
|
CIImage CreateByPremultiplyingAlpha ();
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageByUnpremultiplyingAlpha")]
|
||||||
|
CIImage CreateByUnpremultiplyingAlpha ();
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageBySettingAlphaOneInExtent:")]
|
||||||
|
CIImage CreateBySettingAlphaOne (CGRect extent);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageByApplyingGaussianBlurWithSigma:")]
|
||||||
|
CIImage CreateByApplyingGaussianBlur (double sigma);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageBySettingProperties:")]
|
||||||
|
CIImage CreateBySettingProperties (NSDictionary properties);
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[NullAllowed, Export ("pixelBuffer")]
|
||||||
|
CVPixelBuffer PixelBuffer { get; }
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[NullAllowed, Export ("CGImage")]
|
||||||
|
CGImage CGImage { get; }
|
||||||
|
|
||||||
|
// CIImage_CIImageProcessor
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Export ("imageWithExtent:processorDescription:argumentDigest:inputFormat:outputFormat:options:roiCallback:processor:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
CIImage Process (CGRect extent, string description, ulong argumentDigest, CIFormat inputFormat, CIFormat outputFormat, [NullAllowed] NSDictionary<NSString, NSObject> options, Func<CGRect, CGRect> roiCallback, Action<ICIImageProcessorInput, ICIImageProcessorOutput> processor);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ICIImageProcessorInput {}
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Protocol]
|
||||||
|
interface CIImageProcessorInput {
|
||||||
|
[Abstract]
|
||||||
|
[Export ("region")]
|
||||||
|
CGRect Region { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[Export ("bytesPerRow")]
|
||||||
|
nuint BytesPerRow { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[Export ("format")]
|
||||||
|
CIFormat Format { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[Export ("baseAddress")]
|
||||||
|
IntPtr BaseAddress { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[NullAllowed, Export ("pixelBuffer")]
|
||||||
|
CVPixelBuffer PixelBuffer { get; }
|
||||||
|
|
||||||
|
#if !MONOMAC || XAMCORE_2_0
|
||||||
|
[Abstract]
|
||||||
|
[NullAllowed, Export ("metalTexture")]
|
||||||
|
IMTLTexture MetalTexture { get; }
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ICIImageProcessorOutput {}
|
||||||
|
|
||||||
|
[iOS (10,0)][Mac (10,12)]
|
||||||
|
[Protocol]
|
||||||
|
interface CIImageProcessorOutput {
|
||||||
|
[Abstract]
|
||||||
|
[Export ("region")]
|
||||||
|
CGRect Region { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[Export ("bytesPerRow")]
|
||||||
|
nuint BytesPerRow { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[Export ("format")]
|
||||||
|
CIFormat Format { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[Export ("baseAddress")]
|
||||||
|
IntPtr BaseAddress { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[NullAllowed, Export ("pixelBuffer")]
|
||||||
|
CVPixelBuffer PixelBuffer { get; }
|
||||||
|
|
||||||
|
#if !MONOMAC || XAMCORE_2_0
|
||||||
|
[Abstract]
|
||||||
|
[NullAllowed, Export ("metalTexture")]
|
||||||
|
IMTLTexture MetalTexture { get; }
|
||||||
|
|
||||||
|
[Abstract]
|
||||||
|
[NullAllowed, Export ("metalCommandBuffer")]
|
||||||
|
IMTLCommandBuffer MetalCommandBuffer { get; }
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[iOS (9,0)]
|
[iOS (9,0)]
|
||||||
|
|
|
@ -316,6 +316,7 @@ namespace Introspection
|
||||||
"Undecodable",
|
"Undecodable",
|
||||||
"Underrun",
|
"Underrun",
|
||||||
"Unorm",
|
"Unorm",
|
||||||
|
"Unpremultiplying",
|
||||||
"Unprepare",
|
"Unprepare",
|
||||||
"Unproject",
|
"Unproject",
|
||||||
"Uterance",
|
"Uterance",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче