コード例 #1
0
 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));
     }
 }
コード例 #2
0
 internal static INativeInstance CreateInstance(MagickRectangle instance)
 {
     if (instance == null)
     {
         return(NativeInstance.Zero);
     }
     return(instance.CreateNativeInstance());
 }
コード例 #3
0
ファイル: MagickGeometry.cs プロジェクト: orf53975/Magick.NET
        internal static MagickGeometry FromRectangle(MagickRectangle rectangle)
        {
            if (rectangle == null)
            {
                return(null);
            }

            return(new MagickGeometry(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height));
        }
コード例 #4
0
 internal static INativeInstance CreateInstance(MagickRectangle instance)
 {
   if (instance == null)
     return NativeInstance.Zero;
   return instance.CreateNativeInstance();
 }
コード例 #5
0
 public static string ToString(MagickRectangle value)
 {
     return(value == null ? null : value.ToString());
 }
コード例 #6
0
ファイル: MagickImage.cs プロジェクト: dlemstra/Magick.NET
 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;
   }
 }
コード例 #7
0
ファイル: MagickImage.cs プロジェクト: dlemstra/Magick.NET
 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;
   }
 }
コード例 #8
0
ファイル: MagickImage.cs プロジェクト: dlemstra/Magick.NET
 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);
   }
 }
コード例 #9
0
ファイル: MagickImage.cs プロジェクト: dlemstra/Magick.NET
 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);
   }
 }
コード例 #10
0
ファイル: MagickImage.cs プロジェクト: dlemstra/Magick.NET
 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);
     }
   }
 }
コード例 #11
0
ファイル: MagickImage.cs プロジェクト: dlemstra/Magick.NET
 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;
   }
 }