~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/maccore/src/coreimage.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
// coreimage.cs: Definitions for CoreImage
3
3
//
4
4
// Copyright 2010, Novell, Inc.
 
5
// Copyright 2011, 2012 Xamarin Inc
5
6
//
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
60
61
 
61
62
                [Static]
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);
64
65
 
65
66
                [Static]
66
67
                [Export ("colorWithRed:green:blue:")]
67
 
                CIColor FromRgb (float r, float g, float b);
 
68
                CIColor FromRgb (float red, float green, float blue);
68
69
 
69
70
                [Static]
70
71
                [Export ("colorWithString:")]
112
113
                //[Export ("contextWithCGLContext:pixelFormat:colorSpace:options:")]
113
114
                //CIContext ContextWithCGLContextpixelFormatcolorSpaceoptions (CGLContextObj ctx, CGLPixelFormatObj pf, CGColorSpaceRef cs, NSDictionary dict, );
114
115
 
 
116
#if MONOMAC
115
117
                [Internal, Static]
116
118
                [Export ("contextWithCGContext:options:")]
117
119
                CIContext FromContext (CGContext ctx, [NullAllowed] NSDictionary options);
 
120
#else
 
121
                [Static]
 
122
                [Wrap ("FromOptions ((NSDictionary) null)")]
 
123
                CIContext Create ();
118
124
 
119
 
#if !MONOMAC
120
125
                [Static]
121
126
                [Export ("contextWithEAGLContext:")]
122
127
                CIContext FromContext (EAGLContext eaglContext);
138
143
                SizeF OutputImageMaximumSize { get; }
139
144
#endif
140
145
 
 
146
                [Obsolete ("Deprecated in iOS 6.0. Use DrawImage (CIImage, RectangleF, RectangleF) instead")]
141
147
                [Export ("drawImage:atPoint:fromRect:")]
142
148
                void DrawImage (CIImage image, PointF atPoint, RectangleF fromRect);
143
149
 
145
151
                void DrawImage (CIImage image, RectangleF inRectangle, RectangleF fromRectangle);
146
152
 
147
153
                [Export ("createCGImage:fromRect:")]
 
154
                [return: Release ()]
148
155
                CGImage CreateCGImage (CIImage image, RectangleF fromRectangle);
149
156
 
150
157
                [Export ("createCGImage:fromRect:format:colorSpace:")]
151
 
                CGImage CreateCGImage (CIImage image, RectangleF fromRect, int ciImageFormat, CGColorSpace colorSpace);
152
 
 
 
158
                [return: Release ()]
 
159
                CGImage CreateCGImage (CIImage image, RectangleF fromRect, int ciImageFormat, [NullAllowed] CGColorSpace colorSpace);
 
160
#if MONOMAC
153
161
                [Internal, Export ("createCGLayerWithSize:info:")]
154
162
                CGLayer CreateCGLayer (SizeF size, [NullAllowed] NSDictionary info);
155
 
 
 
163
#endif
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);
158
166
 
194
202
                NSDictionary Attributes { get; }
195
203
 
196
204
                [Export ("name")]
197
 
                string Name { get; set;}
 
205
                string Name { get; }
198
206
 
199
207
                [Static]
200
208
                [Export ("filterWithName:")]
234
242
#else
235
243
                [Export ("outputImage")]
236
244
                CIImage OutputImage { get; }
 
245
 
 
246
                [Since (6,0)]
 
247
                [Export ("serializedXMPFromFilters:inputImageExtent:"), Static]
 
248
                NSData SerializedXMP (CIFilter[] filters, RectangleF extent); 
 
249
 
 
250
                [Since (6,0)]
 
251
                [Export ("filterArrayFromSerializedXMP:inputImageExtent:error:"), Static]
 
252
                CIFilter[] FromSerializedXMP (NSData xmpData, RectangleF extent, out NSError error);
237
253
#endif
238
254
 
239
255
                [Export ("setValue:forKey:"), Internal]
256
272
 
257
273
                [Field ("kCIInputImageKey", "+CoreImage")]
258
274
                NSString Image  { get; }
259
 
 
260
 
#if MONOMAC
 
275
#if !MONOMAC
 
276
                [Field ("kCIInputVersionKey", "+CoreImage")]
 
277
                NSString Version { get; }
 
278
#else
261
279
                [Field ("kCIInputTimeKey", "+CoreImage")]
262
280
                NSString Time  { get; }
263
281
 
320
338
 
321
339
                [Field ("kCIInputExtentKey", "+CoreImage")]
322
340
                NSString Extent  { get; }
 
341
 
323
342
#endif
324
343
        }
325
344
                
410
429
                [Field ("kCIAttributeTypeRectangle", "+CoreImage")]
