/// <summary> /// Initializes a new instance of the <see cref="Emgu.CV.Mat"/> class from NSImage /// </summary> /// <param name="mode">The color conversion mode. By default, it convert the UIImage to BGRA color type to preserve all the image channels.</param> /// <param name="nsImage">The NSImage.</param> public static Mat ToMat(this NSImage nsImage, ImreadModes mode = ImreadModes.AnyColor) { using (CGImage cgImage = nsImage.CGImage) { return(cgImage.ToMat()); } }
/// <summary> /// Initializes a new instance of the <see cref="Emgu.CV.Mat"/> class from UIImage /// </summary> /// <param name="mode">The color conversion mode. By default, it convert the UIImage to BGRA color type to preserve all the image channels.</param> /// <param name="uiImage">The UIImage.</param> public static Mat ToMat(this UIImage uiImage, ImreadModes mode = ImreadModes.AnyColor) { using (CGImage cgImage = uiImage.CGImage) { return(cgImage.ToMat(mode)); } }