mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 13:04:05 -08:00
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:
parent
e6b205cd21
commit
4bc4b9a452
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue