Esempio n. 1
0
        public void ChromaticityCoordinates()
        {
            var first  = new xyChromaticityCoordinates(1, 0.445);
            var second = new xyChromaticityCoordinates(1, 0.445);

            Assert.Equal(first, (object)second);
        }
Esempio n. 2
0
        public void CCTFromChromaticity(double x, double y, double expectedCCT)
        {
            // arrange
            var chromaticity  = new xyChromaticityCoordinates(x, y);
            var approximation = new CCTConverter();

            // action
            double cct = approximation.GetCCTOfChromaticity(chromaticity);

            // assert
            Debug.WriteLine(string.Format("CCT {0} K (difference {1} K)", cct, Math.Abs(expectedCCT - cct)));
            Assert.That(cct, Is.EqualTo(expectedCCT).Using(new DoubleDeltaComparer(66)));
        }
Esempio n. 3
0
        public void ChromaticityFromCCT(double expectedX, double expectedY, double cct)
        {
            // arrange
            var approximation = new CCTConverter();

            // action
            xyChromaticityCoordinates chromaticity = approximation.GetChromaticityOfCCT(cct);

            // assert
            var deltaComparer = new DoubleDeltaComparer(0.02);

            Assert.That(chromaticity.x, Is.EqualTo(expectedX).Using(deltaComparer));
            Assert.That(chromaticity.y, Is.EqualTo(expectedY).Using(deltaComparer));
        }
Esempio n. 4
0
        public void CCTFromChromaticity(double x, double y, double expectedCCT)
        {
            // arrange
            var chromaticity = new xyChromaticityCoordinates(x, y);

            // action
            var cct = CCTConverter.GetCCTOfChromaticity(chromaticity);

            // assert
            Debug.WriteLine($"CCT {cct} K (difference {Math.Abs(expectedCCT - cct)} K)");
            var deltaComparer = new DoubleDeltaComparer(66);

            Assert.Equal(cct, expectedCCT, deltaComparer);
        }
Esempio n. 5
0
 public void ChromaticityCoordinates()
 {
     var coordinates = new xyChromaticityCoordinates(1, 0.445);
     Assert.AreEqual("xy [x=1, y=0.45]", coordinates.ToString());
 }
Esempio n. 6
0
        public void CCTFromChromaticity(double x, double y, double expectedCCT)
        {
            // arrange
            var chromaticity = new xyChromaticityCoordinates(x, y);
            var approximation = new CCTConverter();

            // action
            double cct = approximation.GetCCTOfChromaticity(chromaticity);

            // assert
            Debug.WriteLine(string.Format("CCT {0} K (difference {1} K)", cct, Math.Abs(expectedCCT - cct)));
            Assert.That(cct, Is.EqualTo(expectedCCT).Using(new DoubleDeltaComparer(66)));
        }
Esempio n. 7
0
 /// <summary>
 /// Constructs coordinates
 /// </summary>
 public RGBPrimariesChromaticityCoordinates(xyChromaticityCoordinates r, xyChromaticityCoordinates g, xyChromaticityCoordinates b)
 {
     R = r;
     G = g;
     B = b;
 }
Esempio n. 8
0
        public void ChromaticityCoordinates()
        {
            var coordinates = new xyChromaticityCoordinates(1, 0.445);

            Assert.Equal("xy [x=1, y=0.45]", coordinates.ToString());
        }
 public RGBPrimariesChromaticityCoordinates(xyChromaticityCoordinates r, xyChromaticityCoordinates g, xyChromaticityCoordinates b)
 {
     _r = r;
     _g = g;
     _b = b;
 }
 public RGBPrimariesChromaticityCoordinates(xyChromaticityCoordinates r, xyChromaticityCoordinates g, xyChromaticityCoordinates b)
 {
     _r = r;
     _g = g;
     _b = b;
 }