"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "android/src/com/google/zxing/client/android/camera/CameraManager.java" between
zxing-zxing-3.4.0.tar.gz and zxing-zxing-3.4.1.tar.gz

About: ZXing ("zebra crossing") is a multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.

CameraManager.java  (zxing-zxing-3.4.0):CameraManager.java  (zxing-zxing-3.4.1)
skipping to change at line 230 skipping to change at line 230
// Called early, before init even finished // Called early, before init even finished
return null; return null;
} }
int width = findDesiredDimensionInRange(screenResolution.x, MIN_FRAME_WIDT H, MAX_FRAME_WIDTH); int width = findDesiredDimensionInRange(screenResolution.x, MIN_FRAME_WIDT H, MAX_FRAME_WIDTH);
int height = findDesiredDimensionInRange(screenResolution.y, MIN_FRAME_HEI GHT, MAX_FRAME_HEIGHT); int height = findDesiredDimensionInRange(screenResolution.y, MIN_FRAME_HEI GHT, MAX_FRAME_HEIGHT);
int leftOffset = (screenResolution.x - width) / 2; int leftOffset = (screenResolution.x - width) / 2;
int topOffset = (screenResolution.y - height) / 2; int topOffset = (screenResolution.y - height) / 2;
framingRect = new Rect(leftOffset, topOffset, leftOffset + width, topOffse t + height); framingRect = new Rect(leftOffset, topOffset, leftOffset + width, topOffse t + height);
Log.d(TAG, "Calculated framing rect: " + framingRect);
} }
return framingRect; return framingRect;
} }
private static int findDesiredDimensionInRange(int resolution, int hardMin, in t hardMax) { private static int findDesiredDimensionInRange(int resolution, int hardMin, in t hardMax) {
int dim = 5 * resolution / 8; // Target 5/8 of each dimension int dim = 5 * resolution / 8; // Target 5/8 of each dimension
if (dim < hardMin) { if (dim < hardMin) {
return hardMin; return hardMin;
} }
if (dim > hardMax) { return Math.min(dim, hardMax);
return hardMax;
}
return dim;
} }
/** /**
* Like {@link #getFramingRect} but coordinates are in terms of the preview fr ame, * Like {@link #getFramingRect} but coordinates are in terms of the preview fr ame,
* not UI / screen. * not UI / screen.
* *
* @return {@link Rect} expressing barcode scan area in terms of the preview s ize * @return {@link Rect} expressing barcode scan area in terms of the preview s ize
*/ */
public synchronized Rect getFramingRectInPreview() { public synchronized Rect getFramingRectInPreview() {
if (framingRectInPreview == null) { if (framingRectInPreview == null) {
 End of changes. 2 change blocks. 
5 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)