Exemplo n.º 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 ();
			}
		}
Exemplo n.º 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);
		}
Exemplo n.º 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);
		}
Exemplo n.º 4
0
		public CGImage WithMask (CGImage mask)
		{
			if (mask == null)
				throw new ArgumentNullException ("mask");
			return new CGImage (CGImageCreateWithMask (handle, mask.handle), true);
		}
Exemplo n.º 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 ();
		}
Exemplo n.º 6
0
		public void DrawTiledImage (CGRect rect, CGImage image)
		{
			CGContextDrawTiledImage (handle, rect, image == null ? IntPtr.Zero : image.Handle);
		}
Exemplo n.º 7
0
		public void ClipToMask (CGRect rect, CGImage mask)
		{
			CGContextClipToMask (handle, rect, mask == null ? IntPtr.Zero : mask.handle);
		}
Exemplo n.º 8
0
 public static GLKTextureInfo FromImage(CGImage cgImage, GLKTextureOperations textureOperations, out NSError error)
 {
     return FromImage (cgImage, textureOperations == null ? null : textureOperations.Dictionary, out error);
 }
Exemplo n.º 9
0
 public void BeginTextureLoad(CGImage image, GLKTextureOperations textureOperations, DispatchQueue queue, GLKTextureLoaderCallback onComplete)
 {
     BeginTextureLoad (image, textureOperations == null ? null : textureOperations.Dictionary, queue, onComplete);
 }
Exemplo n.º 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);
                    }
                }
            }
        }
Exemplo n.º 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;
        }