示例#1
0
		public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, CGImageDestinationOptions options)
		{
			NSDictionary o = null;
			if (options != null)
				o = options.ToDictionary ();
			try {
				AddImageAndMetadata (image, meta, o);
			}
			finally {
				if (options != null)
					o.Dispose ();
			}
		}
示例#2
0
		public void AddImage (CGImage image, NSDictionary properties)
		{
			if (image == null)
				throw new ArgumentNullException ("image");
			
			CGImageDestinationAddImage (handle, image.Handle, properties == null ? IntPtr.Zero : properties.Handle);
		}
示例#3
0
		public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, NSDictionary options)
		{
			if (image == null)
				throw new ArgumentNullException ("image");
			IntPtr m = meta == null ? IntPtr.Zero : meta.Handle;
			IntPtr o = options == null ? IntPtr.Zero : options.Handle;
			CGImageDestinationAddImageAndMetadata (handle, image.Handle, m, o);
		}
示例#4
0
		public CGImage WithMask (CGImage mask)
		{
			if (mask == null)
				throw new ArgumentNullException ("mask");
			return new CGImage (CGImageCreateWithMask (handle, mask.handle), true);
		}
示例#5
0
		public void AddImage (CGImage image, CGImageDestinationOptions options = null)
		{
			if (image == null)
				throw new ArgumentNullException ("image");

			var dict = options == null ? null : options.ToDictionary ();
			CGImageDestinationAddImage (handle, image.Handle, dict == null ? IntPtr.Zero : dict.Handle);
			if (dict != null)
				dict.Dispose ();
		}
示例#6
0
		public void DrawTiledImage (CGRect rect, CGImage image)
		{
			CGContextDrawTiledImage (handle, rect, image == null ? IntPtr.Zero : image.Handle);
		}
示例#7
0
		public void ClipToMask (CGRect rect, CGImage mask)
		{
			CGContextClipToMask (handle, rect, mask == null ? IntPtr.Zero : mask.handle);
		}
示例#8
0
 public static GLKTextureInfo FromImage(CGImage cgImage, GLKTextureOperations textureOperations, out NSError error)
 {
     return FromImage (cgImage, textureOperations == null ? null : textureOperations.Dictionary, out error);
 }
示例#9
0
 public void BeginTextureLoad(CGImage image, GLKTextureOperations textureOperations, DispatchQueue queue, GLKTextureLoaderCallback onComplete)
 {
     BeginTextureLoad (image, textureOperations == null ? null : textureOperations.Dictionary, queue, onComplete);
 }
示例#10
0
        public static CIImage FromCGImage(CGImage image, CGColorSpace colorSpace)
        {
            if (colorSpace == null)
                throw new ArgumentNullException ("colorSpace");

            using (var arr = NSArray.FromIntPtrs (new IntPtr [] { colorSpace.Handle })){
                using (var keys = NSArray.FromIntPtrs (new IntPtr [] { CIImageColorSpaceKey.Handle } )){
                    using (var dict = NSDictionary.FromObjectsAndKeysInternal (arr, keys)){
                        return FromCGImage (image, dict);
                    }
                }
            }
        }
示例#11
-1
        public static VTStatus ToCGImage(this CVPixelBuffer pixelBuffer, out CGImage image)
        {
            if (pixelBuffer == null)
                throw new ArgumentNullException ("pixelBuffer");
            if (pixelBuffer.Handle == IntPtr.Zero)
                throw new ObjectDisposedException ("CVPixelBuffer");

            image = null;

            IntPtr imagePtr;
            var ret = VTCreateCGImageFromCVPixelBuffer (pixelBuffer.Handle,
                IntPtr.Zero, // no options as of 9.0/10.11 - always pass NULL
                out imagePtr);

            if (imagePtr != IntPtr.Zero)
                image = Runtime.GetINativeObject<CGImage> (imagePtr, true); // This is already retained CM_RETURNS_RETAINED_PARAMETER

            return ret;
        }