The CapturedResultReceiver class is designed as a standardized way for retrieving captured results in the Dynamsoft Capture Vision architecture. It adopts an event-driven approach, with events dedicated to various result types, such as the original image, decoded barcodes, recognized text lines, detected quads, normalized images, and parsed results, etc.

Code snippet:

val router: CaptureVisionRouter
router.addResultReceiver({
onDecodedBarcodesReceived: result => {
//Handle barcodes. `result` is an instance of DecodedBarcodesResult.
},

onRecognizedTextLinesReceived: result => {
//Handle the result of text recognition. `result` is an instance of RecognizedTextLinesResult.
},
})
interface CapturedResultReceiver {
    onCapturedResultReceived?: (result: CapturedResult) => void;
    onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
    onParsedResultsReceived?: (result: ParsedResult) => void;
    onProcessedDocumentResultReceived?: (
        result: ProcessedDocumentResult,
    ) => void;
    onRecognizedTextLinesReceived?: (result: RecognizedTextLinesResult) => void;
}

Properties

onCapturedResultReceived?: (result: CapturedResult) => void

Event triggered when a generic captured result is available, occurring each time an image finishes its processing. This event can be used for any result that does not fit into the specific categories of the other callback events.

onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void

Event triggered when decoded barcodes are available. This event is used to handle barcodes that have been successfully decoded by Dynamsoft Barcode Reader.

onParsedResultsReceived?: (result: ParsedResult) => void

Event triggered when parsed results are available. This event is used for handling results that have been parsed into a structured format by Dynamsoft Code Parser.

onProcessedDocumentResultReceived?: (result: ProcessedDocumentResult) => void

Event triggered when processed document result are available. This event is used for handling images that have been processed or normalized (e.g., corrected for skew or perspective), by Dynamsoft Document Normalizer.

onRecognizedTextLinesReceived?: (result: RecognizedTextLinesResult) => void

Event triggered when recognized text lines are available. This event is used to handle the result of text recognition by Dynamsoft Label Recognizer.