/// <summary> /// Initializes a new instance of the SnapshotHistgramVerifier class, with the tolerance histogram curve initialized to the specified tolerance value. /// </summary> /// <param name="tolerance">The tolerance Histogram to use for verification.</param> public SnapshotHistogramVerifier(Histogram tolerance) { this.Tolerance = tolerance; }
/// <summary> /// Verifies a diffed image based on the number of pixels of a given brightness per color. /// A tolerance Histogram curve can be created from an XML file, produced from a reference image, or manually created for use as a tolerance. /// </summary> /// <param name="image">The actual Snapshot to be verified.</param> /// <returns>A VerificationResult enumeration value based on the image, the expected color, and the tolerance.</returns> public override VerificationResult Verify(Snapshot image) { Histogram actual = Histogram.FromSnapshot(image); return((actual.IsLessThan(Tolerance)) ? VerificationResult.Pass : VerificationResult.Fail); }
/// <summary> /// Initializes a new instance of the SnapshotHistgramVerifier class, with the tolerance histogram curve initialized to zero tolerance for non-black values. /// </summary> public SnapshotHistogramVerifier() { Tolerance = new Histogram(); }