< Summary

Information
Class: Morpho25.Utility.Pixel
Assembly: Morpho25
File(s): D:\a\Morpho\Morpho\project\Morpho\Morpho25\Utility\Pixel.cs
Line coverage
53%
Covered lines: 8
Uncovered lines: 7
Coverable lines: 15
Total lines: 46
Line coverage: 53.3%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_I()100%1100%
get_J()100%1100%
get_K()100%1100%
.ctor(...)100%1100%
op_Equality(...)100%10%
op_Inequality(...)100%10%
Equals(...)0%20%
GetHashCode()100%10%
Equals(...)0%40%

File(s)

D:\a\Morpho\Morpho\project\Morpho\Morpho25\Utility\Pixel.cs

#LineLine coverage
 1
 2using System;
 3
 4namespace Morpho25.Utility
 5{
 6    /// <summary>
 7    /// Pixel struct.
 8    /// </summary>
 9    public struct Pixel : IEquatable<Pixel>
 10    {
 11        /// <summary>
 12        /// I component.
 13        /// </summary>
 8914614        public int I { get; set; }
 15        /// <summary>
 16        /// J component.
 17        /// </summary>
 8914618        public int J { get; set; }
 19        /// <summary>
 20        /// K component.
 21        /// </summary>
 17829222        public int K { get; set; }
 23
 24        /// <summary>
 25        /// Create a new pixel.
 26        /// </summary>
 27        /// <param name="i">I component.</param>
 28        /// <param name="j">J component.</param>
 29        /// <param name="k">K component.</param>
 30        public Pixel(int i, int j, int k)
 8914631        {
 8914632            I = i;
 8914633            J = j;
 8914634            K = k;
 8914635        }
 36
 037        public static bool operator ==(Pixel first, Pixel second) => first.Equals(second);
 038        public static bool operator !=(Pixel first, Pixel second) => !(first == second);
 039        public override bool Equals(object obj) => obj is Pixel other && this.Equals(other);
 040        public override int GetHashCode() => (I, J, K).GetHashCode();
 41        public bool Equals(Pixel other)
 042        {
 043            return I == other.I && J == other.J && K == other.K;
 044        }
 45    }
 46}