411
430
                NSString TypeRectangle  { get; }
412
431
 
 
432
#if MONOMAC
413
433
                [Field ("kCIAttributeTypeOpaqueColor", "+CoreImage")]
414
434
                NSString TypeOpaqueColor  { get; }
415
435
 
416
 
#if MONOMAC
417
436
                [Field ("kCIAttributeTypeGradient", "+CoreImage")]
418
437
                NSString TypeGradient  { get; }
419
438
#else
583
602
        [BaseType (typeof (NSObject))]
584
603
        [DisableDefaultCtor]
585
604
        public interface CIFilterShape {
 
605
                [Static]
586
606
                [Export ("shapeWithRect:")]
587
607
                CIFilterShape FromRect (RectangleF rect);
588
608
 
605
625
                CIFilterShape Intersect (CIFilterShape other);
606
626
 
607
627
                [Export ("intersectWithRect:")]
608
 
                CIFilterShape IntersectWithRect (Rectangle rectangle);
 
628
                CIFilterShape IntersectWithRect (RectangleF rectangle);
609
629
        }
610
630
#endif
611
631
        
619
639
 
620
640
                [Static]
621
641
                [Export ("imageWithCGImage:options:")]
622
 
                CIImage FromCGImage (CGImage image, NSDictionary d);
 
642
                CIImage FromCGImage (CGImage image, [NullAllowed] NSDictionary d);
 
643
 
 
644
                [Static]
 
645
                [Wrap ("FromCGImage (image, options == null ? null : options.Dictionary)")]
 
646
                CIImage FromCGImage (CGImage image, [NullAllowed] CIImageInitializationOptionsWithMetadata options);
623
647
 
624
648
#if MONOMAC
625
649
                [Static]
633
657
 
634
658
                [Static]
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);
637
662
 
638
663
#if MONOMAC
 
664
                [Since (6,0)]
639
665
                [Static]
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);
642
668
#endif
643
669
 
644
670
                [Static]
647
673
 
648
674
                [Static]
649
675
                [Export ("imageWithContentsOfURL:options:")]
650
 
                CIImage FromUrl (NSUrl url, NSDictionary d);
 
676
                CIImage FromUrl (NSUrl url, [NullAllowed] NSDictionary d);
 
677
 
 
678
                [Static]
 
679
                [Wrap ("FromUrl (url, options == null ? null : options.Dictionary)")]
 
680
                CIImage FromUrl (NSUrl url, [NullAllowed] CIImageInitializationOptions options);
651
681
 
652
682
                [Static]
653
683
                [Export ("imageWithData:")]
655
685
 
656
686
                [Static]
657
687
                [Export ("imageWithData:options:")]
658
 
                CIImage FromData (NSData data, NSDictionary d);
 
688
                CIImage FromData (NSData data, [NullAllowed] NSDictionary d);
 
689
 
 
690
                [Static]
 
691
                [Wrap ("FromData (data, options == null ? null : options.Dictionary)")]
 
692
                CIImage FromData (NSData data, [NullAllowed] CIImageInitializationOptionsWithMetadata options);
 
693
 
659
694
#if MONOMAC
660
695
                [Static]
661
696
                [Export ("imageWithCVImageBuffer:")]
671
706
 
672
707
                [Static]
673
708
                [Export ("imageWithCVPixelBuffer:options:")]
674
 
                CIImage FromImageBuffer (CVPixelBuffer buffer, NSDictionary dict);
 
709
                CIImage FromImageBuffer (CVPixelBuffer buffer, [NullAllowed] NSDictionary dict);
 
710
 
 
711
                [Static]
 
712
                [Wrap ("FromImageBuffer (buffer, options == null ? null : options.Dictionary)")]
 
713
                CIImage FromImageBuffer (CVPixelBuffer buffer, [NullAllowed] CIImageInitializationOptions options);
675
714
#endif
676
715
                //[Export ("imageWithIOSurface:")]
677
716
                //CIImage ImageWithIOSurface (IOSurfaceRef surface, );
680
719
                //[Export ("imageWithIOSurface:options:")]
681
720
                //CIImage ImageWithIOSurfaceoptions (IOSurfaceRef surface, NSDictionary d, );
682
721
 
 
722
                [Static]
683
723
                [Export ("imageWithColor:")]
684
724
                CIImage ImageWithColor (CIColor color);
685
725
 
691
731
                IntPtr Constructor (CGImage image);
692
732
 
693
733
                [Export ("initWithCGImage:options:")]
694
 
                IntPtr Constructor (CGImage image, NSDictionary d);
695
 
 
696
 
                // FIXME: bindingneeded
 
734
                IntPtr Constructor (CGImage image, [NullAllowed] NSDictionary d);
 
