2
2
// coreimage.cs: Definitions for CoreImage
4
4
// Copyright 2010, Novell, Inc.
5
// Copyright 2011, 2012 Xamarin Inc
6
7
// Permission is hereby granted, free of charge, to any person obtaining
7
8
// a copy of this software and associated documentation files (the
62
63
[Export ("colorWithRed:green:blue:alpha:")]
63
CIColor FromRgba (float r, float g, float b, float a);
64
CIColor FromRgba (float red, float green, float blue, float alpha);
66
67
[Export ("colorWithRed:green:blue:")]
67
CIColor FromRgb (float r, float g, float b);
68
CIColor FromRgb (float red, float green, float blue);
70
71
[Export ("colorWithString:")]
112
113
//[Export ("contextWithCGLContext:pixelFormat:colorSpace:options:")]
113
114
//CIContext ContextWithCGLContextpixelFormatcolorSpaceoptions (CGLContextObj ctx, CGLPixelFormatObj pf, CGColorSpaceRef cs, NSDictionary dict, );
115
117
[Internal, Static]
116
118
[Export ("contextWithCGContext:options:")]
117
119
CIContext FromContext (CGContext ctx, [NullAllowed] NSDictionary options);
122
[Wrap ("FromOptions ((NSDictionary) null)")]
121
126
[Export ("contextWithEAGLContext:")]
122
127
CIContext FromContext (EAGLContext eaglContext);
145
151
void DrawImage (CIImage image, RectangleF inRectangle, RectangleF fromRectangle);
147
153
[Export ("createCGImage:fromRect:")]
148
155
CGImage CreateCGImage (CIImage image, RectangleF fromRectangle);
150
157
[Export ("createCGImage:fromRect:format:colorSpace:")]
151
CGImage CreateCGImage (CIImage image, RectangleF fromRect, int ciImageFormat, CGColorSpace colorSpace);
159
CGImage CreateCGImage (CIImage image, RectangleF fromRect, int ciImageFormat, [NullAllowed] CGColorSpace colorSpace);
153
161
[Internal, Export ("createCGLayerWithSize:info:")]
154
162
CGLayer CreateCGLayer (SizeF size, [NullAllowed] NSDictionary info);
156
164
[Export ("render:toBitmap:rowBytes:bounds:format:colorSpace:")]
157
165
void RenderToBitmap (CIImage image, IntPtr bitmapPtr, int bytesPerRow, RectangleF bounds, int bitmapFormat, CGColorSpace colorSpace);
235
243
[Export ("outputImage")]
236
244
CIImage OutputImage { get; }
247
[Export ("serializedXMPFromFilters:inputImageExtent:"), Static]
248
NSData SerializedXMP (CIFilter[] filters, RectangleF extent);
251
[Export ("filterArrayFromSerializedXMP:inputImageExtent:error:"), Static]
252
CIFilter[] FromSerializedXMP (NSData xmpData, RectangleF extent, out NSError error);
239
255
[Export ("setValue:forKey:"), Internal]
410
429
[Field ("kCIAttributeTypeRectangle", "+CoreImage")]
411
430
NSString TypeRectangle { get; }
413
433
[Field ("kCIAttributeTypeOpaqueColor", "+CoreImage")]
414
434
NSString TypeOpaqueColor { get; }
417
436
[Field ("kCIAttributeTypeGradient", "+CoreImage")]
418
437
NSString TypeGradient { get; }
621
641
[Export ("imageWithCGImage:options:")]
622
CIImage FromCGImage (CGImage image, NSDictionary d);
642
CIImage FromCGImage (CGImage image, [NullAllowed] NSDictionary d);
645
[Wrap ("FromCGImage (image, options == null ? null : options.Dictionary)")]
646
CIImage FromCGImage (CGImage image, [NullAllowed] CIImageInitializationOptionsWithMetadata options);
635
659
[Export ("imageWithBitmapData:bytesPerRow:size:format:colorSpace:")]
636
CIImage FromData (NSData bitmapData, int bpr, SizeF size, int ciImageFormat, CGColorSpace colorspace);
660
// TODO: pixelFormat should be enum of kCIFormatARGB8, kCIFormatRGBA16, kCIFormatRGBAf, kCIFormatRGBAh
661
CIImage FromData (NSData bitmapData, int bytesPerRow, SizeF size, int pixelFormat, [NullAllowed] CGColorSpace colorSpace);
640
666
[Export ("imageWithTexture:size:flipped:colorSpace:")]
641
CIImage ImageWithTexturesizeflippedcolorSpace (int glTextureName, SizeF size, bool flag, CGColorSpace colorspace);
667
CIImage ImageWithTexture (uint glTextureName, SizeF size, bool flipped, CGColorSpace colorspace);
649
675
[Export ("imageWithContentsOfURL:options:")]
650
CIImage FromUrl (NSUrl url, NSDictionary d);
676
CIImage FromUrl (NSUrl url, [NullAllowed] NSDictionary d);
679
[Wrap ("FromUrl (url, options == null ? null : options.Dictionary)")]
680
CIImage FromUrl (NSUrl url, [NullAllowed] CIImageInitializationOptions options);
653
683
[Export ("imageWithData:")]
657
687
[Export ("imageWithData:options:")]
658
CIImage FromData (NSData data, NSDictionary d);
688
CIImage FromData (NSData data, [NullAllowed] NSDictionary d);
691
[Wrap ("FromData (data, options == null ? null : options.Dictionary)")]
692
CIImage FromData (NSData data, [NullAllowed] CIImageInitializationOptionsWithMetadata options);
661
696
[Export ("imageWithCVImageBuffer:")]
673
708
[Export ("imageWithCVPixelBuffer:options:")]
674
CIImage FromImageBuffer (CVPixelBuffer buffer, NSDictionary dict);
709
CIImage FromImageBuffer (CVPixelBuffer buffer, [NullAllowed] NSDictionary dict);
712
[Wrap ("FromImageBuffer (buffer, options == null ? null : options.Dictionary)")]
713
CIImage FromImageBuffer (CVPixelBuffer buffer, [NullAllowed] CIImageInitializationOptions options);
676
715
//[Export ("imageWithIOSurface:")]
677
716
//CIImage ImageWithIOSurface (IOSurfaceRef surface, );
691
731
IntPtr Constructor (CGImage image);
693
733
[Export ("initWithCGImage:options:")]
694
IntPtr Constructor (CGImage image, NSDictionary d);
696
// FIXME: bindingneeded
734
IntPtr Constructor (CGImage image, [NullAllowed] NSDictionary d);
736
[Wrap ("this (image, options == null ? null : options.Dictionary)")]
737
IntPtr Constructor (CGImage image, [NullAllowed] CIImageInitializationOptionsWithMetadata options);
697
739
[Export ("initWithCGLayer:")]
698
740
IntPtr Constructor (CGLayer layer);
700
742
[Export ("initWithCGLayer:options:")]
701
NSObject IntPtr (CGLayer layer, NSDictionary d);
743
IntPtr Constructor (CGLayer layer, [NullAllowed] NSDictionary d);
745
[Wrap ("this (layer, options == null ? null : options.Dictionary)")]
746
IntPtr Constructor (CGLayer layer, [NullAllowed] CIImageInitializationOptions options);
703
748
[Export ("initWithData:")]
704
749
IntPtr Constructor (NSData data);
706
751
[Export ("initWithData:options:")]
707
IntPtr Constructor (NSData data, NSDictionary d);
752
IntPtr Constructor (NSData data, [NullAllowed] NSDictionary d);
754
[Wrap ("this (data, options == null ? null : options.Dictionary)")]
755
IntPtr Constructor (NSData data, [NullAllowed] CIImageInitializationOptionsWithMetadata options);
709
757
[Export ("initWithBitmapData:bytesPerRow:size:format:colorSpace:")]
710
IntPtr Constructor (NSData d, int bpr, SizeF size, int f, CGColorSpace c);
758
IntPtr Constructor (NSData d, int bytesPerRow, SizeF size, int pixelFormat, CGColorSpace colorSpace);
712
761
[Export ("initWithTexture:size:flipped:colorSpace:")]
713
IntPtr Constructor (int glTextureName, SizeF size, bool flag, CGColorSpace cs);
762
IntPtr Constructor (int glTextureName, SizeF size, bool flipped, CGColorSpace colorSpace);
715
764
[Export ("initWithContentsOfURL:")]
716
765
IntPtr Constructor (NSUrl url);
718
767
[Export ("initWithContentsOfURL:options:")]
719
IntPtr Constructor (NSUrl url, NSDictionary d);
768
IntPtr Constructor (NSUrl url, [NullAllowed] NSDictionary d);
770
[Wrap ("this (url, options == null ? null : options.Dictionary)")]
771
IntPtr Constructor (NSUrl url, [NullAllowed] CIImageInitializationOptions options);
721
773
// FIXME: bindings
722
774
//[Export ("initWithIOSurface:")]
729
781
IntPtr Constructor (CVImageBuffer imageBuffer);
731
783
[Export ("initWithCVImageBuffer:options:")]
732
IntPtr Constructor (CVImageBuffer imageBuffer, NSDictionary dict);
784
IntPtr Constructor (CVImageBuffer imageBuffer, [NullAllowed] NSDictionary dict);
786
[Wrap ("this (imageBuffer, options == null ? null : options.Dictionary)")]
787
IntPtr Constructor (CVImageBuffer imageBuffer, [NullAllowed] CIImageInitializationOptions options);
734
789
[Export ("initWithColor:")]
735
790
IntPtr Constructor (CIColor color);
754
809
[Export ("extent")]
755
810
RectangleF Extent { get; }
813
[Export ("properties"), Internal]
814
NSDictionary WeakProperties { get; }
817
[Wrap ("WeakProperties")]
818
CGImageProperties Properties { get; }
757
821
//[Export ("definition")]
758
822
//CIFilterShape Definition ();
763
[Export ("colorSpace")]
764
CGColorSpace ColorSpace { get; }
767
824
[Field ("kCIFormatARGB8")]
768
825
int FormatARGB8 { get; }
776
833
[Field ("kCIFormatRGBAh")]
777
834
int FormatRGBAh { get; }
837
[Field ("kCIFormatARGB8")]
839
int FormatARGB8 { get; }
841
[Field ("kCIFormatRGBAh")]
843
int FormatRGBAh { get; }
779
845
[Field ("kCIFormatBGRA8")]
780
847
int FormatBGRA8 { get; }
782
849
[Field ("kCIFormatRGBA8")]
783
851
int FormatRGBA8 { get; }
785
853
// UIKit extensions
786
855
[Export ("initWithImage:")]
787
856
IntPtr Constructor (UIImage image);
789
859
[Export ("initWithImage:options")]
790
IntPtr Constructor (UIImage image, NSDictionary options);
860
IntPtr Constructor (UIImage image, [NullAllowed] NSDictionary options);
863
[Wrap ("this (image, options == null ? null : options.Dictionary)")]
864
IntPtr Constructor (UIImage image, [NullAllowed] CIImageInitializationOptions options);
792
867
[Field ("kCIImageAutoAdjustFeatures"), Internal]
793
868
NSString AutoAdjustFeaturesKey { get; }
795
871
[Field ("kCIImageAutoAdjustRedEye"), Internal]
796
872
NSString AutoAdjustRedEyeKey { get; }
798
875
[Field ("kCIImageAutoAdjustEnhance"), Internal]
799
876
NSString AutoAdjustEnhanceKey { get; }
807
884
[Field ("kCGImagePropertyOrientation", "ImageIO"), Internal]
808
885
NSString ImagePropertyOrientation { get; }
887
[Field ("kCIImageColorSpace"), Internal]
888
NSString CIImageColorSpaceKey { get; }
891
[Field ("kCIImageProperties"), Internal]
892
NSString CIImagePropertiesKey { get; }
814
896
[BaseType (typeof (NSObject))]
815
897
public interface CIImageAccumulator {
816
899
[Export ("imageAccumulatorWithExtent:format:")]
817
900
CIImageAccumulator FromRectangle (RectangleF rect, int ciImageFormat);
1002
1086
[DisableDefaultCtor]
1003
1087
interface CIDetector {
1004
1088
[Static, Export ("detectorOfType:context:options:"), Internal]
1005
CIDetector FromType (NSString detectorType, CIContext context, [NullAllowed] NSDictionary options);
1089
CIDetector FromType ([NullAllowed] NSString detectorType, [NullAllowed] CIContext context, [NullAllowed] NSDictionary options);
1007
1091
[Export ("featuresInImage:")]
1008
1092
CIFeature [] FeaturesInImage (CIImage image);
1025
1110
[Field ("CIDetectorAccuracyHigh"), Internal]
1026
1111
NSString AccuracyHigh { get; }
1114
[Field ("CIDetectorTracking"), Internal]
1115
NSString Tracking { get; }
1118
[Field ("CIDetectorMinFeatureSize"), Internal]
1119
NSString MinFeatureSize { get; }
1029
1122
[BaseType (typeof (NSObject))]
1059
1155
[Export ("mouthPosition")]
1060
1156
PointF MouthPosition { get; }
1159
[Export ("hasTrackingID")]
1160
bool HasTrackingId { get; }
1163
[Export ("trackingID")]
1164
int TrackingId { get; }
1167
[Export ("hasTrackingFrameCount")]
1168
bool HasTrackingFrameCount { get; }
1171
[Export ("trackingFrameCount")]
1172
int TrackingFrameCount { get; }