ButteraugliDistance Struct

The Butteraugli distance between two frames (ImageSimilarity.ComputeButteraugliDistance): the two values that libjxl's butteraugli_main prints.

public readonly struct ButteraugliDistance : IEquatable<ButteraugliDistance>
Implements

Constructors

NameDescription
ButteraugliDistance(double, double)Initializes a new instance of the ButteraugliDistance struct.

ButteraugliDistance(double, double)

ButteraugliDistance.cs

Initializes a new instance of the ButteraugliDistance struct.

public ButteraugliDistance(double maxDistance, double pNorm3)

Parameters

maxDistance double
The largest distance of the map.
pNorm3 double
The 3-norm of the map.

Properties

NameDescription
MaxDistanceGets the largest distance of the map, the value usually called "the Butteraugli distance": 0 for identical pixels, below about 1 when the difference is not visible, and larger values for more visible differences.
PNorm3Gets the 3-norm of the map (the mean of its 3-, 6- and 12-norms): a summary of the whole frame, smaller than ButteraugliDistance.MaxDistance, that a localized difference raises less.

Gets the largest distance of the map, the value usually called "the Butteraugli distance": 0 for identical pixels, below about 1 when the difference is not visible, and larger values for more visible differences.

public double MaxDistance { get; }

Property value

double

Remarks

It is the distance of the worst pixel, so a difference confined to a small area weighs fully.

Gets the 3-norm of the map (the mean of its 3-, 6- and 12-norms): a summary of the whole frame, smaller than ButteraugliDistance.MaxDistance, that a localized difference raises less.

public double PNorm3 { get; }

Property value

double

Methods

NameDescription
Equals(ButteraugliDistance)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the distance formatted as {MaxDistance} (3-norm: {PNorm3}).

Equals overloads

Equals(ButteraugliDistance)

ButteraugliDistance.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ButteraugliDistance other)
Parameters
other ButteraugliDistance
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

ButteraugliDistance.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Returns the distance formatted as {MaxDistance} (3-norm: {PNorm3}).

public override string ToString()

Returns

string A string representation of the distance.

Operators

NameDescription
operator ==(ButteraugliDistance, ButteraugliDistance)Compares two distances for equality.
operator !=(ButteraugliDistance, ButteraugliDistance)Compares two distances for inequality.

operator ==(ButteraugliDistance, ButteraugliDistance)

ButteraugliDistance.cs

Compares two distances for equality.

public static bool operator ==(ButteraugliDistance left, ButteraugliDistance right)

Parameters

left ButteraugliDistance
The first distance.
right ButteraugliDistance
The second distance.

Returns

bool true if both distances are equal; otherwise false.

operator !=(ButteraugliDistance, ButteraugliDistance)

ButteraugliDistance.cs

Compares two distances for inequality.

public static bool operator !=(ButteraugliDistance left, ButteraugliDistance right)

Parameters

left ButteraugliDistance
The first distance.
right ButteraugliDistance
The second distance.

Returns

bool true if the distances differ; otherwise false.