Vixen
02b45cc4
csharp
public readonly record struct ImageTolerance

How far two pictures of the same interface may be apart.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ The default is exact, which a GPU golden suite cannot afford and this can. Vixen.Graphics.Golden.Tests compares perceptually because MoltenVK and lavapipe round the same sRGB conversion differently and both are conformant, so a bitwise suite there is red from the day it is written. Nothing here is rendered by a driver — see SoftwareUiRasterizer — so the same arithmetic runs on every machine and a tolerance would have nothing to absorb except real differences.

The looser values exist anyway, for the one case that is not about drivers: a reference regenerated after a deliberate change to text shaping or corner geometry, where a reviewer wants to see whether anything else moved.

Fields and properties (5)

  • public int Channel

    How far one channel may differ, in 0–255, before that pixel counts as wrong.

  • public double Fraction

    What fraction of pixels may be wrong before the picture is.

  • public static ImageTolerance Exact

    Byte for byte.

  • public static ImageTolerance Slight

    A shade either way, and no pixel allowed to be wholly wrong.

  • public static ImageTolerance Edges

    For a picture whose antialiased edges may land differently.

Methods (1)

  • public ImageTolerance(int Channel, double Fraction)

    How far two pictures of the same interface may be apart.

Used by (6)

  • ImageComparerVixen.Ui.Testing
  • RasterizerTestsVixen.Ui.Testing.Tests
  • ScreenshotTestsVixen.Ui.Testing.Tests
  • UiTestVixen.Ui.Testing
  • UiTestOptionsVixen.Ui.Testing
  • VisualBaselineVixen.Ui.Testing