735
 
 
736
                [Wrap ("this (image, options == null ? null : options.Dictionary)")]
 
737
                IntPtr Constructor (CGImage image, [NullAllowed] CIImageInitializationOptionsWithMetadata options);
 
738
 
697
739
                [Export ("initWithCGLayer:")]
698
740
                IntPtr Constructor (CGLayer layer);
699
741
 
700
742
                [Export ("initWithCGLayer:options:")]
701
 
                NSObject IntPtr (CGLayer layer, NSDictionary d);
 
743
                IntPtr Constructor (CGLayer layer, [NullAllowed] NSDictionary d);
 
744
 
 
745
                [Wrap ("this (layer, options == null ? null : options.Dictionary)")]
 
746
                IntPtr Constructor (CGLayer layer, [NullAllowed] CIImageInitializationOptions options);
702
747
 
703
748
                [Export ("initWithData:")]
704
749
                IntPtr Constructor (NSData data);
705
750
 
706
751
                [Export ("initWithData:options:")]
707
 
                IntPtr Constructor (NSData data, NSDictionary d);
 
752
                IntPtr Constructor (NSData data, [NullAllowed] NSDictionary d);
 
753
 
 
754
                [Wrap ("this (data, options == null ? null : options.Dictionary)")]
 
755
                IntPtr Constructor (NSData data, [NullAllowed] CIImageInitializationOptionsWithMetadata options);
708
756
 
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);
711
759
 
 
760
                [Since (6,0)]
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);
714
763
 
715
764
                [Export ("initWithContentsOfURL:")]
716
765
                IntPtr Constructor (NSUrl url);
717
766
 
718
767
                [Export ("initWithContentsOfURL:options:")]
719
 
                IntPtr Constructor (NSUrl url, NSDictionary d);
 
768
                IntPtr Constructor (NSUrl url, [NullAllowed] NSDictionary d);
 
769
 
 
770
                [Wrap ("this (url, options == null ? null : options.Dictionary)")]
 
771
                IntPtr Constructor (NSUrl url, [NullAllowed] CIImageInitializationOptions options);
720
772
 
721
773
                // FIXME: bindings
722
774
                //[Export ("initWithIOSurface:")]
729
781
                IntPtr Constructor (CVImageBuffer imageBuffer);
730
782
 
731
783
                [Export ("initWithCVImageBuffer:options:")]
732
 
                IntPtr Constructor (CVImageBuffer imageBuffer, NSDictionary dict);
 
784
                IntPtr Constructor (CVImageBuffer imageBuffer, [NullAllowed] NSDictionary dict);
 
785
 
 
786
                [Wrap ("this (imageBuffer, options == null ? null : options.Dictionary)")]
 
787
                IntPtr Constructor (CVImageBuffer imageBuffer, [NullAllowed] CIImageInitializationOptions options);
733
788
 
734
789
                [Export ("initWithColor:")]
735
790
                IntPtr Constructor (CIColor color);
754
809
                [Export ("extent")]
755
810
                RectangleF Extent { get; }
756
811
 
 
812
                [Since (5,0)]
 
813
                [Export ("properties"), Internal]
 
814
                NSDictionary WeakProperties { get; }
 
815
 
 
816
                [Since (5,0)]
 
817
                [Wrap ("WeakProperties")]
 
818
                CGImageProperties Properties { get; }
 
819
 
 
820
#if MONOMAC
757
821
                //[Export ("definition")]
758
822
                //CIFilterShape Definition ();
759
823
 
760
 
                [Export ("url")]
761
 
                NSUrl Url { get; }
762
 
 
763
 
                [Export ("colorSpace")]
764
 
                CGColorSpace ColorSpace { get; }
765
 
 
766
 
#if MONOMAC
767
824
                [Field ("kCIFormatARGB8")]
768
825
                int FormatARGB8 { get; }
769
826
 
776
833
                [Field ("kCIFormatRGBAh")]
777
834
                int FormatRGBAh { get; }
778
835
#else
 
836
 
 
837
                [Field ("kCIFormatARGB8")]
 
838
                [Since (6,0)]
 
839
                int FormatARGB8 { get; }
 
840
                
 
841
                [Field ("kCIFormatRGBAh")]
 
842
                [Since (6,0)]
 
843
                int FormatRGBAh { get; }
 
844
 
779
845
                [Field ("kCIFormatBGRA8")]
 
846
                [Since (5,0)]
780
847
                int FormatBGRA8 { get; }
781
848
 
782
849
                [Field ("kCIFormatRGBA8")]
 
850
                [Since (5,0)]
783
851
                int FormatRGBA8 { get; }
784
852
 
785
853
                // UIKit extensions
 
854
                [Since (5,0)]
786
855
                [Export ("initWithImage:")]
