Look for mot-zoom-step

git-svn-id: https://zxing.googlecode.com/svn/trunk@1290 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2010-04-07 08:10:35 +00:00
parent e6b205cd21
commit 4bc4b9a452

View file

@ -476,14 +476,27 @@ final class CameraManager {
}
}
String motZoomValues = parameters.get("mot-zoom-values");
if (motZoomValues != null) {
tenDesiredZoom = findBestMotZoomValue(motZoomValues, tenDesiredZoom);
String motZoomValuesString = parameters.get("mot-zoom-values");
if (motZoomValuesString != null) {
tenDesiredZoom = findBestMotZoomValue(motZoomValuesString, tenDesiredZoom);
}
String motZoomStepString = parameters.get("mot-zoom-step");
if (motZoomStepString != null) {
try {
double motZoomStep = Double.parseDouble(motZoomStepString.trim());
int tenZoomStep = (int) (10.0 * motZoomStep);
if (tenZoomStep > 1) {
tenDesiredZoom -= tenDesiredZoom % tenZoomStep;
}
} catch (NumberFormatException nfe) {
// continue
}
}
// Set zoom. This helps encourage the user to pull back.
// Some devices like the Behold have a zoom parameter
if (maxZoomString != null || motZoomValues != null) {
if (maxZoomString != null || motZoomValuesString != null) {
parameters.set("zoom", String.valueOf(tenDesiredZoom / 10.0));
}