unsafe static void EvaluateCallback(IntPtr info, nfloat *input, nfloat *output)
        {
            GCHandle   lgc       = GCHandle.FromIntPtr(info);
            CGFunction container = (CGFunction)lgc.Target;

            container.evaluate(input, output);
        }
Beispiel #2
0
        public static CGShading CreateRadial(CGColorSpace colorspace, CGPoint start, nfloat startRadius, CGPoint end, nfloat endRadius,
                                             CGFunction function, bool extendStart, bool extendEnd)
        {
            if (colorspace is null)
            {
                throw new ArgumentNullException(nameof(colorspace));
            }
            if (function is null)
            {
                throw new ArgumentNullException(nameof(function));
            }

            return(new CGShading(CGShadingCreateRadial(colorspace.GetCheckedHandle(), start, startRadius, end, endRadius,
                                                       function.GetCheckedHandle(), extendStart, extendEnd), true));
        }
Beispiel #3
0
        public static CGShading CreateRadial(CGColorSpace colorspace, CGPoint start, nfloat startRadius, CGPoint end, nfloat endRadius,
                                             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(CGShadingCreateRadial(colorspace.Handle, start, startRadius, end, endRadius,
                                                       function.Handle, extendStart, extendEnd), true));
        }