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