ZoomSuggestionOptions.Builder
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public ZoomSuggestionOptions.Builder
setMaxSupportedZoomRatio (float maxSupportedZoomRatio)
Sets the max supported zoom ratio.
Different camera libraries have different ways to fetch the max supported zoom
ratio.
- Camera1: camera.getZoomRatios(camera.getMaxZoom())
- Camera2:
characteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM)
- CameraX: camera.getCameraInfo().getZoomState().getValue().getMaxZoomRatio()
If unset, then the library may produce an unbounded zoom ratio.
Parameters
maxSupportedZoomRatio |
the max supported zoom ratio fetched from camera. |
Returns
- this object, for chaining method calls.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eZoomSuggestionOptions.Builder\u003c/code\u003e helps create \u003ccode\u003eZoomSuggestionOptions\u003c/code\u003e instances for controlling camera zoom during barcode scanning.\u003c/p\u003e\n"],["\u003cp\u003eIt requires a \u003ccode\u003eZoomSuggestionOptions.ZoomCallback\u003c/code\u003e in its constructor to handle zoom actions.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can set the maximum supported zoom ratio using \u003ccode\u003esetMaxSupportedZoomRatio()\u003c/code\u003e to ensure compatibility with different camera implementations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method finally creates a \u003ccode\u003eZoomSuggestionOptions\u003c/code\u003e object based on the provided configurations.\u003c/p\u003e\n"]]],[],null,["# ZoomSuggestionOptions.Builder\n\npublic static class **ZoomSuggestionOptions.Builder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nBuilder to build out a [ZoomSuggestionOptions](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions). \n\n### Public Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions.Builder#Builder(com.google.mlkit.vision.barcode.ZoomSuggestionOptions.ZoomCallback))([ZoomSuggestionOptions.ZoomCallback](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions.ZoomCallback) zoomCallback) Builder for [ZoomSuggestionOptions](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions). |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ZoomSuggestionOptions](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions) | [build](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions.Builder#build())() Builds a [ZoomSuggestionOptions](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions) instance. |\n| [ZoomSuggestionOptions.Builder](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions.Builder) | [setMaxSupportedZoomRatio](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions.Builder#setMaxSupportedZoomRatio(float))(float maxSupportedZoomRatio) Sets the max supported zoom ratio. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **Builder** ([ZoomSuggestionOptions.ZoomCallback](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions.ZoomCallback) zoomCallback)\n\nBuilder for [ZoomSuggestionOptions](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions). \n\n##### Parameters\n\n| zoomCallback | The [ZoomSuggestionOptions.ZoomCallback](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions.ZoomCallback) to zoom the camera. |\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n\nPublic Methods\n--------------\n\n#### public [ZoomSuggestionOptions](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions)\n**build** ()\n\nBuilds a [ZoomSuggestionOptions](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions)\ninstance. \n\n#### public [ZoomSuggestionOptions.Builder](/android/reference/com/google/mlkit/vision/barcode/ZoomSuggestionOptions.Builder)\n**setMaxSupportedZoomRatio** (float maxSupportedZoomRatio)\n\nSets the max supported zoom ratio.\n\nDifferent camera libraries have different ways to fetch the max supported zoom\nratio.\n\n- Camera1: camera.getZoomRatios(camera.getMaxZoom())\n- Camera2: characteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM)\n- CameraX: camera.getCameraInfo().getZoomState().getValue().getMaxZoomRatio()\n\nIf unset, then the library may produce an unbounded zoom ratio. \n\n##### Parameters\n\n| maxSupportedZoomRatio | the max supported zoom ratio fetched from camera. |\n|-----------------------|---------------------------------------------------|\n\n##### Returns\n\n- this object, for chaining method calls."]]