コード例 #1
0
        public void SetThenGetFlips(MMAL_PARAM_MIRROR_T flips)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.Flips = flips;
            MMALCameraConfig.Reload();
            Assert.True(fixture.MMALCamera.Camera.GetFlips() == flips);
        }
コード例 #2
0
        public void SetThenGetVideoStabilisation(bool vstab)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.VideoStabilisation = vstab;
            MMALCameraConfig.Reload();
            Assert.True(fixture.MMALCamera.Camera.GetVideoStabilisation() == vstab);
        }
コード例 #3
0
        public void SetThenGetStatsPass(bool statsPass)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.StatsPass = statsPass;
            MMALCameraConfig.Reload();
            Assert.True(fixture.MMALCamera.Camera.GetStatsPass() == statsPass);
        }
コード例 #4
0
        public void SetThenGetImageFx(MMAL_PARAM_IMAGEFX_T imgFx)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.ImageFx = imgFx;
            MMALCameraConfig.Reload();
            Assert.True(fixture.MMALCamera.Camera.GetImageFx() == imgFx);
        }
コード例 #5
0
        public void SetThenGetDRC(MMAL_PARAMETER_DRC_STRENGTH_T drc)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.DrcLevel = drc;
            MMALCameraConfig.Reload();
            Assert.True(fixture.MMALCamera.Camera.GetDRC() == drc);
        }
コード例 #6
0
        public void SetThenGetShutterSpeed(int shutterSpeed)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.ShutterSpeed = shutterSpeed;
            MMALCameraConfig.Reload();

            Assert.True(fixture.MMALCamera.Camera.GetShutterSpeed() == shutterSpeed);
        }
コード例 #7
0
        public void SetThenGetSaturation(double saturation)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.Saturation = saturation;
            MMALCameraConfig.Reload();

            Assert.True(fixture.MMALCamera.Camera.GetSaturation() == saturation / 100);
        }
コード例 #8
0
        public void SetThenGetRotation(int rotation, int expectedResult)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.Rotation = rotation;
            MMALCameraConfig.Reload();

            Assert.True(fixture.MMALCamera.Camera.GetRotation() == expectedResult);
        }
コード例 #9
0
        public void SetThenGetAwbMode(MMAL_PARAM_AWBMODE_T awbMode)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.AwbMode = awbMode;
            MMALCameraConfig.Reload();

            Assert.True(fixture.MMALCamera.Camera.GetAwbMode() == awbMode);
        }
コード例 #10
0
        public void SetThenGetExposureMeteringMode(MMAL_PARAM_EXPOSUREMETERINGMODE_T expMetMode)
        {
            TestHelper.SetConfigurationDefaults();

            MMALCameraConfig.ExposureMeterMode = expMetMode;
            MMALCameraConfig.Reload();

            Assert.True(fixture.MMALCamera.Camera.GetExposureMeteringMode() == expMetMode);
        }
コード例 #11
0
        public void SetThenGetColourFx(bool enable, int u, int v)
        {
            TestHelper.SetConfigurationDefaults();

            var colFx = new ColourEffects {
                Enable = enable, U = u, V = v
            };

            MMALCameraConfig.ColourFx = colFx;
            MMALCameraConfig.Reload();
            Assert.True(fixture.MMALCamera.Camera.GetColourFx().Enable == enable &&
                        fixture.MMALCamera.Camera.GetColourFx().U == u &&
                        fixture.MMALCamera.Camera.GetColourFx().V == v);
        }
コード例 #12
0
        public void SetThenGetExposureCompensation(int expCompensation)
        {
            TestHelper.SetConfigurationDefaults();
            MMALCameraConfig.ExposureCompensation = expCompensation;

            if (expCompensation >= -10 && expCompensation <= 10)
            {
                MMALCameraConfig.Reload();
                Assert.True(fixture.MMALCamera.Camera.GetExposureCompensation() == expCompensation);
            }
            else
            {
                Assert.ThrowsAny <Exception>(() => MMALCameraConfig.Reload());
            }
        }
コード例 #13
0
        public void SetThenGetContrast(double contrast)
        {
            TestHelper.SetConfigurationDefaults();
            MMALCameraConfig.Contrast = contrast;

            if (contrast >= -100 && contrast <= 100)
            {
                MMALCameraConfig.Reload();

                Assert.True(fixture.MMALCamera.Camera.GetContrast() == contrast / 100);
            }
            else
            {
                Assert.ThrowsAny <Exception>(() => MMALCameraConfig.Reload());
            }
        }
