findFinderPattern()[1] points the outside pixel of the finder pattern (#1179)

This commit is contained in:
MakKi (makki_d) 2019-06-17 00:10:23 +09:00 committed by Sean Owen
parent 6075d5b2f6
commit ae6d7e55af
2 changed files with 5 additions and 4 deletions

View file

@ -164,7 +164,8 @@ public final class RSS14Reader extends AbstractRSSReader {
(ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK); (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
if (resultPointCallback != null) { if (resultPointCallback != null) {
float center = (startEnd[0] + startEnd[1]) / 2.0f; startEnd = pattern.getStartEnd();
float center = (startEnd[0] + startEnd[1] - 1) / 2.0f;
if (right) { if (right) {
// row is actually reversed // row is actually reversed
center = row.getSize() - 1 - center; center = row.getSize() - 1 - center;
@ -193,7 +194,7 @@ public final class RSS14Reader extends AbstractRSSReader {
if (outsideChar) { if (outsideChar) {
recordPatternInReverse(row, pattern.getStartEnd()[0], counters); recordPatternInReverse(row, pattern.getStartEnd()[0], counters);
} else { } else {
recordPattern(row, pattern.getStartEnd()[1] + 1, counters); recordPattern(row, pattern.getStartEnd()[1], counters);
// reverse it // reverse it
for (int i = 0, j = counters.length - 1; i < j; i++, j--) { for (int i = 0, j = counters.length - 1; i < j; i++, j--) {
int temp = counters[i]; int temp = counters[i];

View file

@ -28,7 +28,7 @@ public final class RSS14BlackBox2TestCase extends AbstractBlackBoxTestCase {
public RSS14BlackBox2TestCase() { public RSS14BlackBox2TestCase() {
super("src/test/resources/blackbox/rss14-2", new MultiFormatReader(), BarcodeFormat.RSS_14); super("src/test/resources/blackbox/rss14-2", new MultiFormatReader(), BarcodeFormat.RSS_14);
addTest(4, 8, 1, 1, 0.0f); addTest(4, 8, 1, 1, 0.0f);
addTest(2, 8, 0, 1, 180.0f); addTest(3, 8, 0, 1, 180.0f);
} }
} }