FinderPatternFinder$CenterComparator.smali
.class final Lcom/dcloud/zxing2/qrcode/detector/FinderPatternFinder$CenterComparator;
.super Ljava/lang/Object;
# interfaces
.implements Ljava/util/Comparator;
.implements Ljava/io/Serializable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/dcloud/zxing2/qrcode/detector/FinderPatternFinder;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1a
name = "CenterComparator"
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;",
"Ljava/util/Comparator<",
"Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;",
">;",
"Ljava/io/Serializable;"
}
.end annotation
# instance fields
.field private final average:F
# direct methods
.method private constructor <init>(F)V
.registers 2
.line 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 3
iput p1, p0, Lcom/dcloud/zxing2/qrcode/detector/FinderPatternFinder$CenterComparator;->average:F
return-void
.end method
.method synthetic constructor <init>(FLcom/dcloud/zxing2/qrcode/detector/FinderPatternFinder$1;)V
.registers 3
.line 1
invoke-direct {p0, p1}, Lcom/dcloud/zxing2/qrcode/detector/FinderPatternFinder$CenterComparator;-><init>(F)V
return-void
.end method
# virtual methods
.method public compare(Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;)I
.registers 5
.line 2
invoke-virtual {p2}, Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;->getCount()I
move-result v0
invoke-virtual {p1}, Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;->getCount()I
move-result v1
if-ne v0, v1, :cond_2e
.line 3
invoke-virtual {p2}, Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;->getEstimatedModuleSize()F
move-result p2
iget v0, p0, Lcom/dcloud/zxing2/qrcode/detector/FinderPatternFinder$CenterComparator;->average:F
sub-float/2addr p2, v0
invoke-static {p2}, Ljava/lang/Math;->abs(F)F
move-result p2
.line 4
invoke-virtual {p1}, Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;->getEstimatedModuleSize()F
move-result p1
iget v0, p0, Lcom/dcloud/zxing2/qrcode/detector/FinderPatternFinder$CenterComparator;->average:F
sub-float/2addr p1, v0
invoke-static {p1}, Ljava/lang/Math;->abs(F)F
move-result p1
cmpg-float v0, p2, p1
if-gez v0, :cond_26
const/4 p1, 0x1
goto :goto_2d
:cond_26
cmpl-float p1, p2, p1
if-nez p1, :cond_2c
const/4 p1, 0x0
goto :goto_2d
:cond_2c
const/4 p1, -0x1
:goto_2d
return p1
.line 7
:cond_2e
invoke-virtual {p2}, Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;->getCount()I
move-result p2
invoke-virtual {p1}, Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;->getCount()I
move-result p1
sub-int/2addr p2, p1
return p2
.end method
.method public bridge synthetic compare(Ljava/lang/Object;Ljava/lang/Object;)I
.registers 3
.line 1
check-cast p1, Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;
check-cast p2, Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;
invoke-virtual {p0, p1, p2}, Lcom/dcloud/zxing2/qrcode/detector/FinderPatternFinder$CenterComparator;->compare(Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;Lcom/dcloud/zxing2/qrcode/detector/FinderPattern;)I
move-result p1
return p1
.end method