Beispiel #1
0
        public void CreateTest()
        {
            // Arrange
            IntPtr plugin   = IntPtr.Zero;
            IntPtr userData = IntPtr.Zero;

            // Act
            using (var context = Context.Create(plugin, userData))
                using (var gbd = GamutBoundaryDescriptor.Create(context))
                {
                    // Assert
                    Assert.IsNotNull(gbd);
                }
        }
Beispiel #2
0
        public void ComputeTest()
        {
            // Arrange
            IntPtr plugin   = IntPtr.Zero;
            IntPtr userData = IntPtr.Zero;

            using (var context = Context.Create(plugin, userData))
                using (var gbd = GamutBoundaryDescriptor.Create(context))
                {
                    // Act
                    bool computed = gbd.Compute();

                    // Assert
                    Assert.IsTrue(computed);
                }
        }
Beispiel #3
0
        public void CheckPointTest()
        {
            // Arrange
            IntPtr plugin   = IntPtr.Zero;
            IntPtr userData = IntPtr.Zero;

            using (var context = Context.Create(plugin, userData))
                using (var gbd = GamutBoundaryDescriptor.Create(context))
                {
                    CIELab add = new CIELab {
                    };
                    for (int L = 0; L <= 100; L += 10)
                    {
                        for (int a = -128; a <= 128; a += 5)
                        {
                            for (int b = -128; b <= 128; b += 5)
                            {
                                add.L = L;
                                add.a = a;
                                add.b = b;
                                gbd.AddPoint(add);
                            }
                        }
                    }

                    gbd.Compute();

                    // Act
                    CIELab check = new CIELab {
                    };
                    for (int L = 10; L <= 90; L += 25)
                    {
                        for (int a = -120; a <= 120; a += 25)
                        {
                            for (int b = -120; b <= 120; b += 25)
                            {
                                check.L = L;
                                check.a = a;
                                check.b = b;

                                // Assert
                                Assert.IsTrue(gbd.CheckPoint(check));
                            }
                        }
                    }
                }
        }
Beispiel #4
0
        public void AddPointTest()
        {
            // Arrange
            IntPtr plugin   = IntPtr.Zero;
            IntPtr userData = IntPtr.Zero;
            CIELab lab      = new CIELab {
                L = 99.3, a = 12.6, b = 14.2
            };

            using (var context = Context.Create(plugin, userData))
                using (var gbd = GamutBoundaryDescriptor.Create(context))
                {
                    // Act
                    bool added = gbd.AddPoint(lab);

                    // Assert
                    Assert.IsTrue(added);
                }
        }