sdt.brc
public class BarcodeReader extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SDTBARCODE_ALL_1D
All 1-D Barcodes flag (0x0001ffff).
|
static int |
SDTBARCODE_ALL_2D
All 2-D Barcodes flag (0x000e0000).
|
static int |
SDTBARCODE_CODABAR
Codabar barcode type flag (0x00000001).
|
static int |
SDTBARCODE_CODE11
Code 11 barcode type flag (0x00000020).
|
static int |
SDTBARCODE_CODE128
Code 128 barcode type flag (0x00000002).
|
static int |
SDTBARCODE_CODE32
Code 32 barcode type flag (0x00000004).
|
static int |
SDTBARCODE_CODE39
Code 39 barcode type flag (0x00000008).
|
static int |
SDTBARCODE_CODE93
Code 93 barcode type flag (0x00000010).
|
static int |
SDTBARCODE_DATAMATRIX
DataMatrix barcode type flag (0x00020000)
|
static int |
SDTBARCODE_EAN13
EAN13 barcode type flag (0x00000040).
|
static int |
SDTBARCODE_EAN5
EAN5 barcode type flag (0x00000100).
|
static int |
SDTBARCODE_EAN8
EAN8 barcode type flag (0x00000080).
|
static int |
SDTBARCODE_I2OF5
I2of5 barcode type flag (0x00000200).
|
static int |
SDTBARCODE_INTELLIMAIL
Intelligent Mail barcode type flag (0x00010000)
|
static int |
SDTBARCODE_MSI
MSI barcode type flag (0x00100000)
|
static int |
SDTBARCODE_PATCH_CODE
Patch code barcode type flag (0x00000400).
|
static int |
SDTBARCODE_PDF417
PDF417 barcode type flag (0x00040000)
|
static int |
SDTBARCODE_PHARMACODE
UPC-E barcode type flag (0x00200000)
|
static int |
SDTBARCODE_PLUS2
Plus2 barcode type flag (0x00001000).
|
static int |
SDTBARCODE_PLUS5
Plus5 barcode type flag (0x00002000).
|
static int |
SDTBARCODE_POSTNET
Postnet barcode type flag (0x00000800).
|
static int |
SDTBARCODE_QRCODE
QR Code barcode type flag (0x00080000)
|
static int |
SDTBARCODE_UNKNOWN
Unknown barcode type flag (0x00000000).
|
static int |
SDTBARCODE_UPCA
UPC-A barcode type flag (0x00004000).
|
static int |
SDTBARCODE_UPCB
UPC-B barcode type flag (0x00008000).
|
static int |
SDTBARCODE_UPCE
UPC-E barcode type flag (0x00200000)
|
static int |
SDTINPUT_FILETYPE_BMP |
static int |
SDTINPUT_FILETYPE_JPEG |
static int |
SDTINPUT_FILETYPE_PDF |
static int |
SDTINPUT_FILETYPE_PNG |
static int |
SDTINPUT_FILETYPE_TIFF |
static int |
SDTREADDIRECTION_ALL
All supported reading directions flag flag (0x0f).
|
static int |
SDTREADDIRECTION_BTT
Right-to-Left barcode reading direction flag (0x08).
|
static int |
SDTREADDIRECTION_LTR
Left-to-right barcode reading direction flag (0x01).
|
static int |
SDTREADDIRECTION_RTL
Right-to-Left barcode reading direction flag (0x02).
|
static int |
SDTREADDIRECTION_TTB
Right-to-Left barcode reading direction flag (0x04).
|
Constructor and Description |
---|
BarcodeReader(java.lang.String licenseKey)
Creates a new BarcodeReader object
|
Modifier and Type | Method and Description |
---|---|
void |
finalize() |
BarcodeReaderResult |
getResultAt(int pos)
The method returns
BarcodeReaderResult object containg information about
successfully recognized barcode in the previous call to
readRGBImageBuffer(byte[] data, int width, int height, int bpp) ,
readBufferedImage(java.awt.image.BufferedImage buffImage) or
readFile(String path, int pageIndex) . |
int |
getResultsCount()
The method returns count of successfully recognized barcodes in the previous call to
readRGBImageBuffer(byte[] data, int width, int height, int bpp) |
int |
readBufferedImage(java.awt.image.BufferedImage buffImage)
The method reads a BufferedImage.
|
int |
readFile(java.lang.String path,
int pageIndex)
The method reads a image or pdf file.
|
int |
readRGBImageBuffer(byte[] data,
int width,
int height,
int bpp)
The method reads the image data from RGB image buffer allocated in memory.
|
void |
setActiveScanRectangle(int left,
int top,
int right,
int bottom)
The method defines the square area within the image where
the reader will look for barcodes in next call to
readRGBImageBuffer(byte[], int, int, int) . |
void |
setReadInputDirections(long dwFlags)
The method specifies barcode reading directions the Barcode Reader will use to scan the image in next call to
readRGBImageBuffer(byte[], int, int, int) . |
void |
setReadInputTypes(long dwFlags)
The method specifies barcode types the Barcode Reader will look for in next call to
readRGBImageBuffer(byte[], int, int, int) . |
public static int SDTBARCODE_UNKNOWN
public static int SDTBARCODE_CODABAR
public static int SDTBARCODE_CODE128
public static int SDTBARCODE_CODE32
public static int SDTBARCODE_CODE39
public static int SDTBARCODE_CODE93
public static int SDTBARCODE_CODE11
public static int SDTBARCODE_EAN13
public static int SDTBARCODE_EAN8
public static int SDTBARCODE_EAN5
public static int SDTBARCODE_I2OF5
public static int SDTBARCODE_PATCH_CODE
public static int SDTBARCODE_POSTNET
public static int SDTBARCODE_PLUS2
public static int SDTBARCODE_PLUS5
public static int SDTBARCODE_UPCA
public static int SDTBARCODE_UPCB
public static int SDTBARCODE_MSI
public static int SDTBARCODE_UPCE
public static int SDTBARCODE_PHARMACODE
public static int SDTBARCODE_ALL_1D
public static int SDTBARCODE_INTELLIMAIL
public static int SDTBARCODE_DATAMATRIX
public static int SDTBARCODE_PDF417
public static int SDTBARCODE_QRCODE
public static int SDTBARCODE_ALL_2D
public static int SDTINPUT_FILETYPE_BMP
public static int SDTINPUT_FILETYPE_JPEG
public static int SDTINPUT_FILETYPE_PNG
public static int SDTINPUT_FILETYPE_TIFF
public static int SDTINPUT_FILETYPE_PDF
public static int SDTREADDIRECTION_LTR
public static int SDTREADDIRECTION_RTL
public static int SDTREADDIRECTION_TTB
public static int SDTREADDIRECTION_BTT
public static int SDTREADDIRECTION_ALL
public BarcodeReader(java.lang.String licenseKey)
licenseKey
- Developer License Keypublic void finalize()
finalize
in class java.lang.Object
public void setActiveScanRectangle(int left, int top, int right, int bottom)
readRGBImageBuffer(byte[], int, int, int)
.
If one of boundary values passed to the function exceeds input image size then image
boundary will be used instead.left
- [in] positive integer value specified left boundary of the scan area in pixelstop
- [in] positive integer value specified top boundary of the scan area in pixelsright
- [in] positive integer value specified right boundary of the scan area in pixelsbottom
- [in] positive integer value specified bottom boundary of the scan area in pixelspublic void setReadInputTypes(long dwFlags)
readRGBImageBuffer(byte[], int, int, int)
. By default the Barcode Reader look for all barcode types.dwFlags
- [in] Specifies barcode types the Barcode Reader will look for. This parameter can be one or combination
of the following values:
Value | Integer Value | Description |
---|---|---|
SDTBARCODE_CODABAR |
0x00000001 | Codabar barcode |
SDTBARCODE_CODE128 |
0x00000002 | Code 128 barcode |
SDTBARCODE_CODE32 |
0x00000004 | Code 32 (also known as Base 32, Pharma 32/39, and Italian Pharmacode) |
SDTBARCODE_CODE39 |
0x00000008 | Code 39 barcode |
SDTBARCODE_CODE93 |
0x00000010 | Code 93 barcode |
SDTBARCODE_CODE11 |
0x00000020 | Code 11 barcode |
SDTBARCODE_EAN13 |
0x00000040 | EAN13 barcode |
SDTBARCODE_EAN8 |
0x00000080 | EAN8 barcode |
SDTBARCODE_EAN5 |
0x00000100 | EAN5 barcode |
SDTBARCODE_I2OF5 |
0x00000200 | Interleaved 2 of 5 barcode |
SDTBARCODE_PATCH_CODE |
0x00000400 | Patch code barcode |
SDTBARCODE_POSTNET |
0x00000800 | Postnet barcode |
SDTBARCODE_PLUS2 |
0x00001000 | Plus2 (2-digit supplementals assoc. with EAN and UPC) |
SDTBARCODE_PLUS5 |
0x00002000 | Plus5 (5-digit supplementals assoc. with EAN and UPC) |
SDTBARCODE_UPCA |
0x00004000 | UPC-A barcode |
SDTBARCODE_UPCB |
0x00008000 | UPC-B barcode |
SDTBARCODE_MSI |
0x00100000 | MSI barcode |
SDTBARCODE_UPCE |
0x00200000 | UPC-E barcode |
SDTBARCODE_PHARMACODE |
0x00400000 | Pharmacode barcode |
SDTBARCODE_ALL_1D |
0x0070ffff | All above 1-D Barcodes currently supported by SD-TOOLKIT Barcode Reader SDK |
SDTBARCODE_INTELLIMAIL |
0x00010000 | Intelligent Mail barcode |
SDTBARCODE_DATAMATRIX |
0x00020000 | DataMatrix 2D Barcode |
SDTBARCODE_PDF417 |
0x00040000 | PDF417 2D Barcode |
SDTBARCODE_QRCODE |
0x00080000 | QR Code 2D Barcode |
SDTBARCODE_ALL_2D |
0x000f0000 | All above 2-D Barcodes currently supported by SD-TOOLKIT Barcode Reader SDK 2.1 |
public void setReadInputDirections(long dwFlags)
readRGBImageBuffer(byte[], int, int, int)
. By default the Barcode Reader look in all directions.dwFlags
- [in] Specifies barcode types the Barcode Reader will look for. This parameter can be one or combination
of the following values:
Value | Integer Value | Description |
---|---|---|
SDTREADDIRECTION_LTR |
0x00000001 | Left-to-Right. Corresponds to normally oriented barcodes. |
SDTREADDIRECTION_RTL |
0x00000002 | Right-to-Left. Corresponds to 180 degrees rotated barcodes. |
SDTREADDIRECTION_TTB |
0x00000004 | Top-to-Bottom. Corresponds to 90 degrees clock-wise rotated barcodes. |
SDTREADDIRECTION_BTT |
0x00000008 | Bottom-to-Top. Corresponds to 90 degrees counter-clock-wise rotated barcodes. |
SDTREADDIRECTION_ALL |
0x00000010 | All possible directions. |
public int readRGBImageBuffer(byte[] data, int width, int height, int bpp)
getResultAt(int pos)
.data
- [in] buffer allocated in memory and filled in with RGB or grayscale datawidth
- [in] image width in pixelsheight
- [in] image height in pixelsbpp
- [in] bits per pixels. The following values are supported: 32, 24, 16, 8(grayscale)public int readBufferedImage(java.awt.image.BufferedImage buffImage)
getResultAt(int pos)
.buffImage
- [in] buffered image containing image data to recognize barcodes on.public int readFile(java.lang.String path, int pageIndex)
getResultAt(int pos)
.path
- [in] path to file.pageIndex
- [in] index of page in multipage image. When nonexisting page index is passed method will return negative value.public int getResultsCount()
readRGBImageBuffer(byte[] data, int width, int height, int bpp)
public BarcodeReaderResult getResultAt(int pos)
BarcodeReaderResult
object containg information about
successfully recognized barcode in the previous call to
readRGBImageBuffer(byte[] data, int width, int height, int bpp)
,
readBufferedImage(java.awt.image.BufferedImage buffImage)
or
readFile(String path, int pageIndex)
.
The count of recognized and available barcodes can be obtained by call to
getResultsCount()
.BarcodeReaderResult
object or null.