Fixed an old misspelling and a few tiny tweaks
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Wed, 27 May 2009 10:03:23 +0000 (10:03 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Wed, 27 May 2009 10:03:23 +0000 (10:03 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@956 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/qrcode/detector/FinderPatternFinder.java

index fb7a7e8..e0b0dc9 100755 (executable)
@@ -77,7 +77,7 @@ public class FinderPatternFinder {
     // image, and then account for the center being 3 modules in size. This gives the smallest\r
     // number of pixels the center could be, so skip this often. When trying harder, look for all\r
     // QR versions regardless of how dense they are.\r
-    int iSkip = (int) (maxI / (MAX_MODULES * 4.0f) * 3);\r
+    int iSkip = (3 * maxI) / (4 * MAX_MODULES);\r
     if (iSkip < MIN_SKIP || tryHarder) {\r
       iSkip = MIN_SKIP;\r
     }\r
@@ -111,7 +111,7 @@ public class FinderPatternFinder {
                   // expensive and didn't improve performance.\r
                   iSkip = 2;\r
                   if (hasSkipped) {\r
-                    done = haveMulitplyConfirmedCenters();\r
+                    done = haveMultiplyConfirmedCenters();\r
                   } else {\r
                     int rowSkip = findRowSkip();\r
                     if (rowSkip > stateCount[2]) {\r
@@ -163,7 +163,7 @@ public class FinderPatternFinder {
           iSkip = stateCount[0];\r
           if (hasSkipped) {\r
             // Found a third one\r
-            done = haveMulitplyConfirmedCenters();\r
+            done = haveMultiplyConfirmedCenters();\r
           }\r
         }\r
       }\r
@@ -446,7 +446,7 @@ public class FinderPatternFinder {
    *         at least {@link #CENTER_QUORUM} times each, and, the estimated module size of the\r
    *         candidates is "pretty similar"\r
    */\r
-  private boolean haveMulitplyConfirmedCenters() {\r
+  private boolean haveMultiplyConfirmedCenters() {\r
     int confirmedCount = 0;\r
     float totalModuleSize = 0.0f;\r
     int max = possibleCenters.size();\r
@@ -464,7 +464,7 @@ public class FinderPatternFinder {
     // and that we need to keep looking. We detect this by asking if the estimated module sizes\r
     // vary too much. We arbitrarily say that when the total deviation from average exceeds\r
     // 15% of the total module size estimates, it's too much.\r
-    float average = totalModuleSize / max;\r
+    float average = totalModuleSize / (float) max;\r
     float totalDeviation = 0.0f;\r
     for (int i = 0; i < max; i++) {\r
       FinderPattern pattern = (FinderPattern) possibleCenters.elementAt(i);\r