public class RecognizerBundle
extends <any>
Recognizer
objects that can travel via Intent
Modifier and Type | Class and Description |
---|---|
static class |
RecognizerBundle.FrameQualityEstimationMode |
static class |
RecognizerBundle.RecognitionDebugMode |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator |
CREATOR |
static int |
TIMEOUT_INFINITY
Constant used as argument for
RecognizerBundle.setNumMsBeforeTimeout(int) method when timeout should
be set to infinity. |
Constructor and Description |
---|
RecognizerBundle(java.util.List recognizerList) |
RecognizerBundle(Recognizer[] recognizers) |
Modifier and Type | Method and Description |
---|---|
protected void |
consumeContentFromLoadedObject(RecognizerBundle loadedBundle) |
static RecognizerBundle |
createFromIntent(android.content.Intent intent)
Creates object of this class from
Intent . |
boolean |
equals(java.lang.Object o) |
protected <any> |
getConcreteCreator() |
RecognizerBundle.FrameQualityEstimationMode |
getFrameQualityEstimationMode() |
int |
getNumMsBeforeTimeout()
Returns the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.
|
RecognizerBundle.RecognitionDebugMode |
getRecognitionDebugMode()
Returns the current recognition mode.
|
Recognizer[] |
getRecognizers()
Returns the array of recognizers associated with this bundle.
|
protected java.lang.String |
getUniqueIdIntentExtraKey() |
protected void |
readFromParcel(android.os.Parcel in) |
void |
saveToIntent(android.content.Intent intent)
|
void |
setAllowMultipleScanResultsOnSingleImage(boolean multiScan)
Sets whether or not outputting of multiple scan results from same image
is allowed.
|
void |
setFrameQualityEstimationMode(RecognizerBundle.FrameQualityEstimationMode mode)
Sets the mode of the frame quality estimation.
|
void |
setNumMsBeforeTimeout(int numMsBeforeTimeout)
Set the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.
|
void |
setRecognitionDebugMode(RecognizerBundle.RecognitionDebugMode recognitionMode)
This method is for debugging and testing purposes only.
|
boolean |
shouldAllowMultipleScanResultsOnSingleImage()
Returns true if multiple scan results can be obtained from single image.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final int TIMEOUT_INFINITY
RecognizerBundle.setNumMsBeforeTimeout(int)
method when timeout should
be set to infinity. Effectively, this means that recognition timeout will be disabled.@NonNull public static final android.os.Parcelable.Creator CREATOR
public RecognizerBundle(@NonNull Recognizer[] recognizers)
public RecognizerBundle(@NonNull java.util.List recognizerList)
@Nullable public static final RecognizerBundle createFromIntent(@NonNull android.content.Intent intent)
Intent
.intent
- intent in which object is stored.null
if it does not exist in the given intent.@NonNull public Recognizer[] getRecognizers()
@NonNull public RecognizerBundle.RecognitionDebugMode getRecognitionDebugMode()
public void setRecognitionDebugMode(@NonNull RecognizerBundle.RecognitionDebugMode recognitionMode)
recognitionMode
- Requested mode of recognition.public boolean shouldAllowMultipleScanResultsOnSingleImage()
RecognizerBundle.setAllowMultipleScanResultsOnSingleImage(boolean)
for details.public void setAllowMultipleScanResultsOnSingleImage(boolean multiScan)
public void setNumMsBeforeTimeout(int numMsBeforeTimeout)
Recognizer.Result
inside recognizers in this
bundle changes its state Recognizer.Result.getResultState()
to either Recognizer.Result.State.Uncertain
or Recognizer.Result.State.Valid
.
The reason for this is the better user experience in cases when for example timeout is set to 10
seconds and user starts scanning and leaves device lying on table for 9 seconds and then
points the device towards the object it wants to scan: in such case it is better to let that
user scan the object it wants instead of completing scan with empty scan result as soon as
10 seconds timeout ticks out.numMsBeforeTimeout
- duration in millisecondspublic int getNumMsBeforeTimeout()
RecognizerBundle.setNumMsBeforeTimeout(int)
public void setFrameQualityEstimationMode(@NonNull RecognizerBundle.FrameQualityEstimationMode mode)
mode
- Desired mode of frame quality estimation.@NonNull public RecognizerBundle.FrameQualityEstimationMode getFrameQualityEstimationMode()
@NonNull protected java.lang.String getUniqueIdIntentExtraKey()
@NonNull protected <any> getConcreteCreator()
protected void consumeContentFromLoadedObject(@NonNull RecognizerBundle loadedBundle)
public void saveToIntent(@NonNull android.content.Intent intent)
intent
- Intent to which RecognizerBundle
should be saved.public boolean equals(@Nullable java.lang.Object o)
protected void readFromParcel(@NonNull android.os.Parcel in)
public void writeToParcel(@NonNull android.os.Parcel dest, int flags)