| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Threading.Tasks;
- namespace TeamAAS_VP.Models
- {
- /// <summary>
- /// 棋盘格分析结果
- /// </summary>
- public class CheckerboardResult : INotifyPropertyChanged
- {
- private bool _detected;
- private double _blackMean;
- private double _whiteMean;
- private double _contrast;
- private int _optimalBrightness;
- public bool Detected
- {
- get => _detected;
- set => SetField(ref _detected, value);
- }
- public double BlackMean
- {
- get => _blackMean;
- set => SetField(ref _blackMean, value);
- }
- public double WhiteMean
- {
- get => _whiteMean;
- set => SetField(ref _whiteMean, value);
- }
- public double Contrast
- {
- get => _contrast;
- set => SetField(ref _contrast, value);
- }
- public int OptimalBrightness
- {
- get => _optimalBrightness;
- set => SetField(ref _optimalBrightness, value);
- }
- public event PropertyChangedEventHandler PropertyChanged;
- protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
- {
- if (EqualityComparer<T>.Default.Equals(field, value)) return false;
- field = value;
- OnPropertyChanged(propertyName);
- return true;
- }
- }
- }
|