public static MagickRectangle?FromPageSize(string?value) { using (var valueNative = UTF8Marshaler.CreateInstance(value)) { IntPtr result; #if PLATFORM_AnyCPU if (OperatingSystem.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU result = NativeMethods.ARM64.MagickRectangle_FromPageSize(valueNative.Instance); #endif #if PLATFORM_AnyCPU else if (OperatingSystem.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU result = NativeMethods.X64.MagickRectangle_FromPageSize(valueNative.Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU result = NativeMethods.X86.MagickRectangle_FromPageSize(valueNative.Instance); #endif return(MagickRectangle.CreateInstance(result)); } }
internal static INativeInstance CreateInstance(MagickRectangle instance) { if (instance == null) { return(NativeInstance.Zero); } return(instance.CreateNativeInstance()); }
internal static MagickGeometry FromRectangle(MagickRectangle rectangle) { if (rectangle == null) { return(null); } return(new MagickGeometry(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height)); }
internal static INativeInstance CreateInstance(MagickRectangle instance) { if (instance == null) return NativeInstance.Zero; return instance.CreateNativeInstance(); }
public static string ToString(MagickRectangle value) { return(value == null ? null : value.ToString()); }
public IntPtr SubImageSearch(MagickImage reference, ErrorMetric metric, double similarityThreshold, out MagickRectangle offset, out double similarityMetric) { using (INativeInstance offsetNative = MagickRectangle.CreateInstance()) { IntPtr offsetNativeOut = offsetNative.Instance; IntPtr exception = IntPtr.Zero; IntPtr result; #if ANYCPU if (NativeLibrary.Is64Bit) #endif #if WIN64 || ANYCPU result = NativeMethods.X64.MagickImage_SubImageSearch(Instance, MagickImage.GetInstance(reference), (UIntPtr)metric, similarityThreshold, offsetNativeOut, out similarityMetric, out exception); #endif #if ANYCPU else #endif #if !WIN64 || ANYCPU result = NativeMethods.X86.MagickImage_SubImageSearch(Instance, MagickImage.GetInstance(reference), (UIntPtr)metric, similarityThreshold, offsetNativeOut, out similarityMetric, out exception); #endif offset = MagickRectangle.CreateInstance(offsetNative); CheckException(exception, result); return result; } }
public void Splice(MagickRectangle geometry) { using (INativeInstance geometryNative = MagickRectangle.CreateInstance(geometry)) { IntPtr exception = IntPtr.Zero; IntPtr result; #if ANYCPU if (NativeLibrary.Is64Bit) #endif #if WIN64 || ANYCPU result = NativeMethods.X64.MagickImage_Splice(Instance, geometryNative.Instance, out exception); #endif #if ANYCPU else #endif #if !WIN64 || ANYCPU result = NativeMethods.X86.MagickImage_Splice(Instance, geometryNative.Instance, out exception); #endif CheckException(exception, result); Instance = result; } }
public void RegionMask(MagickRectangle region) { using (INativeInstance regionNative = MagickRectangle.CreateInstance(region)) { IntPtr exception = IntPtr.Zero; #if ANYCPU if (NativeLibrary.Is64Bit) #endif #if WIN64 || ANYCPU NativeMethods.X64.MagickImage_RegionMask(Instance, regionNative.Instance, out exception); #endif #if ANYCPU else #endif #if !WIN64 || ANYCPU NativeMethods.X86.MagickImage_RegionMask(Instance, regionNative.Instance, out exception); #endif CheckException(exception); } }
public void EvaluateGeometry(Channels channels, MagickRectangle geometry, EvaluateOperator evaluateOperator, double value) { using (INativeInstance geometryNative = MagickRectangle.CreateInstance(geometry)) { IntPtr exception = IntPtr.Zero; #if ANYCPU if (NativeLibrary.Is64Bit) #endif #if WIN64 || ANYCPU NativeMethods.X64.MagickImage_EvaluateGeometry(Instance, (UIntPtr)channels, geometryNative.Instance, (UIntPtr)evaluateOperator, value, out exception); #endif #if ANYCPU else #endif #if !WIN64 || ANYCPU NativeMethods.X86.MagickImage_EvaluateGeometry(Instance, (UIntPtr)channels, geometryNative.Instance, (UIntPtr)evaluateOperator, value, out exception); #endif CheckException(exception); } }
public void CopyPixels(MagickImage image, MagickRectangle geometry, OffsetInfo offset, Channels channels) { using (INativeInstance geometryNative = MagickRectangle.CreateInstance(geometry)) { using (INativeInstance offsetNative = OffsetInfo.CreateInstance(offset)) { IntPtr exception = IntPtr.Zero; #if ANYCPU if (NativeLibrary.Is64Bit) #endif #if WIN64 || ANYCPU NativeMethods.X64.MagickImage_CopyPixels(Instance, MagickImage.GetInstance(image), geometryNative.Instance, offsetNative.Instance, (UIntPtr)channels, out exception); #endif #if ANYCPU else #endif #if !WIN64 || ANYCPU NativeMethods.X86.MagickImage_CopyPixels(Instance, MagickImage.GetInstance(image), geometryNative.Instance, offsetNative.Instance, (UIntPtr)channels, out exception); #endif CheckException(exception); } } }
public void Border(MagickRectangle value) { using (INativeInstance valueNative = MagickRectangle.CreateInstance(value)) { IntPtr exception = IntPtr.Zero; IntPtr result; #if ANYCPU if (NativeLibrary.Is64Bit) #endif #if WIN64 || ANYCPU result = NativeMethods.X64.MagickImage_Border(Instance, valueNative.Instance, out exception); #endif #if ANYCPU else #endif #if !WIN64 || ANYCPU result = NativeMethods.X86.MagickImage_Border(Instance, valueNative.Instance, out exception); #endif CheckException(exception, result); Instance = result; } }