/// <summary> /// 设置VideoProcAmpProperty的Mannual值 /// 有做有效值判断 /// </summary> /// <param name="videoProcAmpProperty"></param> /// <param name="perpertyValue"></param> public void SetManualParameterValue(VideoProcAmpProperty videoProcAmpProperty, int perpertyValue) { if (_propertyToRangeParameter.ContainsKey(videoProcAmpProperty) || this.GetRangeParameterValue(videoProcAmpProperty) != null) { VideoProcAmpRangeParameter videoProcAmpRangeParameter = _propertyToRangeParameter[videoProcAmpProperty]; int ensureValue = perpertyValue; int hr = this._videoProcAmp.Set(videoProcAmpProperty, ensureValue, VideoProcAmpFlags.Manual); } }
/// <summary> /// 设置VideoProcAmpProperty的值 /// 有做有效值判断 /// </summary> /// <param name="videoProcAmpProperty"></param> /// <param name="perpertyValue"></param> public void SetParameterValue(VideoProcAmpProperty videoProcAmpProperty, int perpertyValue) { if (_propertyToRangeParameter.ContainsKey(videoProcAmpProperty) || this.GetRangeParameterValue(videoProcAmpProperty) != null) { VideoProcAmpRangeParameter videoProcAmpRangeParameter = _propertyToRangeParameter[videoProcAmpProperty]; int ensureValue = Math.Min(Math.Max(videoProcAmpRangeParameter.MinValue, perpertyValue), videoProcAmpRangeParameter.MaxValue); this._videoProcAmp.Set(videoProcAmpProperty, ensureValue, VideoProcAmpFlags.Manual); } }
public VideoProcAmpRangeParameter GetRangeParameterValue(VideoProcAmpProperty property) { VideoProcAmpRangeParameter _model = new VideoProcAmpRangeParameter(); int Min, Max, Step, Default; VideoProcAmpFlags _flgs; int hr2 = iAMVideoProcAmp.GetRange(property, out Min, out Max, out Step, out Default, out _flgs); DsError.ThrowExceptionForHR(hr2); _model.MinValue = Min; _model.MaxValue = Max; _model.SetpValue = Step; _model.DefaultValue = Default; _model.VideoProcAmpFlags = _flgs; return(_model); }
/// <summary> /// 获取可设置范围值 /// </summary> /// <param name="videoProcAmpProperty"></param> /// <returns></returns> public VideoProcAmpRangeParameter GetRangeParameterValue(VideoProcAmpProperty videoProcAmpProperty) { VideoProcAmpRangeParameter videoProcAmpRangeParameter = null; try { int hr = this._videoProcAmp.GetRange(videoProcAmpProperty, out int min, out int max, out int step, out int defaultValue, out VideoProcAmpFlags videoProcAmpFlags); string sss = DsError.GetErrorText(hr); if (hr == 0) { videoProcAmpRangeParameter = new VideoProcAmpRangeParameter { VideoProcAmpProperty = videoProcAmpProperty, MinValue = min, MaxValue = max, StepValue = step, DefaultValue = defaultValue, Flags = videoProcAmpFlags }; //加入字典 if (_propertyToRangeParameter.ContainsKey(videoProcAmpProperty)) { _propertyToRangeParameter[videoProcAmpProperty] = videoProcAmpRangeParameter; } else { _propertyToRangeParameter.Add(videoProcAmpProperty, videoProcAmpRangeParameter); } } } catch (Exception) { } return(videoProcAmpRangeParameter); }