From 17462e80ff0eea16a593ae1c217b752844ddd173 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 13 Nov 2023 18:35:40 +0100 Subject: [PATCH] Changes due to upgrade of Magick.Native. --- src/Magick.NET/MagickImage.cs | 42 +++++----- src/Magick.NET/Native/MagickImage.cs | 104 ++++++++++++------------- src/Magick.NET/Native/MagickImage.json | 8 +- 3 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/Magick.NET/MagickImage.cs b/src/Magick.NET/MagickImage.cs index bddd97e299..a448a6bbfa 100644 --- a/src/Magick.NET/MagickImage.cs +++ b/src/Magick.NET/MagickImage.cs @@ -445,7 +445,7 @@ public IEnumerable Channels yield return channel; } - for (var channel = PixelChannel.Meta0; channel <= PixelChannel.Meta53; channel++) + for (var channel = PixelChannel.Meta0; channel <= PixelChannel.Meta52; channel++) { if (_nativeInstance.HasChannel(channel)) yield return channel; @@ -462,25 +462,25 @@ public IChromaticityInfo Chromaticity { get { - if (_nativeInstance.ChromaRedPrimary is null || - _nativeInstance.ChromaGreenPrimary is null || - _nativeInstance.ChromaBluePrimary is null || - _nativeInstance.ChromaWhitePoint is null) + if (_nativeInstance.ChromaRed is null || + _nativeInstance.ChromaGreen is null || + _nativeInstance.ChromaBlue is null || + _nativeInstance.ChromaWhite is null) throw new MagickErrorException("Unable to allocate primary info"); return new ChromaticityInfo( - _nativeInstance.ChromaRedPrimary, - _nativeInstance.ChromaGreenPrimary, - _nativeInstance.ChromaBluePrimary, - _nativeInstance.ChromaWhitePoint); + _nativeInstance.ChromaRed, + _nativeInstance.ChromaGreen, + _nativeInstance.ChromaBlue, + _nativeInstance.ChromaWhite); } set { - _nativeInstance.ChromaRedPrimary = value.Red; - _nativeInstance.ChromaGreenPrimary = value.Green; - _nativeInstance.ChromaBluePrimary = value.Blue; - _nativeInstance.ChromaWhitePoint = value.White; + _nativeInstance.ChromaRed = value.Red; + _nativeInstance.ChromaGreen = value.Green; + _nativeInstance.ChromaBlue = value.Blue; + _nativeInstance.ChromaWhite = value.White; } } @@ -492,14 +492,14 @@ public IPrimaryInfo ChromaBluePrimary { get { - var primaryInfo = _nativeInstance.ChromaBluePrimary; + var primaryInfo = _nativeInstance.ChromaBlue; if (primaryInfo is null) throw new MagickErrorException("Unable to allocate primary info"); return primaryInfo; } - set => _nativeInstance.ChromaBluePrimary = value; + set => _nativeInstance.ChromaBlue = value; } /// @@ -510,14 +510,14 @@ public IPrimaryInfo ChromaGreenPrimary { get { - var primaryInfo = _nativeInstance.ChromaGreenPrimary; + var primaryInfo = _nativeInstance.ChromaGreen; if (primaryInfo is null) throw new MagickErrorException("Unable to allocate primary info"); return primaryInfo; } - set => _nativeInstance.ChromaGreenPrimary = value; + set => _nativeInstance.ChromaGreen = value; } /// @@ -528,14 +528,14 @@ public IPrimaryInfo ChromaRedPrimary { get { - var primaryInfo = _nativeInstance.ChromaRedPrimary; + var primaryInfo = _nativeInstance.ChromaRed; if (primaryInfo is null) throw new MagickErrorException("Unable to allocate primary info"); return primaryInfo; } - set => _nativeInstance.ChromaRedPrimary = value; + set => _nativeInstance.ChromaRed = value; } /// @@ -546,14 +546,14 @@ public IPrimaryInfo ChromaWhitePoint { get { - var primaryInfo = _nativeInstance.ChromaWhitePoint; + var primaryInfo = _nativeInstance.ChromaWhite; if (primaryInfo is null) throw new MagickErrorException("Unable to allocate primary info"); return primaryInfo; } - set => _nativeInstance.ChromaWhitePoint = value; + set => _nativeInstance.ChromaWhite = value; } /// diff --git a/src/Magick.NET/Native/MagickImage.cs b/src/Magick.NET/Native/MagickImage.cs index 1e100f0bdc..93c832cfa1 100644 --- a/src/Magick.NET/Native/MagickImage.cs +++ b/src/Magick.NET/Native/MagickImage.cs @@ -79,21 +79,21 @@ public static class X64 [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] public static extern UIntPtr MagickImage_ChannelCount_Get(IntPtr instance); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaBluePrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaBlue_Get(IntPtr instance); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaBluePrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaBlue_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaGreenPrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaGreen_Get(IntPtr instance); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaGreenPrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaGreen_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaRedPrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaRed_Get(IntPtr instance); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaRedPrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaRed_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaWhitePoint_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaWhite_Get(IntPtr instance); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaWhitePoint_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaWhite_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] public static extern UIntPtr MagickImage_ClassType_Get(IntPtr instance, out IntPtr exception); [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)] @@ -644,21 +644,21 @@ public static class ARM64 [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] public static extern UIntPtr MagickImage_ChannelCount_Get(IntPtr instance); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaBluePrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaBlue_Get(IntPtr instance); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaBluePrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaBlue_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaGreenPrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaGreen_Get(IntPtr instance); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaGreenPrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaGreen_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaRedPrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaRed_Get(IntPtr instance); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaRedPrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaRed_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaWhitePoint_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaWhite_Get(IntPtr instance); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaWhitePoint_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaWhite_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] public static extern UIntPtr MagickImage_ClassType_Get(IntPtr instance, out IntPtr exception); [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)] @@ -1209,21 +1209,21 @@ public static class X86 [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] public static extern UIntPtr MagickImage_ChannelCount_Get(IntPtr instance); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaBluePrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaBlue_Get(IntPtr instance); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaBluePrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaBlue_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaGreenPrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaGreen_Get(IntPtr instance); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaGreenPrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaGreen_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaRedPrimary_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaRed_Get(IntPtr instance); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaRedPrimary_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaRed_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MagickImage_ChromaWhitePoint_Get(IntPtr instance); + public static extern IntPtr MagickImage_ChromaWhite_Get(IntPtr instance); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] - public static extern void MagickImage_ChromaWhitePoint_Set(IntPtr instance, IntPtr value); + public static extern void MagickImage_ChromaWhite_Set(IntPtr instance, IntPtr value); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] public static extern UIntPtr MagickImage_ClassType_Get(IntPtr instance, out IntPtr exception); [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)] @@ -2186,7 +2186,7 @@ public int ChannelCount return (int)result; } } - public IPrimaryInfo? ChromaBluePrimary + public IPrimaryInfo? ChromaBlue { get { @@ -2195,19 +2195,19 @@ public IPrimaryInfo? ChromaBluePrimary if (Runtime.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU - result = NativeMethods.ARM64.MagickImage_ChromaBluePrimary_Get(Instance); + result = NativeMethods.ARM64.MagickImage_ChromaBlue_Get(Instance); #endif #if PLATFORM_AnyCPU else if (Runtime.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU - result = NativeMethods.X64.MagickImage_ChromaBluePrimary_Get(Instance); + result = NativeMethods.X64.MagickImage_ChromaBlue_Get(Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU - result = NativeMethods.X86.MagickImage_ChromaBluePrimary_Get(Instance); + result = NativeMethods.X86.MagickImage_ChromaBlue_Get(Instance); #endif return PrimaryInfo.CreateInstance(result); } @@ -2218,23 +2218,23 @@ public IPrimaryInfo? ChromaBluePrimary if (Runtime.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU - NativeMethods.ARM64.MagickImage_ChromaBluePrimary_Set(Instance, valueNative.Instance); + NativeMethods.ARM64.MagickImage_ChromaBlue_Set(Instance, valueNative.Instance); #endif #if PLATFORM_AnyCPU else if (Runtime.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU - NativeMethods.X64.MagickImage_ChromaBluePrimary_Set(Instance, valueNative.Instance); + NativeMethods.X64.MagickImage_ChromaBlue_Set(Instance, valueNative.Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU - NativeMethods.X86.MagickImage_ChromaBluePrimary_Set(Instance, valueNative.Instance); + NativeMethods.X86.MagickImage_ChromaBlue_Set(Instance, valueNative.Instance); #endif } } - public IPrimaryInfo? ChromaGreenPrimary + public IPrimaryInfo? ChromaGreen { get { @@ -2243,19 +2243,19 @@ public IPrimaryInfo? ChromaGreenPrimary if (Runtime.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU - result = NativeMethods.ARM64.MagickImage_ChromaGreenPrimary_Get(Instance); + result = NativeMethods.ARM64.MagickImage_ChromaGreen_Get(Instance); #endif #if PLATFORM_AnyCPU else if (Runtime.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU - result = NativeMethods.X64.MagickImage_ChromaGreenPrimary_Get(Instance); + result = NativeMethods.X64.MagickImage_ChromaGreen_Get(Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU - result = NativeMethods.X86.MagickImage_ChromaGreenPrimary_Get(Instance); + result = NativeMethods.X86.MagickImage_ChromaGreen_Get(Instance); #endif return PrimaryInfo.CreateInstance(result); } @@ -2266,23 +2266,23 @@ public IPrimaryInfo? ChromaGreenPrimary if (Runtime.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU - NativeMethods.ARM64.MagickImage_ChromaGreenPrimary_Set(Instance, valueNative.Instance); + NativeMethods.ARM64.MagickImage_ChromaGreen_Set(Instance, valueNative.Instance); #endif #if PLATFORM_AnyCPU else if (Runtime.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU - NativeMethods.X64.MagickImage_ChromaGreenPrimary_Set(Instance, valueNative.Instance); + NativeMethods.X64.MagickImage_ChromaGreen_Set(Instance, valueNative.Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU - NativeMethods.X86.MagickImage_ChromaGreenPrimary_Set(Instance, valueNative.Instance); + NativeMethods.X86.MagickImage_ChromaGreen_Set(Instance, valueNative.Instance); #endif } } - public IPrimaryInfo? ChromaRedPrimary + public IPrimaryInfo? ChromaRed { get { @@ -2291,19 +2291,19 @@ public IPrimaryInfo? ChromaRedPrimary if (Runtime.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU - result = NativeMethods.ARM64.MagickImage_ChromaRedPrimary_Get(Instance); + result = NativeMethods.ARM64.MagickImage_ChromaRed_Get(Instance); #endif #if PLATFORM_AnyCPU else if (Runtime.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU - result = NativeMethods.X64.MagickImage_ChromaRedPrimary_Get(Instance); + result = NativeMethods.X64.MagickImage_ChromaRed_Get(Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU - result = NativeMethods.X86.MagickImage_ChromaRedPrimary_Get(Instance); + result = NativeMethods.X86.MagickImage_ChromaRed_Get(Instance); #endif return PrimaryInfo.CreateInstance(result); } @@ -2314,23 +2314,23 @@ public IPrimaryInfo? ChromaRedPrimary if (Runtime.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU - NativeMethods.ARM64.MagickImage_ChromaRedPrimary_Set(Instance, valueNative.Instance); + NativeMethods.ARM64.MagickImage_ChromaRed_Set(Instance, valueNative.Instance); #endif #if PLATFORM_AnyCPU else if (Runtime.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU - NativeMethods.X64.MagickImage_ChromaRedPrimary_Set(Instance, valueNative.Instance); + NativeMethods.X64.MagickImage_ChromaRed_Set(Instance, valueNative.Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU - NativeMethods.X86.MagickImage_ChromaRedPrimary_Set(Instance, valueNative.Instance); + NativeMethods.X86.MagickImage_ChromaRed_Set(Instance, valueNative.Instance); #endif } } - public IPrimaryInfo? ChromaWhitePoint + public IPrimaryInfo? ChromaWhite { get { @@ -2339,19 +2339,19 @@ public IPrimaryInfo? ChromaWhitePoint if (Runtime.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU - result = NativeMethods.ARM64.MagickImage_ChromaWhitePoint_Get(Instance); + result = NativeMethods.ARM64.MagickImage_ChromaWhite_Get(Instance); #endif #if PLATFORM_AnyCPU else if (Runtime.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU - result = NativeMethods.X64.MagickImage_ChromaWhitePoint_Get(Instance); + result = NativeMethods.X64.MagickImage_ChromaWhite_Get(Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU - result = NativeMethods.X86.MagickImage_ChromaWhitePoint_Get(Instance); + result = NativeMethods.X86.MagickImage_ChromaWhite_Get(Instance); #endif return PrimaryInfo.CreateInstance(result); } @@ -2362,19 +2362,19 @@ public IPrimaryInfo? ChromaWhitePoint if (Runtime.IsArm64) #endif #if PLATFORM_arm64 || PLATFORM_AnyCPU - NativeMethods.ARM64.MagickImage_ChromaWhitePoint_Set(Instance, valueNative.Instance); + NativeMethods.ARM64.MagickImage_ChromaWhite_Set(Instance, valueNative.Instance); #endif #if PLATFORM_AnyCPU else if (Runtime.Is64Bit) #endif #if PLATFORM_x64 || PLATFORM_AnyCPU - NativeMethods.X64.MagickImage_ChromaWhitePoint_Set(Instance, valueNative.Instance); + NativeMethods.X64.MagickImage_ChromaWhite_Set(Instance, valueNative.Instance); #endif #if PLATFORM_AnyCPU else #endif #if PLATFORM_x86 || PLATFORM_AnyCPU - NativeMethods.X86.MagickImage_ChromaWhitePoint_Set(Instance, valueNative.Instance); + NativeMethods.X86.MagickImage_ChromaWhite_Set(Instance, valueNative.Instance); #endif } } diff --git a/src/Magick.NET/Native/MagickImage.json b/src/Magick.NET/Native/MagickImage.json index 995c32500e..e7e08c4d49 100644 --- a/src/Magick.NET/Native/MagickImage.json +++ b/src/Magick.NET/Native/MagickImage.json @@ -127,19 +127,19 @@ "readonly": true }, { - "name": "ChromaBluePrimary", + "name": "ChromaBlue", "type": "PrimaryInfo?" }, { - "name": "ChromaGreenPrimary", + "name": "ChromaGreen", "type": "PrimaryInfo?" }, { - "name": "ChromaRedPrimary", + "name": "ChromaRed", "type": "PrimaryInfo?" }, { - "name": "ChromaWhitePoint", + "name": "ChromaWhite", "type": "PrimaryInfo?" }, {