internal static INativeInstance CreateInstance(IPrimaryInfo?instance) { if (instance is null) { return(NativeInstance.Zero); } return(PrimaryInfo.CreateNativeInstance(instance)); }
internal static INativeInstance CreateInstance(PrimaryInfo instance) { if (instance == null) { return(NativeInstance.Zero); } return(instance.CreateNativeInstance()); }
internal static INativeInstance CreateInstance(PrimaryInfo instance) { if (instance == null) return NativeInstance.Zero; return instance.CreateNativeInstance(); }
public void Test_Chromaticity() { using (MagickImage image = new MagickImage(Files.SnakewarePNG)) { PrimaryInfo info = new PrimaryInfo(0.5, 1.0, 1.5); Test_Chromaticity(0.15, 0.06, 0, image.ChromaBluePrimary); image.ChromaBluePrimary = info; Test_Chromaticity(0.5, 1.0, 1.5, image.ChromaBluePrimary); Test_Chromaticity(0.3, 0.6, 0, image.ChromaGreenPrimary); image.ChromaGreenPrimary = info; Test_Chromaticity(0.5, 1.0, 1.5, image.ChromaGreenPrimary); Test_Chromaticity(0.64, 0.33, 0, image.ChromaRedPrimary); image.ChromaRedPrimary = info; Test_Chromaticity(0.5, 1.0, 1.5, image.ChromaRedPrimary); Test_Chromaticity(0.3127, 0.329, 0, image.ChromaWhitePoint); image.ChromaWhitePoint = info; Test_Chromaticity(0.5, 1.0, 1.5, image.ChromaWhitePoint); } }
private static void Test_Chromaticity(double expectedX, double expectedY, double expectedZ, PrimaryInfo info) { Assert.AreEqual(expectedX, info.X, 0.001, "X is not equal."); Assert.AreEqual(expectedY, info.Y, 0.001, "Y is not equal."); Assert.AreEqual(expectedZ, info.Z, 0.001, "Z is not equal."); }