ToArray() public static method

public static ToArray ( IntPtr nativeData, int length ) : ushort[]
nativeData System.IntPtr
length int
return ushort[]
Beispiel #1
0
        public ushort[] ToShortArray(int x, int y, int width, int height, string mapping)
        {
            Throw.IfNullOrEmpty(nameof(mapping), mapping);

            CheckArea(x, y, width, height);
            IntPtr nativeResult = _NativeInstance.ToShortArray(x, y, width, height, mapping);

            ushort[] result = ShortConverter.ToArray(nativeResult, width * height * mapping.Length);
            MagickMemory.Relinquish(nativeResult);
            return(result);
        }
        public virtual ushort[]? ToShortArray(int x, int y, int width, int height, string mapping)
        {
            var nativeResult = IntPtr.Zero;

            try
            {
                nativeResult = _nativeInstance.ToShortArray(x, y, width, height, mapping);
                return(ShortConverter.ToArray(nativeResult, width * height * mapping.Length));
            }
            finally
            {
                MagickMemory.Relinquish(nativeResult);
            }
        }
Beispiel #3
0
        public virtual ushort[] ToShortArray(int x, int y, int width, int height, string mapping)
        {
            Throw.IfNullOrEmpty(nameof(mapping), mapping);

            IntPtr nativeResult = IntPtr.Zero;

            ushort[] result = null;

            try
            {
                nativeResult = _nativeInstance.ToShortArray(x, y, width, height, mapping);
                result       = ShortConverter.ToArray(nativeResult, width * height * mapping.Length);
            }
            finally
            {
                MagickMemory.Relinquish(nativeResult);
            }

            return(result);
        }