Skip to content
com.iristick.smartglass.core.camera

Class Barcode


public abstract class Barcode
extends Object
Describes a barcode detected in an image.
Since:
1.2

Constructor Summary

Constructor and Description
Barcode() 

Method Summary

Modifier and Type Method and Description
Rect getBounds()
Retrieve the bounds of the barcode.
abstract void getBounds(Rect bounds)
Compute the bounds of the barcode and store them in bounds.
abstract String getFormat()
Retrieve the format of the barcode.
abstract Point[] getPoints()
Retrieve an array of points describing the location of the barcode within the image.
abstract byte[] getRawData()
Retrieve the raw data contained in the barcode.
abstract String getValue()
Retrieve the value of the barcode, decoded as UTF-8 text.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Barcode

public Barcode()

Method Detail

getValue

@CheckResult
 @NonNull
public abstract String getValue()
Retrieve the value of the barcode, decoded as UTF-8 text.
Returns:
the value of the decoded barcode.
Since:
1.2

getRawData

@CheckResult
 @NonNull
public abstract byte[] getRawData()
Retrieve the raw data contained in the barcode.
Returns:
the raw data contained in the decoded barcode.
Since:
1.2

getFormat

@CheckResult
 @NonNull
public abstract String getFormat()
Retrieve the format of the barcode. The value is one of CaptureRequest.POSTPROCESS_BARCODE_FORMAT_*.
Returns:
the format of the barcode.
Since:
1.2

getPoints

@CheckResult
 @NonNull
public abstract Point[] getPoints()
Retrieve an array of points describing the location of the barcode within the image.

The order of the points is unspecified.

Note

The returned array should not be modified.

Returns:
an array of points
Since:
1.2

getBounds

@CheckResult
 @NonNull
public final Rect getBounds()
Retrieve the bounds of the barcode.

This method creates a new object every time it is called. For increased performance, consider using getBounds(Rect).

Returns:
An object describing the bounding box of the barcode within the image.
Since:
1.2
See Also:
getBounds(Rect)

getBounds

public abstract void getBounds(@NonNull
                               Rect bounds)
Compute the bounds of the barcode and store them in bounds.
Parameters:
bounds - The computed bounds are stored in this object.
Since:
1.2