Package com.journeyapps.barcodescanner
Class BarcodeResult
- java.lang.Object
-
- com.journeyapps.barcodescanner.BarcodeResult
-
public class BarcodeResult extends Object
This contains the result of a barcode scan. This class delegate all read-only fields ofResult, and adds a bitmap with scanned barcode.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.zxing.ResultmResultprotected SourceDatasourceData
-
Constructor Summary
Constructors Constructor Description BarcodeResult(com.google.zxing.Result result, SourceData sourceData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.zxing.BarcodeFormatgetBarcodeFormat()BitmapgetBitmap()intgetBitmapScaleFactor()BitmapgetBitmapWithResultPoints(int color)byte[]getRawBytes()com.google.zxing.ResultgetResult()Map<com.google.zxing.ResultMetadataType,Object>getResultMetadata()com.google.zxing.ResultPoint[]getResultPoints()StringgetText()longgetTimestamp()List<com.google.zxing.ResultPoint>getTransformedResultPoints()StringtoString()static List<com.google.zxing.ResultPoint>transformResultPoints(List<com.google.zxing.ResultPoint> resultPoints, SourceData sourceData)
-
-
-
Field Detail
-
mResult
protected com.google.zxing.Result mResult
-
sourceData
protected SourceData sourceData
-
-
Constructor Detail
-
BarcodeResult
public BarcodeResult(com.google.zxing.Result result, SourceData sourceData)
-
-
Method Detail
-
getResult
public com.google.zxing.Result getResult()
- Returns:
- wrapped
Result
-
getBitmap
public Bitmap getBitmap()
- Returns:
Bitmapwith barcode preview- See Also:
getBitmapWithResultPoints(int)
-
getTransformedResultPoints
public List<com.google.zxing.ResultPoint> getTransformedResultPoints()
-
getBitmapWithResultPoints
public Bitmap getBitmapWithResultPoints(int color)
- Parameters:
color- Color of result points- Returns:
Bitmapwith result points on it, or plain bitmap, if no result points
-
getBitmapScaleFactor
public int getBitmapScaleFactor()
- Returns:
- Bitmap preview scale factor
-
getText
public String getText()
- Returns:
- raw text encoded by the barcode
- See Also:
Result.getText()
-
getRawBytes
public byte[] getRawBytes()
- Returns:
- raw bytes encoded by the barcode, if applicable, otherwise
null - See Also:
Result.getRawBytes()
-
getResultPoints
public com.google.zxing.ResultPoint[] getResultPoints()
- Returns:
- points related to the barcode in the image. These are typically points identifying finder patterns or the corners of the barcode. The exact meaning is specific to the type of barcode that was decoded.
- See Also:
Result.getResultPoints()
-
getBarcodeFormat
public com.google.zxing.BarcodeFormat getBarcodeFormat()
- Returns:
BarcodeFormatrepresenting the format of the barcode that was decoded- See Also:
Result.getBarcodeFormat()
-
getResultMetadata
public Map<com.google.zxing.ResultMetadataType,Object> getResultMetadata()
- Returns:
MapmappingResultMetadataTypekeys to values. May benull. This contains optional metadata about what was detected about the barcode, like orientation.- See Also:
Result.getResultMetadata()
-
getTimestamp
public long getTimestamp()
-
transformResultPoints
public static List<com.google.zxing.ResultPoint> transformResultPoints(List<com.google.zxing.ResultPoint> resultPoints, SourceData sourceData)
-
-