public void TestTrackerImage(string fileName, double expectedX, double expectedY, double expectedRotation = 0, double expectedScale = 1)
        {
            ObsTransform results = TestImageHelper.ProcessImage(fileName);

            Assert.AreEqual(expectedX, results.Origin.X, PositionalTolerance);
            Assert.AreEqual(expectedY, results.Origin.Y, PositionalTolerance);
            Assert.AreEqual(expectedRotation, results.Rotation);
            Assert.AreEqual(expectedScale, results.Scale);
        }
Пример #2
0
        public void Test45()
        {
            ObsTransform results = TestImageHelper.ProcessImage("45");

            Assert.AreEqual(45, results.Rotation, RotationTolerance);
            Assert.AreEqual(0.45, results.Opacity, OpacityTolerance);
            Assert.AreEqual(0.45 / 4, results.Scale, 0.45 * ScaleTolerance);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(0, results.Camera);
        }
Пример #3
0
        public void Test37Flipped()
        {
            ObsTransform results = TestImageHelper.ProcessImage("37Flipped");

            Assert.AreEqual(37, results.Rotation, 3);
            Assert.AreEqual(40, results.Origin.X, 3);
            Assert.AreEqual(70, results.Origin.Y, 3);
            Assert.AreEqual(0.37, results.Opacity, OpacityTolerance);
            Assert.AreEqual(0.37 / 4, results.Scale, 0.37 * ScaleTolerance);
            Assert.AreEqual(true, results.Flipped);
            Assert.AreEqual(0, results.Camera);
        }
Пример #4
0
        public void Test180()
        {
            ObsTransform results = TestImageHelper.ProcessImage("180 Rotation 200 Scale 79 Opacity");

            Assert.AreEqual(180, results.Rotation, RotationTolerance);
            Assert.AreEqual(220, results.Origin.X, 5);
            Assert.AreEqual(48, results.Origin.Y, 5);
            Assert.AreEqual(0.79, results.Opacity, OpacityTolerance);
            Assert.AreEqual(0.5, results.Scale, 2 * ScaleTolerance);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(0, results.Camera);
        }
Пример #5
0
        public void Test45Left()
        {
            ObsTransform results = TestImageHelper.ProcessImage("45 Left 55 Scale 65 Opacity");

            Assert.AreEqual(76, results.Origin.X, 5);
            Assert.AreEqual(65, results.Origin.Y, 5);
            Assert.AreEqual(-45, results.Rotation, RotationTolerance);
            Assert.AreEqual(0.65, results.Opacity, OpacityTolerance);
            Assert.AreEqual(0.55 / 4, results.Scale, 0.55 * ScaleTolerance);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(0, results.Camera);
        }
Пример #6
0
        public void TestOrigin42PercentOpacity()
        {
            ObsTransform results = TestImageHelper.ProcessImage("Origin - 42% opacity");

            Assert.AreEqual(0, results.Rotation, RotationTolerance);
            Assert.AreEqual(1201, results.Origin.X, 10);
            Assert.AreEqual(1054, results.Origin.Y, 10);
            Assert.AreEqual(0.25, results.Scale, ScaleTolerance);
            Assert.AreEqual(0.42, results.Opacity, OpacityTolerance);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(0, results.Camera);
        }
Пример #7
0
        public void TestSideCamera90()
        {
            ObsTransform results = TestImageHelper.ProcessImage("SideCamera90");

            Assert.AreEqual(90, results.Rotation, 3);
            Assert.AreEqual(23, results.Origin.X, 3);
            Assert.AreEqual(85, results.Origin.Y, 3);
            Assert.AreEqual(0.9, results.Opacity, OpacityTolerance);
            Assert.AreEqual(0.9 / 4, results.Scale, 0.9 * ScaleTolerance);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(1, results.Camera);
        }
Пример #8
0
        public void Test53Flipped()
        {
            ObsTransform results = TestImageHelper.ProcessImage("53Flipped");

            Assert.AreEqual(-53, results.Rotation, 3);
            Assert.AreEqual(61, results.Origin.X, 3);
            Assert.AreEqual(54, results.Origin.Y, 3);
            Assert.AreEqual(0.53, results.Opacity, OpacityTolerance);
            Assert.AreEqual(0.53 / 4, results.Scale, 0.53 * ScaleTolerance);
            Assert.AreEqual(true, results.Flipped);
            Assert.AreEqual(0, results.Camera);
        }
Пример #9
0
        public void Test500pxMargins()
        {
            ObsTransform results = TestImageHelper.ProcessImage("CodingGorilla");

            Assert.AreEqual(0, results.Rotation, RotationTolerance);
            Assert.AreEqual(1, results.Opacity, OpacityTolerance);
            Assert.AreEqual(1, results.Scale, 0.45 * ScaleTolerance);
            Assert.AreEqual(960, results.Origin.X, 1102);
            Assert.AreEqual(540, results.Origin.Y, 1058);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(0, results.Camera);
        }
Пример #10
0
        public void TestScreenTrackerOrigin()
        {
            ObsTransform results = TestImageHelper.ProcessImage("ScreenTrackerOrigin");

            Assert.AreEqual(0, results.Rotation, RotationTolerance);
            Assert.AreEqual(1, results.Opacity, OpacityTolerance);
            Assert.AreEqual(1, results.Scale, 0.45 * ScaleTolerance);
            Assert.AreEqual(960, results.Origin.X, 2);
            Assert.AreEqual(540, results.Origin.Y, 2);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(0, results.Camera);
        }
Пример #11
0
        public void TestCamera3_270()
        {
            ObsTransform results = TestImageHelper.ProcessImage("Camera3-270");

            Assert.AreEqual(-90, results.Rotation);
            Assert.AreEqual(1, results.Opacity);
            Assert.AreEqual(1, results.Scale);
            Assert.AreEqual(1136, results.Origin.X, 0.15);
            Assert.AreEqual(364, results.Origin.Y, 0.15);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(3, results.Camera);
        }
Пример #12
0
        public void TestCamera2_180()
        {
            ObsTransform results = TestImageHelper.ProcessImage("Camera2-180");

            Assert.AreEqual(180, results.Rotation);
            Assert.AreEqual(1, results.Opacity);
            Assert.AreEqual(1, results.Scale);
            Assert.AreEqual(960, results.Origin.X, 0.15);
            Assert.AreEqual(188, results.Origin.Y, 0.15);
            Assert.AreEqual(false, results.Flipped);
            Assert.AreEqual(2, results.Camera);
        }
Пример #13
0
        public void TestRotation(string imageName, double expectedRotation)
        {
            ObsTransform results = TestImageHelper.ProcessImage(imageName);

            Assert.AreEqual(expectedRotation, results.Rotation, RotationTolerance);
        }