Esempio n. 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);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 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);
        }