Barcode

data class Barcode(val bytes: ByteArray?, val text: String?, val position: DetectionPosition)

Detected barcode in the image.

Constructors

Link copied to clipboard
constructor(bytes: ByteArray?, text: String?, position: DetectionPosition)

Properties

Link copied to clipboard

Barcode bytes, or null if the barcode was located but could not be decoded, for example because it is out of focus.

Link copied to clipboard

Position of the barcode in the image. Present even when bytes and text are null.

Link copied to clipboard
val text: String?

Barcode content decoded as text, exactly as encoded in the barcode, with no formatting applied. It is null if the barcode was located but could not be decoded. The character set declared in the barcode is used, otherwise a detected one with the ISO-8859-1 fallback. Read bytes instead if the barcode carries binary data or if you need to apply your own character set.