distance method
inherited
Returns the distance between two pixels in the pixel format.
What constitutes distance is not defined by this method, and is up to the pixel format to define. For example, both abgr8888 and floatRgba use cartesian distance to compare pixels.
Implementation
@override
@nonVirtual
double distance(int a, int b) {
final dr = getRed(a) - getRed(b);
final dg = getGreen(a) - getGreen(b);
final db = getBlue(a) - getBlue(b);
final da = getAlpha(a) - getAlpha(b);
return (dr * dr + dg * dg + db * db + da * da).toDouble();
}