package com.google.zxing.multi.qrcode.detector;\r
\r
import com.google.zxing.DecodeHintType;\r
-import com.google.zxing.MonochromeBitmapSource;\r
+import com.google.zxing.BinaryBitmap;\r
import com.google.zxing.ReaderException;\r
import com.google.zxing.ResultPoint;\r
import com.google.zxing.common.BitArray;\r
\r
private static final FinderPatternInfo[] EMPTY_RESULT_ARRAY = new FinderPatternInfo[0];\r
\r
- // TODO MIN_MODULE_COUNT and MAX_MODULE_COUNT would be great\r
- // hints to ask the user for since it limits the number of regions to decode\r
- private static final float MAX_MODULE_COUNT_PER_EDGE = 180; // max. legal count of modules per QR code edge (177)\r
- private static final float MIN_MODULE_COUNT_PER_EDGE = 9; // min. legal count per modules per QR code edge (11)\r
+ // TODO MIN_MODULE_COUNT and MAX_MODULE_COUNT would be great hints to ask the user for\r
+ // since it limits the number of regions to decode\r
+\r
+ // max. legal count of modules per QR code edge (177)\r
+ private static final float MAX_MODULE_COUNT_PER_EDGE = 180;\r
+ // min. legal count per modules per QR code edge (11)\r
+ private static final float MIN_MODULE_COUNT_PER_EDGE = 9;\r
\r
/**\r
* More or less arbitrary cutoff point for determining if two finder patterns might belong\r
*\r
* @param image image to search\r
*/\r
- MultiFinderPatternFinder(MonochromeBitmapSource image) {\r
+ MultiFinderPatternFinder(BinaryBitmap image) {\r
super(image);\r
}\r
\r
* - feature similar module sizes\r
* - are placed in a distance so the estimated module count is within the QR specification\r
* - have similar distance between upper left/right and left top/bottom finder patterns\r
- * - form a triangle with 90° angle (checked by comparing top right/bottom left distance with pythagoras)\r
+ * - form a triangle with 90° angle (checked by comparing top right/bottom left distance\r
+ * with pythagoras)\r
*\r
- * Note: we allow each point to be used for more than one code region: this might seem counterintuitive at first,\r
- * but the performance penalty is not that big. At this point, we cannot make a good quality decision whether\r
- * the three finders actually represent a QR code, or are just by chance layouted so it looks like there might\r
- * be a QR code there.\r
+ * Note: we allow each point to be used for more than one code region: this might seem\r
+ * counterintuitive at first, but the performance penalty is not that big. At this point,\r
+ * we cannot make a good quality decision whether the three finders actually represent\r
+ * a QR code, or are just by chance layouted so it looks like there might be a QR code there.\r
* So, if the layout seems right, lets have the decoder try to decode. \r
*/\r
\r
\r
// Check the sizes\r
float estimatedModuleCount = ((dA + dB) / p1.getEstimatedModuleSize()) / 2;\r
- if (estimatedModuleCount > MAX_MODULE_COUNT_PER_EDGE || estimatedModuleCount < MIN_MODULE_COUNT_PER_EDGE) {\r
+ if (estimatedModuleCount > MAX_MODULE_COUNT_PER_EDGE ||\r
+ estimatedModuleCount < MIN_MODULE_COUNT_PER_EDGE) {\r
continue;\r
}\r
\r
\r
public FinderPatternInfo[] findMulti(Hashtable hints) throws ReaderException {\r
boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER);\r
- MonochromeBitmapSource image = getImage();\r
+ BinaryBitmap image = getImage();\r
int maxI = image.getHeight();\r
int maxJ = image.getWidth();\r
// We are looking for black/white/black/white/black modules in\r