com.cage.zxing4p3
Class ZXING4P

java.lang.Object
  extended by com.cage.zxing4p3.ZXING4P

public class ZXING4P
extends java.lang.Object

This library was created to integrate the open source ZXING barcode library with Processing.

By Rolf van Gelder :: http://rvg.cage.nl/ :: http://cagewebdev.com/ :: info@cagewebdev.com

Library page: http://cagewebdev.com/zxing4processing-processing-library/

v3.5 :: 07/29/2018
- New: decode 17 different types of barcodes (barcodeReader() method)
- Change: Most of the code has been rewritten
- decodeImage() changed to QRCodeReader()
- decodeMultipleQRCodes() changed to multipleQRCodeReader()

v3.4 :: 06/20/2018
- bug fixed for multiple codes position markers

v3.3 :: 04/14/2018
- Added Multi QRCode support
- New mothod: decodeMultipleQRCodes()
- New method: getPositionMarkers(i)

v3.2 :: 07/31/2016
- Removed deprecated method: 'decodeWeb()'
- Added a new method: 'version()'
- Several minor changes


v3.1 :: 07/21/2016
- Renamed the library to zxing4p3, a Processing 2.x/3.x compatible version
- New method: getPositionMarkers()

NOTE: Compiled with Java jdk1.6.0_45


Constructor Summary
ZXING4P()
          Constructor
 
Method Summary
 java.lang.String barcodeReader(processing.core.PImage img, boolean tryHarder)
          Decode a barcode from a PImage (scan for all supported barcodes types)
 java.lang.String barcodeReader(processing.core.PImage img, boolean tryHarder, java.util.ArrayList<java.lang.String> barCodeTypes)
          Decode a barcode from a PImage (scan for specific barcode types)
 java.lang.String decodeImage(boolean tryHarder, processing.core.PImage img)
          Decode the QRCode from a PImage - DEPRECATED, USE QRCodeReader INSTEAD
 java.lang.String[] decodeMultipleQRCodes(boolean tryHarder, processing.core.PImage img)
          Decode multiple QRCodes from a PImage - DEPRECATED, USE multipleQRCodeReader INSTEAD
 processing.core.PImage generateQRCode(java.lang.String content, int width, int height)
          Generates a QRCode PImage from a string
 java.lang.String getBarcodeFormat()
          Get the format of the latest detected barcode
 processing.core.PVector[] getPositionMarkers()
          Returns a PVector array with the position markers for the latest detected QRCode
 processing.core.PVector[] getPositionMarkers(int index)
          Returns a PVector array with the position markers for a specific QRCode
 java.lang.String[] multipleQRCodeReader(processing.core.PImage img, boolean tryHarder)
          Decode multiple QRCodes from a PImage
 java.lang.String QRCodeReader(processing.core.PImage img, boolean tryHarder)
          Decode the QRCode from a PImage
 void version()
          Displays version information of this library in the console
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZXING4P

public ZXING4P()
Constructor

Method Detail

QRCodeReader

public java.lang.String QRCodeReader(processing.core.PImage img,
                                     boolean tryHarder)
Decode the QRCode from a PImage

Parameters:
img - PImage containing the image to be examinded
tryHarder - if set to true, it tells the software to spend a little more time trying to decode the image
Returns:
String with the found QRCode (empty if nothing found)

decodeImage

public java.lang.String decodeImage(boolean tryHarder,
                                    processing.core.PImage img)
Decode the QRCode from a PImage - DEPRECATED, USE QRCodeReader INSTEAD

Parameters:
tryHarder - if set to true, it tells the software to spend a little more time trying to decode the image
img - PImage containing the image to be examinded
Returns:
String with the found QRCode (empty if nothing found)

multipleQRCodeReader

public java.lang.String[] multipleQRCodeReader(processing.core.PImage img,
                                               boolean tryHarder)
Decode multiple QRCodes from a PImage

Parameters:
img - PImage containing the image to be examinded
tryHarder - if set to true, it tells the software to spend a little more time trying to decode the image
Returns:
String array with the found QRCode(s) (null if nothing found)

decodeMultipleQRCodes

public java.lang.String[] decodeMultipleQRCodes(boolean tryHarder,
                                                processing.core.PImage img)
Decode multiple QRCodes from a PImage - DEPRECATED, USE multipleQRCodeReader INSTEAD

Parameters:
tryHarder - if set to true, it tells the software to spend a little more time trying to decode the image
img - PImage containing the image to be examinded
Returns:
String array with the found QRCode(s) (null if nothing found)

getBarcodeFormat

public java.lang.String getBarcodeFormat()
Get the format of the latest detected barcode

Returns:
format of the latest detected barcode

barcodeReader

public java.lang.String barcodeReader(processing.core.PImage img,
                                      boolean tryHarder)
Decode a barcode from a PImage (scan for all supported barcodes types)

Parameters:
img - PImage containing the image to be examinded
tryHarder - if set to true, it tells the software to spend a little more time trying to decode the image
Returns:
String with the found QRCode (empty if nothing found)

barcodeReader

public java.lang.String barcodeReader(processing.core.PImage img,
                                      boolean tryHarder,
                                      java.util.ArrayList<java.lang.String> barCodeTypes)
Decode a barcode from a PImage (scan for specific barcode types)

Parameters:
img - PImage containing the image to be examinded
tryHarder - if set to true, it tells the software to spend a little more time trying to decode the image
barCodeTypes - barcode types to scan for
Returns:
String with the found barcode (empty if nothing found) https://zxing.github.io/zxing/apidocs/com/google/zxing/BarcodeFormat.html SUPPORTED BARCODE TYPES: AZTEC CODABAR CODE_128 CODE_39 CODE_93 DATA_MATRIX EAN_13 EAN_8 ITF MAXICODE PDF_417 QR_CODE RSS_14 RSS_EXPANDED UPC_A UPC_E UPC_EAN_EXTENSION

generateQRCode

public processing.core.PImage generateQRCode(java.lang.String content,
                                             int width,
                                             int height)
Generates a QRCode PImage from a string

Parameters:
content - string to encode
width - width of the PImage that will be returned
height - height of the PImage that will be returned
Returns:
PImage with the QRCode image

getPositionMarkers

public processing.core.PVector[] getPositionMarkers()
Returns a PVector array with the position markers for the latest detected QRCode

Returns:
PVector with the position markers for the latest detected QRCode

getPositionMarkers

public processing.core.PVector[] getPositionMarkers(int index)
Returns a PVector array with the position markers for a specific QRCode

Parameters:
index - index of the detected QRCode
Returns:
PVector with the position markers for the detected QRCode

version

public void version()
Displays version information of this library in the console