Class Barcode
java.lang.Object
com.codename1.ai.vision.Barcode
Portable barcode observation with normalized geometry. Format names are
backend-neutral constants such as
QR_CODE, DATA_MATRIX,
CODE_128, and EAN_13; unknown symbologies use
UNKNOWN. Corner points are ordered around the code when supplied
by the backend and may be empty when geometry is unavailable.-
Constructor Summary
ConstructorsConstructorDescriptionBarcode(String value, String format, byte[] rawBytes, VisionRect bounds, VisionPoint[] corners) Creates a barcode without backend metadata.Barcode(String value, String format, byte[] rawBytes, VisionRect bounds, VisionPoint[] corners, VisionMetadata metadata) Creates a complete barcode observation. -
Method Summary
-
Constructor Details
-
Barcode
public Barcode(String value, String format, byte[] rawBytes, VisionRect bounds, VisionPoint[] corners) Creates a barcode without backend metadata.- Parameters:
value- decoded display value, ornullformat- normalized symbology namerawBytes- original payload bytes when availablebounds- normalized top-left-origin boundscorners- normalized corner points
-
Barcode
public Barcode(String value, String format, byte[] rawBytes, VisionRect bounds, VisionPoint[] corners, VisionMetadata metadata) Creates a complete barcode observation.- Parameters:
value- decoded display value, ornullformat- normalized symbology namerawBytes- original payload bytes when availablebounds- normalized top-left-origin boundscorners- normalized corner pointsmetadata- backend identity and optional diagnostic values
-
-
Method Details
-
getValue
- Returns:
- decoded display value, or
nullwhen decoding failed
-
getFormat
- Returns:
- normalized symbology name, never a vendor numeric identifier
-
getRawBytes
public byte[] getRawBytes()- Returns:
- a defensive copy of payload bytes, or
nullif unavailable
-
getBounds
- Returns:
- normalized top-left-origin bounds
-
getCorners
- Returns:
- defensive copy of normalized corners; possibly empty
-
getMetadata
- Returns:
- backend metadata, or
nullfor manually created results
-