Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(918)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java

Issue 2575943002: Barcode Detection: Add |cornerPoints| to DetectedBarcode.idl (Closed)
Patch Set: Correct coordinates (in clockwise direction starting with top-left) Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java
index ec9e4f5121adf8f6d668de6bcf80bcc650df8a36..c825462851a1adab347e107cda456b202c625e18 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.shapedetection;
import android.content.Context;
import android.graphics.Bitmap;
+import android.graphics.Point;
import android.graphics.Rect;
import android.util.SparseArray;
@@ -18,6 +19,7 @@ import org.chromium.blink.mojom.BarcodeDetection;
import org.chromium.blink.mojom.BarcodeDetectionResult;
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler;
+import org.chromium.gfx.mojom.PointF;
import org.chromium.gfx.mojom.RectF;
import org.chromium.mojo.system.MojoException;
import org.chromium.mojo.system.SharedBufferHandle;
@@ -35,7 +37,6 @@ public class BarcodeDetectionImpl implements BarcodeDetection {
private BarcodeDetector mBarcodeDetector;
public BarcodeDetectionImpl(Context context) {
- Log.d(TAG, "BarcodeDetectionImpl ctor()");
mContext = context;
mBarcodeDetector = new BarcodeDetector.Builder(mContext).build();
}
@@ -101,6 +102,13 @@ public class BarcodeDetectionImpl implements BarcodeDetection {
barcodeArray[i].boundingBox.y = rect.top;
barcodeArray[i].boundingBox.width = rect.width();
barcodeArray[i].boundingBox.height = rect.height();
+ final Point[] corners = barcode.cornerPoints;
+ barcodeArray[i].cornerPoints = new PointF[corners.length];
+ for (int j = 0; j < corners.length; j++) {
+ barcodeArray[i].cornerPoints[j] = new PointF();
+ barcodeArray[i].cornerPoints[j].x = corners[j].x;
David Trainor- moved to gerrit 2016/12/16 19:43:34 barcodeArray[i].cornerPoints[j].set(corners[j])?
+ barcodeArray[i].cornerPoints[j].y = corners[j].y;
+ }
}
callback.call(barcodeArray);
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698