Class BarCodeResult
Stores recognized barcode data like SingleDecodeType type, string codetext,
BarCodeRegionParameters region and other parameters
This sample shows how to obtain BarCodeResult.BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.CODE_128, "12345"); generator.save("test.png"); BarCodeReader reader = new BarCodeReader("test.png", DecodeType.CODE_39, 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
ConstructorsConstructorDescriptionBarCodeResult(BarCodeResult result) Creates a a copy of theBarCodeResultclass. -
Method Summary
Modifier and TypeMethodDescriptionCreates a copy ofBarCodeResultclass.booleanReturns a value indicating whether this instance is equal to a specifiedBarCodeResultvalue.byte[]Gets the encoded code bytesGets the code textgetCodeText(Charset encoding) Gets the code text with encoding.Gets the barcode typeGets the name of the barcode typeintGets recognition confidence level of the recognized barcodeGets extended parameters of recognized barcodedoubleGets the reading quality.Gets the barcode regioninthashCode()Returns the hash code for this instance.toString()Returns a human-readable string representation of thisBarCodeResult.
-
Constructor Details
-
BarCodeResult
Creates a a copy of the
BarCodeResultclass.- Parameters:
result- An copyBarCodeResultinstance.
-
-
Method Details
-
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.Strongdoes not have fakes or misrecognitions,BarCodeConfidence.Moderatecould sometimes have fakes or incorrect codetext because this confidence level for barcodews with weak cheksum or even without it,BarCodeConfidence.Nonealways has incorrect codetext and could be fake recognitions -
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
Gets the barcode type
Value: The type information of the recognized barcode -
getCodeTypeName
Gets the name of the barcode type
Value: The type name of the recognized barcode -
getRegion
Gets the barcode region
Value: The region of the recognized barcode -
getExtended
Gets extended parameters of recognized barcode
Value: The extended parameters of recognized barcode -
getCodeText
Gets the code text with encoding.
This example shows how to use
GetCodeText:BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.DATA_MATRIX); gen.setCodeText("車種名", Charset.forName("932")); gen.save("barcode.png", BarCodeImageFormat.PNG); BarCodeReader reader = new BarCodeReader("barcode.png", DecodeType.DATA_MATRIX); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText(Charset.forName("932")));- Parameters:
encoding- The encoding for codetext.- Returns:
- A string containing recognized code text.
-
equals
Returns a value indicating whether this instance is equal to a specified
BarCodeResultvalue. -
hashCode
public int hashCode()Returns the hash code for this instance.
-
toString
Returns a human-readable string representation of this
BarCodeResult. -
deepClone
Creates a copy of
BarCodeResultclass.- Returns:
- Returns copy of
BarCodeResultclass.
-