Class BarCodeResult
- java.lang.Object
-
- com.aspose.barcode.barcoderecognition.BarCodeResult
-
public final class BarCodeResult extends java.lang.Object
Stores recognized barcode data like
SingleDecodeType
type,string
codetext,BarCodeRegionParameters
region and other parametersThis sample shows how to obtain BarCodeResult.
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "12345"); generator.save("c:\\test.png"); BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128); for(BarCodeResult result : reader.readBarCodes()) { System.out.println("BarCode Type: " + result.getCodeTypeName()); System.out.println("BarCode CodeText: " + result.getCodeText()); System.out.println("BarCode Confidence: " + result.getConfidence()); System.out.println("BarCode ReadingQuality: " + result.getReadingQuality()); System.out.println("BarCode Angle: " + result.getRegion().getAngle()); }
-
-
Constructor Summary
Constructors Constructor Description BarCodeResult(BarCodeResult result)
Creates a a copy of theBarCodeResult
class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
deepClone()
Creates a copy ofBarCodeResult
class.boolean
equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specifiedBarCodeResult
value.byte[]
getCodeBytes()
Gets the encoded code bytesjava.lang.String
getCodeText()
Gets the code textjava.lang.String
getCodeText(java.nio.charset.Charset encoding)
Gets the code text with encoding.SingleDecodeType
getCodeType()
Gets the barcode typejava.lang.String
getCodeTypeName()
Gets the name of the barcode typeint
getConfidence()
Gets recognition confidence level of the recognized barcodeBarCodeExtendedParameters
getExtended()
Gets extended parameters of recognized barcodedouble
getReadingQuality()
Gets the reading quality.BarCodeRegionParameters
getRegion()
Gets the barcode regionint
hashCode()
Returns the hash code for this instance.java.lang.String
toString()
Returns a human-readable string representation of thisBarCodeResult
.
-
-
-
Constructor Detail
-
BarCodeResult
public BarCodeResult(BarCodeResult result)
Creates a a copy of the
BarCodeResult
class.- Parameters:
result
- An copyBarCodeResult
instance.
-
-
Method Detail
-
getReadingQuality
public double getReadingQuality()
Gets the reading quality. Works for 1D and postal barcodes.
Value: The reading quality percent
-
getConfidence
public int getConfidence()
Gets recognition confidence level of the recognized barcode
Value:BarCodeConfidence.Strong
does not have fakes or misrecognitions,BarCodeConfidence.Moderate
could sometimes have fakes or incorrect codetext because this confidence level for barcodews with weak cheksum or even without it,BarCodeConfidence.None
always has incorrect codetext and could be fake recognitions
-
getCodeText
public java.lang.String getCodeText()
Gets the code text
Value: The code text of the barcode
-
getCodeBytes
public byte[] getCodeBytes()
Gets the encoded code bytes
Value: The code bytes of the barcode
-
getCodeType
public SingleDecodeType getCodeType()
Gets the barcode type
Value: The type information of the recognized barcode
-
getCodeTypeName
public java.lang.String getCodeTypeName()
Gets the name of the barcode type
Value: The type name of the recognized barcode
-
getRegion
public BarCodeRegionParameters getRegion()
Gets the barcode region
Value: The region of the recognized barcode
-
getExtended
public BarCodeExtendedParameters getExtended()
Gets extended parameters of recognized barcode
Value: The extended parameters of recognized barcode
-
getCodeText
public java.lang.String getCodeText(java.nio.charset.Charset encoding)
Gets the code text with encoding.
- Parameters:
encoding
- The encoding for codetext.- Returns:
- A string containing recognized code text.
-
equals
public boolean equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specified
BarCodeResult
value.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- AnBarCodeResult
value to compare to this instance.- Returns:
<b>true</b>
if obj has the same value as this instance; otherwise,<b>false</b>
.
-
hashCode
public int hashCode()
Returns the hash code for this instance.
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A 32-bit signed integer hash code.
-
toString
public java.lang.String toString()
Returns a human-readable string representation of this
BarCodeResult
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string that represents this
BarCodeResult
.
-
deepClone
public java.lang.Object deepClone()
Creates a copy of
BarCodeResult
class.- Returns:
- Returns copy of
BarCodeResult
class.
-
-