787
856
                IntPtr Constructor (UIImage image);
788
857
 
 
858
                [Since (5,0)]
789
859
                [Export ("initWithImage:options")]
790
 
                IntPtr Constructor (UIImage image, NSDictionary options);
 
860
                IntPtr Constructor (UIImage image, [NullAllowed] NSDictionary options);
791
861
 
 
862
                [Since (5,0)]
 
863
                [Wrap ("this (image, options == null ? null : options.Dictionary)")]
 
864
                IntPtr Constructor (UIImage image, [NullAllowed] CIImageInitializationOptions options);
 
865
#endif
 
866
                [MountainLion]
792
867
                [Field ("kCIImageAutoAdjustFeatures"), Internal]
793
868
                NSString AutoAdjustFeaturesKey { get; }
794
869
 
 
870
                [MountainLion]
795
871
                [Field ("kCIImageAutoAdjustRedEye"), Internal]
796
872
                NSString AutoAdjustRedEyeKey { get; }
797
873
 
 
874
                [MountainLion]
798
875
                [Field ("kCIImageAutoAdjustEnhance"), Internal]
799
876
                NSString AutoAdjustEnhanceKey { get; }
800
877
                
806
883
 
807
884
                [Field ("kCGImagePropertyOrientation", "ImageIO"), Internal]
808
885
                NSString ImagePropertyOrientation { get; }
809
 
#endif
810
 
                
 
886
 
 
887
                [Field ("kCIImageColorSpace"), Internal]
 
888
                NSString CIImageColorSpaceKey { get; }
 
889
 
 
890
                [MountainLion]
 
891
                [Field ("kCIImageProperties"), Internal]
 
892
                NSString CIImagePropertiesKey { get; }
811
893
        }
812
894
 
813
895
#if MONOMAC
814
896
        [BaseType (typeof (NSObject))]
815
897
        public interface CIImageAccumulator {
 
898
                [Static]
816
899
                [Export ("imageAccumulatorWithExtent:format:")]
817
900
                CIImageAccumulator FromRectangle (RectangleF rect, int ciImageFormat);
818
901
 
837
920
        }
838
921
 
839
922
        [BaseType (typeof (NSObject))]
 
923
        [DisableDefaultCtor] // avoid crashes
840
924
        public interface CIKernel {
841
925
                [Static, Export ("kernelsWithString:")]
842
926
                CIKernel [] FromProgram (string coreImageShaderProgram);
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);
1006
1090
 
1007
1091
                [Export ("featuresInImage:")]
1008
1092
                CIFeature [] FeaturesInImage (CIImage image);
1012
1096
 
1013
1097
                [Field ("CIDetectorTypeFace"), Internal]
1014
1098
                NSString TypeFace { get; }
1015
 
                
 
1099
 
 
1100
                [MountainLion]
1016
1101
                [Field ("CIDetectorImageOrientation"), Internal]
1017
1102
                NSString ImageOrientation { get; }
1018
1103
 
1024
1109
 
1025
1110
                [Field ("CIDetectorAccuracyHigh"), Internal]
1026
1111
                NSString AccuracyHigh { get; }
 
1112
 
 
1113
                [Since (6,0)]
 
1114
                [Field ("CIDetectorTracking"), Internal]
 
1115
                NSString Tracking { get; }
 
1116
 
 
1117
                [Since (6,0)]
 
1118
                [Field ("CIDetectorMinFeatureSize"), Internal]
 
1119
                NSString MinFeatureSize { get; }
1027
1120
        }
1028
1121
        
1029
1122
        [BaseType (typeof (NSObject))]
1035
1128
 
1036
1129
                [Export ("bounds")]
1037
1130
                RectangleF Bounds { get; }
 
1131
 
 
1132
                [Field ("CIFeatureTypeFace")]
 
1133
                NSString TypeFace { get; }
1038
1134
        }
1039
1135
 
1040
1136
        [BaseType (typeof (CIFeature))]
1058
1154
                
1059
1155
                [Export ("mouthPosition")]
1060
1156
                PointF MouthPosition { get; }
 
1157
 
 
1158
                [Since (6,0)]
 
1159
                [Export ("hasTrackingID")]
 
1160
                bool HasTrackingId { get; }
 
1161
                
 
1162
                [Since (6,0)]
 
1163
                [Export ("trackingID")]
 
1164
                int TrackingId { get; }
 
1165
                
 
1166
                [Since (6,0)]
 
1167
                [Export ("hasTrackingFrameCount")]
 
1168
                bool HasTrackingFrameCount { get; }
 
1169
 
 
1170
                [Since (6,0)]
 
1171
                [Export ("trackingFrameCount")]
 
1172
                int TrackingFrameCount { get; }
1061
1173
        }
1062
1174
}