static CGColorSpace CreateDeviceRGB () { if (deviceRGB != null) return deviceRGB; deviceRGB = CGColorSpace.CreateDeviceRGB (); return deviceRGB; }
public CGGradient(CGColorSpace colorspace, float [] components, float [] locations) { if (colorspace == null) throw new ArgumentNullException ("colorspace"); if (components == null) throw new ArgumentNullException ("components"); handle = CGGradientCreateWithColorComponents (colorspace.handle, components, locations, components.Length / (colorspace.Components+1)); }
public CGColor(CGColorSpace colorspace, float [] components) { if (components == null) throw new ArgumentNullException ("components"); if (colorspace == null) throw new ArgumentNullException ("colorspace"); if (colorspace.handle == IntPtr.Zero) throw new ObjectDisposedException ("colorspace"); handle = CGColorCreate (colorspace.handle, components); }
public static CGShading CreateAxial(CGColorSpace colorspace, PointF start, PointF end, CGFunction function, bool extendStart, bool extendEnd) { if (colorspace == null) throw new ArgumentNullException ("colorspace"); if (colorspace.Handle == IntPtr.Zero) throw new ObjectDisposedException ("colorspace"); if (function == null) throw new ArgumentNullException ("function"); if (function.Handle == IntPtr.Zero) throw new ObjectDisposedException ("function"); return new CGShading (CGShadingCreateAxial (colorspace.Handle, start, end, function.Handle, extendStart, extendEnd)); }
public static CGColorSpace CreateIndexed(CGColorSpace baseSpace, int lastIndex, byte[] colorTable) { return new CGColorSpace (CGColorSpaceCreateIndexed (baseSpace == null ? IntPtr.Zero : baseSpace.handle, lastIndex, colorTable), true); }
public static CGColorSpace CreatePattern(CGColorSpace baseSpace) { return new CGColorSpace (CGColorSpaceCreatePattern (baseSpace == null ? IntPtr.Zero : baseSpace.handle), true); }
public CGImage CreateCGImage (CIImage image, System.Drawing.RectangleF fromRect, CIFormat ciImageFormat, CGColorSpace colorSpace) { return CreateCGImage (image, fromRect, CIImage.CIFormatToInt (ciImageFormat), colorSpace); }
public CGBitmapContext(byte [] data, int width, int height, int bitsPerComponent, int bytesPerRow, CGColorSpace colorSpace, CGBitmapFlags bitmapInfo) : base(CGBitmapContextCreate(data, (UIntPtr)width, (UIntPtr)height, (UIntPtr)bitsPerComponent, (UIntPtr)bytesPerRow, colorSpace.handle, (uint)bitmapInfo), true) { }
public CGImage WithColorSpace(CGColorSpace cs) { return(new CGImage(CGImageCreateCopyWithColorSpace(handle, cs.handle), true)); }
public CGImage WithColorSpace (CGColorSpace cs) { return new CGImage (CGImageCreateCopyWithColorSpace (handle, cs.handle), true); }
public CGBitmapContext(IntPtr data, int width, int height, int bitsPerComponent, int bytesPerRow, CGColorSpace colorSpace, CGImageAlphaInfo bitmapInfo) : base(CGBitmapContextCreate (data, (UIntPtr) width, (UIntPtr) height, (UIntPtr) bitsPerComponent, (UIntPtr) bytesPerRow, colorSpace.handle, (uint) bitmapInfo), true) { }
public void SetFillColorSpace (CGColorSpace space) { CGContextSetFillColorSpace (handle, space.handle); }
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 CGColorSpace CreatePattern(CGColorSpace baseSpace) { return(new CGColorSpace(CGColorSpaceCreatePattern(baseSpace == null ? IntPtr.Zero : baseSpace.handle), true)); }
public static CGColorSpace CreateIndexed(CGColorSpace baseSpace, int lastIndex, byte[] colorTable) { return(new CGColorSpace(CGColorSpaceCreateIndexed(baseSpace == null ? IntPtr.Zero : baseSpace.handle, new IntPtr(lastIndex), colorTable), true)); }
public CGColor(CGColorSpace colorspace, CGPattern pattern, float [] components) { if (colorspace == null) throw new ArgumentNullException ("colorspace"); if (colorspace.handle == IntPtr.Zero) throw new ObjectDisposedException ("colorspace"); if (pattern == null) throw new ArgumentNullException ("pattern"); if (components == null) throw new ArgumentNullException ("components"); handle = CGColorCreateWithPattern (colorspace.handle, pattern.handle, components); if (handle == IntPtr.Zero) throw new ArgumentException (); }
public CGGradient (CGColorSpace colorspace, CGColor [] colors) { if (colors == null) throw new ArgumentNullException ("colors"); IntPtr csh = colorspace == null ? IntPtr.Zero : colorspace.handle; using (var array = CFArray.FromNativeObjects (colors)) handle = CGGradientCreateWithColors (csh, array.Handle, null); }
public void SetStrokeColorSpace (CGColorSpace space) { CGContextSetStrokeColorSpace (handle, space.handle); }
public void SetFillColorSpace(CGColorSpace space) { CGContextSetFillColorSpace(handle, space.handle); }
public void SetStrokeColorSpace(CGColorSpace space) { CGContextSetStrokeColorSpace(handle, space.handle); }
public CGImage (int width, int height, int bitsPerComponent, int bitsPerPixel, int bytesPerRow, CGColorSpace colorSpace, CGImageAlphaInfo alphaInfo, CGDataProvider provider, float [] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { if (colorSpace == null) throw new ArgumentNullException ("colorSpace"); if (width < 0) throw new ArgumentException ("width"); if (height < 0) throw new ArgumentException ("height"); if (bitsPerPixel < 0) throw new ArgumentException ("bitsPerPixel"); if (bitsPerComponent < 0) throw new ArgumentException ("bitsPerComponent"); if (bytesPerRow < 0) throw new ArgumentException ("bytesPerRow"); if (provider == null) throw new ArgumentNullException ("provider"); handle = CGImageCreate (width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpace.Handle, (CGBitmapFlags) alphaInfo, provider.Handle, decode, shouldInterpolate, intent); }