-
- All Implemented Interfaces:
-
io.scanbot.sdk.camera.FrameHandler
public final class GenericTextRecognizerFrameHandler implements FrameHandlerPerforms generic text recognition on camera preview frames. Outputs results via GenericTextRecognizerFrameHandler.ResultHandler.
Preview frame considered intercepted if at least one GenericTextRecognizerFrameHandler.ResultHandler returns
truefrom GenericTextRecognizerFrameHandler.ResultHandler.handle
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceGenericTextRecognizerFrameHandler.ResultHandlerContinuously notified about generic text recognition results.
public abstract classGenericTextRecognizerFrameHandler.TextRecognitionScannerResultHandlerSuccessor-class needed for cross-platform implementation
public classGenericTextRecognizerFrameHandler.Companion
-
Constructor Summary
Constructors Constructor Description GenericTextRecognizerFrameHandler(GenericTextRecognizer genericTextRecognizer)
-
Method Summary
Modifier and Type Method Description final BooleangetIsEnabled()Parameter determines if text recognition is enabled. final UnitsetIsEnabled(Boolean isEnabled)Parameter determines if text recognition is enabled. BooleanhandleFrame(FrameHandler.Frame previewFrame)final UnitaddResultHandler(GenericTextRecognizerFrameHandler.ResultHandler resultHandler)Registers result handler which will be notified about generic text recognition results. final UnitremoveResultHandler(GenericTextRecognizerFrameHandler.ResultHandler resultHandler)Unregisters handler. final UnitclearResultHandlers()Unregisters all handlers. -
-
Constructor Detail
-
GenericTextRecognizerFrameHandler
GenericTextRecognizerFrameHandler(GenericTextRecognizer genericTextRecognizer)
-
-
Method Detail
-
getIsEnabled
final Boolean getIsEnabled()
Parameter determines if text recognition is enabled. In case of
falsevalue incoming frames are skipped.Default is
true
-
setIsEnabled
final Unit setIsEnabled(Boolean isEnabled)
Parameter determines if text recognition is enabled. In case of
falsevalue incoming frames are skipped.Default is
true
-
handleFrame
@Synchronized() Boolean handleFrame(FrameHandler.Frame previewFrame)
-
addResultHandler
final Unit addResultHandler(GenericTextRecognizerFrameHandler.ResultHandler resultHandler)
Registers result handler which will be notified about generic text recognition results.
Results are coming on the worker thread. Don't forget to move execution to main thread before updating UI.
- Parameters:
resultHandler- handler to register.
-
removeResultHandler
final Unit removeResultHandler(GenericTextRecognizerFrameHandler.ResultHandler resultHandler)
Unregisters handler.
- Parameters:
resultHandler- handler to unregister.
-
clearResultHandlers
final Unit clearResultHandlers()
Unregisters all handlers. If nothing was registered before, nothing happens.
-
-
-
-