Package io.scanbot.sdk.util.snap
Class Utils.AspectRatioComparator
-
- All Implemented Interfaces:
-
java.util.Comparator
public final class Utils.AspectRatioComparator implements Comparator<Camera.Size>
Compares Camera.Size according to aspect ratio it represents regards to matching to some perfect desired target aspect ratio.
For example:
Collections.min(sizes, AspectRatioComparator(targetAspect))
will return the size whose aspect ratio is closest to target.
-
-
Constructor Summary
Constructors Constructor Description Utils.AspectRatioComparator(Double targetRatio)
-
Method Summary
Modifier and Type Method Description Integer
compare(Camera.Size lhs, Camera.Size rhs)
-
-
Constructor Detail
-
Utils.AspectRatioComparator
Utils.AspectRatioComparator(Double targetRatio)
-
-
Method Detail
-
compare
Integer compare(Camera.Size lhs, Camera.Size rhs)
-
-
-
-