public void SetThenGetFlips(MMAL_PARAM_MIRROR_T flips) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.Flips = flips; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetFlips() == flips); }
public void SetThenGetVideoStabilisation(bool vstab) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.VideoStabilisation = vstab; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetVideoStabilisation() == vstab); }
public void SetThenGetStatsPass(bool statsPass) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.StatsPass = statsPass; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetStatsPass() == statsPass); }
public void SetThenGetImageFx(MMAL_PARAM_IMAGEFX_T imgFx) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.ImageFx = imgFx; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetImageFx() == imgFx); }
public void SetThenGetDRC(MMAL_PARAMETER_DRC_STRENGTH_T drc) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.DrcLevel = drc; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetDRC() == drc); }
public void SetThenGetShutterSpeed(int shutterSpeed) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.ShutterSpeed = shutterSpeed; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetShutterSpeed() == shutterSpeed); }
public void SetThenGetSaturation(double saturation) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.Saturation = saturation; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetSaturation() == saturation / 100); }
public void SetThenGetRotation(int rotation, int expectedResult) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.Rotation = rotation; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetRotation() == expectedResult); }
public void SetThenGetAwbMode(MMAL_PARAM_AWBMODE_T awbMode) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.AwbMode = awbMode; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetAwbMode() == awbMode); }
public void SetThenGetExposureMeteringMode(MMAL_PARAM_EXPOSUREMETERINGMODE_T expMetMode) { TestHelper.SetConfigurationDefaults(); MMALCameraConfig.ExposureMeterMode = expMetMode; MMALCameraConfig.Reload(); Assert.True(fixture.MMALCamera.Camera.GetExposureMeteringMode() == expMetMode); }
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); }
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()); } }
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()); } }
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()); } }
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()); } }
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()); } }
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(); }
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()); } }