コード例 #14
0
        public void SetThenGetSharpness(double sharpness)
        {
            TestHelper.SetConfigurationDefaults();
            MMALCameraConfig.Sharpness = sharpness;

            if (sharpness >= -100 && sharpness <= 100)
            {
                MMALCameraConfig.Reload();

                Assert.True(fixture.MMALCamera.Camera.GetSharpness() == sharpness / 100);
            }
            else
            {
                Assert.ThrowsAny <Exception>(() => MMALCameraConfig.Reload());
            }
        }
コード例 #15
0
        public void SetThenGetBrightness(double brightness)
        {
            TestHelper.SetConfigurationDefaults();
            MMALCameraConfig.Brightness = brightness;

            if (brightness >= 0 && brightness <= 100)
            {
                MMALCameraConfig.Reload();

                Assert.True(fixture.MMALCamera.Camera.GetBrightness() == brightness / 100);
            }
            else
            {
                Assert.ThrowsAny <Exception>(() => MMALCameraConfig.Reload());
            }
        }
コード例 #16
0
        public void SetThenGetISO(int iso)
        {
            TestHelper.SetConfigurationDefaults();
            MMALCameraConfig.ISO = iso;

            if ((iso >= 100 && iso <= 800) || iso == 0)
            {
                MMALCameraConfig.Reload();

                Assert.True(fixture.MMALCamera.Camera.GetISO() == iso);
            }
            else
            {
                Assert.ThrowsAny <Exception>(() => MMALCameraConfig.Reload());
            }
        }
コード例 #17
0
 public static void SetConfigurationDefaults()
 {
     MMALCameraConfig.Brightness           = 0;
     MMALCameraConfig.Sharpness            = 0;
     MMALCameraConfig.Contrast             = 0;
     MMALCameraConfig.Saturation           = 0;
     MMALCameraConfig.AwbGainsB            = 0;
     MMALCameraConfig.AwbGainsR            = 0;
     MMALCameraConfig.AwbMode              = MMAL_PARAM_AWBMODE_T.MMAL_PARAM_AWBMODE_AUTO;
     MMALCameraConfig.ColourFx             = new ColourEffects();
     MMALCameraConfig.ExposureCompensation = -1;
     MMALCameraConfig.ExposureMeterMode    = MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_AVERAGE;
     MMALCameraConfig.ExposureMode         = MMAL_PARAM_EXPOSUREMODE_T.MMAL_PARAM_EXPOSUREMODE_AUTO;
     MMALCameraConfig.ROI          = new Zoom();
     MMALCameraConfig.ISO          = 0;
     MMALCameraConfig.StatsPass    = false;
     MMALCameraConfig.Flips        = MMAL_PARAM_MIRROR_T.MMAL_PARAM_MIRROR_NONE;
     MMALCameraConfig.ImageFx      = MMAL_PARAM_IMAGEFX_T.MMAL_PARAM_IMAGEFX_NONE;
     MMALCameraConfig.Rotation     = 0;
     MMALCameraConfig.DrcLevel     = MMAL_PARAMETER_DRC_STRENGTH_T.MMAL_PARAMETER_DRC_STRENGTH_OFF;
     MMALCameraConfig.ShutterSpeed = 0;
     MMALCameraConfig.Reload();
 }
コード例 #18
0
        public void SetThenGetZoom(double x, double y, double width, double height)
        {
            TestHelper.SetConfigurationDefaults();

            var zoom = new Zoom {
                Height = height, Width = width, X = x, Y = y
            };

            MMALCameraConfig.ROI = zoom;

            if (x <= 1.0 && y <= 1.0 && height <= 1.0 && width <= 1.0)
            {
                MMALCameraConfig.Reload();

                Assert.True(fixture.MMALCamera.Camera.GetZoom().Height == Convert.ToInt32(height * 65536) &&
                            fixture.MMALCamera.Camera.GetZoom().Width == Convert.ToInt32(width * 65536) &&
                            fixture.MMALCamera.Camera.GetZoom().X == Convert.ToInt32(x * 65536) &&
                            fixture.MMALCamera.Camera.GetZoom().Y == Convert.ToInt32(y * 65536));
            }
            else
            {
                Assert.ThrowsAny <Exception>(() => MMALCameraConfig.Reload());
            }
        }