aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml.cs
blob: 65e9af1ffb5ae2250db6abee357476410ebbcef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.PPC.UI.Views
{
    /// <summary>
    /// Interaction logic for LoginView.xaml
    /// </summary>
    public partial class LoginView : UserControl
    {
        public LoginView()
        {
            InitializeComponent();
        }
    }
}
Constructor /// <param name="l">L (usually from -1 to 1)</param> /// <param name="m">M (usually from -1 to 1)</param> /// <param name="s">S (usually from -1 to 1)</param> public LMSColor(double l, double m, double s) { L = l; M = m; S = s; } /// <param name="vector"><see cref="Vector" />, expected 3 dimensions (usually from 0 to 1)</param> public LMSColor(Vector vector) : this(vector[0], vector[1], vector[2]) { } #endregion #region Channels /// <summary> /// Long wavelengths (red) cone response (Rho) /// </summary> /// <remarks> /// Ranges usually from -1 to 1. /// </remarks> public double L { get; } /// <summary> /// Medium wavelengths (green) cone response (Gamma) /// </summary> /// <remarks> /// Ranges usually from -1 to 1. /// </remarks> public double M { get; } /// <summary> /// Short wavelengths (blue) cone response (Beta) /// </summary> /// <remarks> /// Ranges usually from -1 to 1. /// </remarks> public double S { get; } /// <summary> /// <see cref="IColorVector" /> /// </summary> public Vector Vector => new[] { L, M, S }; #endregion #region Equality /// <inheritdoc cref="object" /> [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public bool Equals(LMSColor other) => L == other.L && M == other.M && S == other.S; /// <inheritdoc cref="object" /> public override bool Equals(object obj) => obj is LMSColor other && Equals(other); /// <inheritdoc cref="object" /> public override int GetHashCode() { unchecked { var hashCode = L.GetHashCode(); hashCode = (hashCode * 397) ^ M.GetHashCode(); hashCode = (hashCode * 397) ^ S.GetHashCode(); return hashCode; } } /// <inheritdoc cref="object" /> public static bool operator ==(LMSColor left, LMSColor right) => Equals(left, right); /// <inheritdoc cref="object" /> public static bool operator !=(LMSColor left, LMSColor right) => !Equals(left, right); #endregion #region Overrides /// <inheritdoc cref="object" /> public override string ToString() => string.Format(CultureInfo.InvariantCulture, "LMS [L={0:0.##}, M={1:0.##}, S={2:0.##}]", L, M, S); #endregion } }