Recognition.js

const fs = require("fs");
const java = require('java');
const joint = require("./Joint");
const {Rectangle} = require("./Joint");

/**
 * BarCodeReader encapsulates an image which may contain one or several barcodes, it then can perform ReadBarCodes operation to detect barcodes.
 * @example
 * //This sample shows how to detect Code39 and Code128 barcodes.
 * let reader = new BarCodeReader("test.png", null,  [DecodeType.CODE_39_STANDARD, DecodeType.CODE_128]);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode Type: " + result.getCodeTypeName());
 *    console.log("BarCode CodeText: " + result.getCodeText());
 * });
 */
class BarCodeReader extends joint.BaseJavaClass
{
    qualitySettings;
    recognizedResults;
    barcodeSettings;

    static get javaClassName()
    {
        return "com.aspose.mw.barcode.recognition.MwBarCodeReader";
    }

    /**
     * Initializes a new instance of the BarCodeReader<br>
     * @param image encoded as base64 string or path to image
     * @param rectangles array of object by type Rectangle
     * @param decodeTypes the array of objects by DecodeType
     */
    constructor(image, rectangles, decodeTypes)
    {
        if (image != null)
        {
            if (joint.isPath(image))
            {
                image = joint.convertResourceToBase64String(image);
            }
        }
        if (rectangles != null)
        {
            if (!Array.isArray(rectangles))
            {
                rectangles = [rectangles];
            }
            for (let i = 0; i < rectangles.length; i++)
            {
                if(!(rectangles[i] instanceof Rectangle))
                    throw new Error("Invalid arguments");
                rectangles[i] = rectangles[i].toString();
            }
        }
        if (decodeTypes === undefined || decodeTypes == null)
        {
            decodeTypes = DecodeType.ALL_SUPPORTED_TYPES
        }
        if (!Array.isArray(decodeTypes))
        {
            decodeTypes = [decodeTypes];
        }
        for (let i = 0; i < decodeTypes.length; i++)
        {
            decodeTypes[i] = decodeTypes[i] + "";
        }
        try
        {
            let java_class_link = new java.import(BarCodeReader.javaClassName);
            let java_class = null;
            if (image == null && rectangles == null && image == null)
            {
                java_class = new java_class_link();
            }
            else
            {
                java_class = new java_class_link(image, rectangles, decodeTypes);
            }
            super(java_class);
            this.init()
        } catch (e)
        {
            console.error("Invalid arguments");
            throw e;
        }
    }

    static construct(javaClass)
    {
        let barcodeReader = new BarCodeReader(null, null, null);
        barcodeReader.setJavaClass(javaClass);
        return barcodeReader;
    }

    /**
     * Determines whether any of the given decode types is included into<br>
     * @param ...decodeTypes Types to verify.
     * @return bool Value is a true if any types are included into.
     */
    containsAny(...decodeTypes)
    {
        for (let i = 0; i < decodeTypes.length; i++)
        {
            decodeTypes[i] = decodeTypes[i] + "";
        }
        return this.getJavaClass().containsAnySync(decodeTypes);
    }

    /**
     * internal
     */
    static convertToString(arg)
    {
        if (is_int(arg))
        {
            return strval(arg);
        }
        else if (arg instanceof Rectangle)
        {
            return "{[" + arg.toString() + "]}";
        }
        else if (is_array(arg))
        {
            let areasString = "{";

            for (let i = 0; i < sizeof(arg); i++)
            {
                areasString += "[" + arg[i].toString() + "]";
            }

            areasString += "}";

            return areasString;
        }
        else
        {
            return arg;
        }
    }

    init()
    {
        this.qualitySettings = new QualitySettings(this.getJavaClass().getQualitySettingsSync());
        this.barcodeSettings = BarcodeSettings.construct(this.getJavaClass().getBarcodeSettingsSync());
    }

    /**
     * Gets the timeout of recognition process in milliseconds.<br>
     * @example
     * let reader = new BarCodeReader("test.png", null, null);
     * reader.setTimeout(5000);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *    console.log("BarCode CodeText: " + result.getCodeText());
     * });
     * @return The timeout.
     */
    getTimeout()
    {
        return this.getJavaClass().getTimeoutSync();
    }

    /**
     * Sets the timeout of recognition process in milliseconds.
     *@example
     * let reader = new BarCodeReader("test.png", null, null);
     * reader.setTimeout(5000);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *    console.log("BarCode CodeText: " + result.getCodeText());
     * });
     * @param value The timeout.
     */
    setTimeout(value)
    {
        this.getJavaClass().setTimeoutSync(value);
    }

    abort()
    {
        this.getJavaClass().abortSync();
    }

    /**
     * Gets recognized BarCodeResult array
     * @example
     * //This sample shows how to read barcodes with BarCodeReader
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * reader.readBarCodes();
     * for(let i = 0; reader.getFoundCount() > i; ++i)
     *    console.log("BarCode CodeText: " +  reader.getFoundBarCodes()[i].getCodeText());
     *
     * @return recognized BarCodeResult array
     */
    getFoundBarCodes()
    {
        return this.recognizedResults;
    }

    /**
     * Gets recognized barcodes count
     * @example
     * //This sample shows how to read barcodes with BarCodeReader
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * reader.readBarCodes();
     * for(let i = 0; reader.getFoundCount() > i; ++i)
     *    console.log("BarCode CodeText: " + reader.getFoundBarCodes()[i].getCodeText());
     * Value: The recognized barcodes count
     */
    getFoundCount()
    {
        return this.getJavaClass().getFoundCountSync();
    }

    /**
     * Reads BarCodeResult from the image.
     * @example
     * //This sample shows how to read barcodes with BarCodeReader
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *    console.log("BarCode CodeText: " + result.getCodeText());
     * });
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * reader.readBarCodes();
     * for(let i = 0; reader.getFoundCount() > i; ++i)
     *    console.log("BarCode CodeText: " + reader.getFoundBarCodes()[i].getCodeText());
     * @return Returns array of recognized {@code BarCodeResult}s on the image. If nothing is recognized, zero array is returned.
     */
    readBarCodes()
    {
        try
        {
            this.recognizedResults = [];
            let javaReadBarcodes = this.getJavaClass().readBarCodesSync();
            for (let i = 0; i < javaReadBarcodes.length; i++)
            {
                this.recognizedResults[i] = new BarCodeResult(javaReadBarcodes[i]);
            }
            return this.recognizedResults;
        } catch (e)
        {
            if ((e.toString().includes("RecognitionAbortedException")))
            {
                throw new RecognitionAbortedException(e.toString(), null);
            }
            throw e;
        }
    }

    /**
     * QualitySettings allows to configure recognition quality and speed manually.<br>
     * You can quickly set up QualitySettings by embedded presets: HighPerformance, NormalQuality,<br>
     * HighQuality, MaxBarCodes or you can manually configure separate options.<br>
     * Default value of QualitySettings is NormalQuality.<br>
     * @return QualitySettings to configure recognition quality and speed.
     *
     * @example
     * //This sample shows how to use QualitySettings with BarCodeReader
     *
     * let reader = new BarCodeReader("test.png", null, null);
     *  //set high performance mode
     * reader.setQualitySettings(QualitySettings.getHighPerformance());
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *   console.log("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @example
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * //normal quality mode is set by default
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *   console.log("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @example
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * //set high performance mode
     * reader.setQualitySettings(QualitySettings.getHighPerformance());
     * //set separate options
     * reader.getQualitySettings().setAllowMedianSmoothing(true);
     * reader.getQualitySettings().setMedianSmoothingWindowSize(5);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *   console.log("BarCode CodeText: " + result.getCodeText());
     * });
     */
    getQualitySettings()
    {
        return this.qualitySettings;
    }

    /**
     * QualitySettings allows to configure recognition quality and speed manually.<br>
     * You can quickly set up QualitySettings by embedded presets: HighPerformance, NormalQuality,<br>
     * HighQuality, MaxBarCodes or you can manually configure separate options.<br>
     * Default value of QualitySettings is NormalQuality.
     *
     * @example
     * //This sample shows how to use QualitySettings with BarCodeReader
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * //set high performance mode
     * reader.setQualitySettings(QualitySettings.getHighPerformance());
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *   console.log("BarCode CodeText: " + result.getCodeText());
     * });
     * @example
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * //normal quality mode is set by default
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *   console.log("BarCode CodeText: " + result.getCodeText());
     * });
     * @example
     * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     *  //set high performance mode
     * reader.setQualitySettings(QualitySettings.getHighPerformance());
     * //set separate options
     * reader.getQualitySettings().setAllowMedianSmoothing(true);
     * reader.getQualitySettings().setMedianSmoothingWindowSize(5);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *   console.log("BarCode CodeText: " + result.getCodeText());
     * });
     * QualitySettings to configure recognition quality and speed.
     */
    setQualitySettings(value)
    {
        this.getJavaClass().setQualitySettingsSync(value.getJavaClass());
    }

    /**
     * The main BarCode decoding parameters. Contains parameters which make influence on recognized data.
     * @return The main BarCode decoding parameters
     */
    getBarcodeSettings()
    {
        return this.barcodeSettings;
    }

    /**
     * Sets bitmap image and areas for recognition.<br>
     * Must be called before ReadBarCodes() method.
     * @example
     * //This sample shows how to detect Code39 and Code128 barcodes.
     * let bmp = "test.png";
     * let reader = new BarCodeReader();
     * reader.setBarCodeReadType([ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * var img = new Image();
     * img.src = 'path_to_image';
     * width = img.width;
     * height = img.height;
     * reader.setBarCodeImage(bmp, new Rectangle[] { new Rectangle(0, 0, width, height) });
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *    console.log("BarCode Type: " + result.getCodeTypeName());
     *    console.log("BarCode CodeText: " + result.getCodeText());
     * });
     * @param value The bitmap image for recognition.
     * @param areas areas list for recognition
     * @throws BarcodeException
     */
    setBarCodeImage(image, ...areas)
    {
        image = joint.convertResourceToBase64String(image);
        let stringAreas = [];
        let isAllRectanglesNotNull = false;
        if (!(areas == null) && areas.length > 0)
        {
            for (let i = 0; i < areas.length; i++)
            {
                if (!(areas[i] == null))
                {
                    isAllRectanglesNotNull |= true;
                    stringAreas[i] = areas[i].toString();
                }
            }
            if (!isAllRectanglesNotNull)
            {
                stringAreas = [];
            }
        }
        if (stringAreas.length == 0)
        {
            this.getJavaClass().setBarCodeImageSync(image);
        }
        else
        {
            this.getJavaClass().setBarCodeImageSync(image, stringAreas);
        }
    }

    /**
     * Sets SingleDecodeType type array for recognition.<br>
     * Must be called before readBarCodes() method.
     * @example
     * //This sample shows how to detect Code39 and Code128 barcodes.
     * let reader = new BarCodeReader();
     * reader.setBarCodeReadType([ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
     * reader.setBarCodeImage("test.png");
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log("BarCode Type: " + result.getCodeTypeName());
     *     console.log("BarCode CodeText: " + result.getCodeText());
     * });
     * @param types The SingleDecodeType type array to read.
     */
    setBarCodeReadType(...types)
    {
        for (let i = 0; i < types.length; i++)
        {
            types[i] = types[i] + "";
        }
        this.getJavaClass().setBarCodeReadTypeSync(types);
    }

    /**
     * Gets the decode type of the input barcode decoding
     * @returns {*}
     */
    getBarCodeDecodeType()
    {
        return this.getJavaClass().getBarCodeDecodeTypeSync();
    }

    /**
     * Exports BarCode properties to the xml-file specified<br>
     * @param xmlFile The name of  the file<br>
     * @return Whether or not export completed successfully.<br>
     * Returns True in case of success; False Otherwise
     */
    exportToXml(xmlFile)
    {
        try
        {
            let xmlData = this.getJavaClass().exportToXmlSync();
            let isSaved = xmlData != null;
            if (isSaved)
            {
                fs.writeFileSync(xmlFile, xmlData);
            }
            return isSaved;
        } catch (ex)
        {
            let barcode_exception = new joint.BarcodeException(ex);
            throw barcode_exception;
        }
    }

    /**
     * Exports BarCode properties to the xml-file specified<br>
     * @param xmlFile The name of  the file<br>
     * @return Whether or not export completed successfully. Returns True in case of success; False Otherwise
     */
    static importFromXml(xmlFile)
    {
        try
        {
            let xmlData = fs.readFileSync(xmlFile).toString();
            let java_class_link = new java.import(BarCodeReader.javaClassName);
            return BarCodeReader.construct(java_class_link.importFromXmlSync(xmlData.substring(3, xmlData.length)));
        } catch (ex)
        {
            let barcode_exception = new joint.BarcodeException(ex);
            throw barcode_exception;
        }
    }
}

/**
 * Stores a set of four Points that represent a Quadrangle region.
 */
class Quadrangle extends joint.BaseJavaClass
{
    static get javaClassName()
    {
        return "com.aspose.mw.barcode.recognition.MwQuadrangle";
    }

    leftTop;
    rightTop;
    rightBottom;
    leftBottom;

    /**
     * Represents a Quadrangle structure with its properties left uninitialized.Value: Quadrangle
     */
    static get EMPTY()
    {
        return new Quadrangle(new joint.Point(0, 0), new joint.Point(0, 0), new joint.Point(0, 0), new joint.Point(0, 0));
    }

    static construct(...args)
    {
        let quadrangle = Quadrangle.EMPTY;
        quadrangle.setJavaClass(args[0]);
        return quadrangle;
    }


    /**
     * Initializes a new instance of the Quadrangle structure with the describing points.
     *
     * @param leftTop A Point that represents the left-top corner of the Quadrangle.
     * @param rightTop A Point that represents the right-top corner of the Quadrangle.
     * @param rightBottom A Point that represents the right-bottom corner of the Quadrangle.
     * @param leftBottom A Point that represents the left-bottom corner of the Quadrangle.
     */
    constructor(leftTop, rightTop, rightBottom, leftBottom)
    {
        let java_link = java.import(Quadrangle.javaClassName);
        let javaClass = new java_link(leftTop.getJavaClass(), rightTop.getJavaClass(), rightBottom.getJavaClass(), leftBottom.getJavaClass());
        super(javaClass);
        this.init();
    }

    init()
    {
        this.leftTop = joint.Point.construct(this.getJavaClass().getLeftTopSync());
        this.rightTop = joint.Point.construct(this.getJavaClass().getRightTopSync());
        this.rightBottom = joint.Point.construct(this.getJavaClass().getRightBottomSync());
        this.leftBottom = joint.Point.construct(this.getJavaClass().getLeftBottomSync());
    }

    /**
     * Gets left-top corner Point of Quadrangle regionValue: A left-top corner Point of Quadrangle region
     */
    getLeftTop()
    {
        return this.leftTop;
    }

    /**
     * Sets left-top corner Point of Quadrangle regionValue: A left-top corner Point of Quadrangle region
     */
    setLeftTop(value)
    {
        this.leftTop = value;
        this.getJavaClass().setLeftTopSync(value.getJavaClass());
    }

    /**
     * Gets right-top corner Point of Quadrangle regionValue: A right-top corner Point of Quadrangle region
     */
    getRightTop()
    {
        return this.rightTop;
    }

    /**
     * Sets right-top corner Point of Quadrangle regionValue: A right-top corner Point of Quadrangle region
     */
    setRightTop(value)
    {
        this.rightTop = value;
        this.getJavaClass().setRightTopSync(value.getJavaClass());
    }

    /**
     * Gets right-bottom corner Point of Quadrangle regionValue: A right-bottom corner Point of Quadrangle region
     */
    getRightBottom()
    {
        return this.rightBottom;
    }

    /**
     * Sets right-bottom corner Point of Quadrangle regionValue: A right-bottom corner Point of Quadrangle region
     */
    setRightBottom(value)
    {
        this.rightBottom = value;
        this.getJavaClass().setRightBottomSync(value.getJavaClass());
    }

    /**
     * Gets left-bottom corner Point of Quadrangle regionValue: A left-bottom corner Point of Quadrangle region
     */
    getLeftBottom()
    {
        return this.leftBottom;
    }

    /**
     * Sets left-bottom corner Point of Quadrangle regionValue: A left-bottom corner Point of Quadrangle region
     */
    setLeftBottom(value)
    {
        this.leftBottom = value;
        this.getJavaClass().setLeftBottomSync(value.getJavaClass());
    }

    /**
     * Tests whether all Points of this Quadrangle have values of zero.Value: Returns true if all Points of this Quadrangle have values of zero; otherwise, false.
     */
    isEmpty()
    {
        return this.getJavaClass().isEmptySync();
    }

    /**
     * Determines if the specified Point is contained within this Quadrangle structure.
     *
     * @param pt The Point to test.
     * @return true if Point is contained within this Quadrangle structure; otherwise, false.
     */
    contains(pt)
    {
        return this.getJavaClass().containsSync(pt.getJavaClass());
    }

    /**
     * Determines if the specified point is contained within this Quadrangle structure.
     *
     * @param x The x point cordinate.
     * @param y The y point cordinate.
     * @return Returns true if point is contained within this Quadrangle structure; otherwise, false.
     */
    containsPoint(x, y)
    {
        return this.getJavaClass().containsSync(x, y);
    }

    /**
     * Determines if the specified Quadrangle is contained or intersect this Quadrangle structure.
     *
     * @param quad The Quadrangle to test.
     * @return Returns true if Quadrangle is contained or intersect this Quadrangle structure; otherwise, false.
     */
    containsQuadrangle(quad)
    {
        return this.getJavaClass().containsSync(quad.getJavaClass());
    }

    /**
     * Determines if the specified Rectangle is contained or intersect this Quadrangle structure.
     *
     * @param rect The Rectangle to test.
     * @return Returns true if Rectangle is contained or intersect this Quadrangle structure; otherwise, false.
     */
    containsRectangle(rect)
    {
        return this.getJavaClass().containsSync(rect.getJavaClass());
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified Quadrangle value.
     *
     * @param other An Quadrangle value to compare to this instance.
     * @return true if obj has the same value as this instance; otherwise, false.
     */
    equals(other)
    {
        return this.getJavaClass().equalsSync(other.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this Quadrangle.
     *
     * @return A string that represents this Quadrangle.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }

    /**
     * Creates Rectangle bounding this Quadrangle
     *
     * @return returns Rectangle bounding this Quadrangle
     */
    getBoundingRectangle()
    {
        return joint.Rectangle.construct(this.getJavaClass().getBoundingRectangleSync());
    }
}

/**
 * Stores a QR Structured Append information of recognized barcode
 * @example
 * //This sample shows how to get QR Structured Append data
 *
 * let reader = new BarCodeReader("test.png", null,  DecodeType.QR);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode Type: " + result.getCodeTypeName());
 *    console.log("BarCode CodeText: " + result.getCodeText());
 *    console.log("QR Structured Append Quantity: " + result.getExtended().getQR().getQRStructuredAppendModeBarCodesQuantity());
 *    console.log("QR Structured Append Index: " + result.getExtended().getQR().getQRStructuredAppendModeBarCodeIndex());
 *    console.log("QR Structured Append ParityData: " + result.getExtended().getQR().getQRStructuredAppendModeParityData());
 * });
 */
class QRExtendedParameters extends joint.BaseJavaClass
{
    constructor(javaclass)
    {
        super(javaclass);
        this.init()
    }

    init()
    {
    }

    /**
     * Gets the QR structured append mode barcodes quantity. Default value is -1.Value: The quantity of the QR structured append mode barcode.
     */
    getQRStructuredAppendModeBarCodesQuantity()
    {
        return this.getJavaClass().getQRStructuredAppendModeBarCodesQuantitySync();
    }

    /**
     * Gets the index of the QR structured append mode barcode. Index starts from 0. Default value is -1.Value: The quantity of the QR structured append mode barcode.
     */
    getQRStructuredAppendModeBarCodeIndex()
    {
        return this.getJavaClass().getQRStructuredAppendModeBarCodeIndexSync();
    }

    /**
     * Gets the QR structured append mode parity data. Default value is -1.Value: The index of the QR structured append mode barcode.
     */
    getQRStructuredAppendModeParityData()
    {
        return this.getJavaClass().getQRStructuredAppendModeParityDataSync();
    }
    /**
     * <p>Tests whether all parameters has only default values</p>Value
     * @returns <b>true</b> if all parameters has only default values; otherwise, {@code <b>false</b>}.
     */
    isEmpty()
    {
        return this.getJavaClass().isEmptySync();
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified QRExtendedParameters value.
     *
     * @param obj An object value to compare to this instance.
     * @return true if obj has the same value as this instance; otherwise, false.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this QRExtendedParameters.
     *
     * @return A string that represents this QRExtendedParameters.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * Stores a MacroPdf417 metadata information of recognized barcode
 * @example
 * //This sample shows how to get Macro Pdf417 metadata
 * let generator = new BarcodeGenerator(EncodeTypes.MacroPdf417, "12345");
 * generator.getParameters().getBarcode().getPdf417().setPdf417MacroFileID(10);
 * generator.getParameters().getBarcode().getPdf417().setPdf417MacroSegmentsCount(2);
 * generator.getParameters().getBarcode().getPdf417().setPdf417MacroSegmentID(1);
 * generator.save("test.png");
 * let reader = new BarCodeReader("test.png", null,  DecodeType.MACRO_PDF_417);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *     console.log("BarCode Type: " + result.getCodeTypeName());
 *     console.log("BarCode CodeText: " + result.getCodeText());
 *     console.log("Macro Pdf417 FileID: " + result.getExtended().getPdf417().getMacroPdf417FileID());
 *     console.log("Macro Pdf417 Segments: " + result.getExtended().getPdf417().getMacroPdf417SegmentsCount());
 *     console.log("Macro Pdf417 SegmentID: " + result.getExtended().getPdf417().getMacroPdf417SegmentID());
 * });
 */
class Pdf417ExtendedParameters extends joint.BaseJavaClass
{
    constructor(javaclass)
    {
        super(javaclass);
        this.init()
    }

    init()
    {
    }

    /**
     * Gets the file ID of the barcode, only available with MacroPdf417.Value: The file ID for MacroPdf417
     */
    getMacroPdf417FileID()
    {
        return this.getJavaClass().getMacroPdf417FileIDSync();
    }

    /**
     * Gets the segment ID of the barcode,only available with MacroPdf417.Value: The segment ID of the barcode.
     */
    getMacroPdf417SegmentID()
    {
        return this.getJavaClass().getMacroPdf417SegmentIDSync();
    }

    /**
     * Gets macro pdf417 barcode segments count. Default value is -1.Value: Segments count.
     */
    getMacroPdf417SegmentsCount()
    {
        return this.getJavaClass().getMacroPdf417SegmentsCountSync();
    }

    /**
     * Macro PDF417 file name (optional).
     * @return File name.
     */
    getMacroPdf417FileName()
    {
        return this.getJavaClass().getMacroPdf417FileNameSync();
    }

    /**
     * Macro PDF417 file size (optional).
     * @return File size.
     */
    getMacroPdf417FileSize()
    {
        return this.getJavaClass().getMacroPdf417FileSizeSync();
    }

    /**
     * Macro PDF417 sender name (optional).
     * @return Sender name
     */
    getMacroPdf417Sender()
    {
        return this.getJavaClass().getMacroPdf417SenderSync();
    }

    /**
     * Macro PDF417 addressee name (optional).
     * @return Addressee name.
     */
    getMacroPdf417Addressee()
    {
        return this.getJavaClass().getMacroPdf417AddresseeSync();
    }

    /**
     * Macro PDF417 time stamp (optional).
     * @return Time stamp.
     */
    getMacroPdf417TimeStamp()
    {
        return new Date(this.getJavaClass().getMacroPdf417TimeStampSync() * 1000);
    }

    /**
     * Macro PDF417 checksum (optional).
     * @return Checksum.
     */
    getMacroPdf417Checksum()
    {
        return this.getJavaClass().getMacroPdf417ChecksumSync();
    }

    /**
     * <p>Used to instruct the reader to interpret the data contained within the symbol as programming for reader initialization.</p>
     * @return Reader initialization flag
     */
    getMacroPdf417Terminator()
    {
        return this.getJavaClass().getMacroPdf417TerminatorSync();
    }

    /**
     * <p>
     * Used to instruct the reader to interpret the data contained within the symbol as programming for reader initialization.
     * </p>
     *
     * @return Reader initialization flag
     */
    isReaderInitialization()
    {
        return this.getJavaClass().isReaderInitializationSync();
    }

    /**
     * <p>Flag that indicates that the barcode must be linked to 1D barcode.</p>Value: Linkage flag
     */
    isLinked()
    {
        return this.getJavaClass().isLinkedSync();
    }

    /**
     * Flag that indicates that the MicroPdf417 barcode encoded with 908, 909, 910 or 911 Code 128 emulation codewords.
     * @return Code 128 emulation flag
     */
    isCode128Emulation()
    {
        return this.getJavaClass().isCode128EmulationSync();
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified Pdf417ExtendedParameters value.
     *
     * @param obj An System.Object value to compare to this instance.
     * @return true if obj has the same value as this instance; otherwise, false.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this Pdf417ExtendedParameters.
     *
     * @return A string that represents this Pdf417ExtendedParameters.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * Stores special data of 1D recognized barcode like separate codetext and checksum
 * @example
 * //This sample shows how to get 1D barcode value and checksum
 * let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
 * generator.save("test.png");
 * let reader = new BarCodeReader("test.png", null,  DecodeType.EAN_13);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode Type: " + result.getCodeTypeName());
 *    console.log("BarCode CodeText: " + result.getCodeText());
 *    console.log("BarCode Value: " + result.getExtended().getOneD().getValue());
 *    console.log("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
 * });
 */
class OneDExtendedParameters extends joint.BaseJavaClass
{
    constructor(javaclass)
    {
        super(javaclass);
        this.init()
    }

    init()
    {
    }

    /**
     * Gets the codetext of 1D barcodes without checksum. Value: The codetext of 1D barcodes without checksum.
     */
    getValue()
    {
        return this.getJavaClass().getValueSync();
    }

    /**
     * Gets the checksum for 1D barcodes. Value: The checksum for 1D barcode.
     */
    getCheckSum()
    {
        return this.getJavaClass().getCheckSumSync();
    }

    /**
     * Tests whether all parameters has only default values
     * Value: Returns {@code <b>true</b>} if all parameters has only default values; otherwise, {@code <b>false</b>}.
     */
    isEmpty()
    {
        return this.getJavaClass().isEmptySync();
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified OneDExtendedParameters value.
     *
     * @param obj An System.Object value to compare to this instance.
     * @return true if obj has the same value as this instance; otherwise, false.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this OneDExtendedParameters.
     *
     * @return A string that represents this OneDExtendedParameters.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * Stores special data of Code128 recognized barcode<br>
 * Represents the recognized barcode's region and barcode angle
 * @example
 * //This sample shows how to get code128 raw values
 * let generator = new BarcodeGenerator(EncodeTypes.Code128, "12345");
 * generator.save("test.png");
 * let reader = new BarCodeReader("test.png", null,  DecodeType.CODE_128);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode Type: " + result.getCodeTypeName());
 *    console.log("BarCode CodeText: " + result.getCodeText());
 *    console.log("Code128 Data Portions: " + result.getExtended().getCode128());
 * });
 */
class Code128ExtendedParameters extends joint.BaseJavaClass
{
    code128DataPortions;

    constructor(javaclass)
    {
        super(javaclass);
        this.init()
    }

    init()
    {
        this.code128DataPortions = Code128ExtendedParameters.convertCode128DataPortions(this.getJavaClass().getCode128DataPortionsSync());
    }

    static convertCode128DataPortions(javaCode128DataPortions)
    {
        let code128DataPortionsValues = javaCode128DataPortions;
        let code128DataPortions = [];
        for (let i = 0; i < code128DataPortionsValues.length; i++)
        {
            code128DataPortions[i] = Code128DataPortion.construct(code128DataPortionsValues[i]);
        }
        return code128DataPortions;
    }

    /**
     *  Gets Code128DataPortion array of recognized Code128 barcode Value of the Code128DataPortion.
     */
    getCode128DataPortions()
    {
        return this.code128DataPortions;
    }

    isEmpty()
    {
        return this.getJavaClass().isEmptySync();
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified Code128ExtendedParameters value.
     *
     * @param obj An System.Object value to compare to this instance.
     * @return true if obj has the same value as this instance; otherwise, false.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this Code128ExtendedParameters.
     *
     * @return A string that represents this Code128ExtendedParameters.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * Stores recognized barcode data like SingleDecodeType type, {@code string} codetext,<br>
 * BarCodeRegionParameters region and other parameters
 * @example
 * //This sample shows how to obtain BarCodeResult.
 * let generator = new BarcodeGenerator(EncodeTypes.Code128, "12345");
 * generator.save("test.png");
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *     console.log("BarCode Type: " + result.getCodeTypeName());
 *     console.log("BarCode CodeText: " + result.getCodeText());
 *     console.log("BarCode Confidence: " + result.getConfidence());
 *     console.log("BarCode ReadingQuality: " + result.getReadingQuality());
 *     console.log("BarCode Angle: " + result.getRegion().getAngle());
 * });
 */
class BarCodeResult extends joint.BaseJavaClass
{
    region;
    extended;

    constructor(javaclass)
    {
        super(javaclass);
        this.init()
    }

    init()
    {
        this.region = new BarCodeRegionParameters(this.getJavaClass().getRegionSync());
        this.extended = new BarCodeExtendedParameters(this.getJavaClass().getExtendedSync());
    }

    /**
     *  Gets the reading quality. Works for 1D and postal barcodes. Value: The reading quality percent
     */
    getReadingQuality()
    {
        return this.getJavaClass().getReadingQualitySync();
    }

    /**
     *  Gets recognition confidence level of the recognized barcode Value: <br>
     *  BarCodeConfidence.Strong does not have fakes or misrecognitions, BarCodeConfidence.Moderate<br>
     * could sometimes have fakes or incorrect codetext because this confidence level for barcodews with weak cheksum or even without it,<br>
     * BarCodeConfidence.NONE always has incorrect codetext and could be fake recognitions
     */
    getConfidence()
    {
        return this.getJavaClass().getConfidenceSync();
    }

    /**
     *  Gets the code text Value: The code text of the barcode
     */
    getCodeText()
    {
        return this.getJavaClass().getCodeTextSync();
    }

    /**
     *  Gets the encoded code bytes Value: The code bytes of the barcode
     */
    getCodeBytes()
    {
        let str = this.getJavaClass().getCodeBytesSync();
        return str.split(",");
    }

    /**
     *  Gets the barcode type Value: The type information of the recognized barcode
     */
    getCodeType()
    {
        return this.getJavaClass().getCodeTypeSync();
    }

    /**
     *  Gets the name of the barcode type Value: The type name of the recognized barcode
     */
    getCodeTypeName()
    {
        return this.getJavaClass().getCodeTypeNameSync();
    }

    /**
     *  Gets the barcode region Value: The region of the recognized barcode
     */
    getRegion()
    {
        return this.region;
    }

    /**
     *  Gets extended parameters of recognized barcode Value: The extended parameters of recognized barcode
     */
    getExtended()
    {
        return this.extended;
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified BarCodeResult value.
     *
     * @param other An BarCodeResult value to compare to this instance.
     * @return true if obj has the same value as this instance; otherwise, false.
     */
    equals(other)
    {
        return this.getJavaClass().equalsSync(other.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this BarCodeResult.
     *
     * @return A string that represents this BarCodeResult.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }

    /**
     * Creates a copy of BarCodeResult class.
     *
     * @return Returns copy of BarCodeResult class.
     */
    deepClone()
    {
        return new BarCodeResult(this);
    }
}

/**
 * Represents the recognized barcode's region and barcode angle
 * @example
 * //This sample shows how to get barcode Angle and bounding quadrangle values
 * let generator = new BarcodeGenerator(EncodeTypes.Code128, "12345");
 * generator.save("test.png");
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode CodeText: " + result.getCodeText());
 *    console.log("BarCode Angle: " + result.getRegion().getAngle());
 *    console.log("BarCode Quadrangle: " + result.getRegion().getQuadrangle());
 * });
 */
class BarCodeRegionParameters extends joint.BaseJavaClass
{
    quad;
    rect;
    points;

    constructor(javaclass)
    {
        super(javaclass);
        this.init()
    }

    init()
    {
        this.quad = Quadrangle.construct(this.getJavaClass().getQuadrangleSync());
        this.rect = joint.Rectangle.construct(this.getJavaClass().getRectangleSync());
        this.points = BarCodeRegionParameters.convertJavaPoints(this.getJavaClass().getPointsSync());
    }

    static convertJavaPoints(javaPoints)
    {
        let points = [];
        for (let i = 0; i < javaPoints.length; i++)
        {
            points[i] = new joint.Point(javaPoints[i].getXSync(), javaPoints[i].getYSync());
        }

        return points;
    }

    /**
     *  Gets Quadrangle bounding barcode region Value: Returns Quadrangle bounding barcode region
     */
    getQuadrangle()
    {
        return this.quad;
    }

    /**
     *  Gets the angle of the barcode (0-360). Value: The angle for barcode (0-360).
     */
    getAngle()
    {
        return this.getJavaClass().getAngleSync();
    }

    /**
     *  Gets Points array bounding barcode region Value: Returns Points array bounding barcode region
     */
    getPoints()
    {
        return this.points;
    }

    /**
     *  Gets Rectangle bounding barcode region Value: Returns Rectangle bounding barcode region
     */
    getRectangle()
    {
        return this.rect;
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified BarCodeRegionParameters value.<br>
     *
     * @param obj An System.Object value to compare to this instance.<br>
     * @return true if obj has the same value as this instance; otherwise, false.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.<br>
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this BarCodeRegionParameters.<br>
     *
     * @return A string that represents this BarCodeRegionParameters.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * Stores extended parameters of recognized barcode
 */
class BarCodeExtendedParameters extends joint.BaseJavaClass
{
    _oneDParameters;
    _code128Parameters;
    _qrParameters;
    _pdf417Parameters;
    _dataBarParameters;
    _maxiCodeParameters;
    _dotCodeExtendedParameters;
    _dataMatrixExtendedParameters;
    _aztecExtendedParameters;
    _gs1CompositeBarExtendedParameters;

    constructor(javaclass)
    {
        super(javaclass);
        this.init()
    }

    init()
    {
        this._oneDParameters = new OneDExtendedParameters(this.getJavaClass().getOneDSync());
        this._code128Parameters = new Code128ExtendedParameters(this.getJavaClass().getCode128Sync());
        this._qrParameters = new QRExtendedParameters(this.getJavaClass().getQRSync());
        this._pdf417Parameters = new Pdf417ExtendedParameters(this.getJavaClass().getPdf417Sync());
        this._dataBarParameters = new DataBarExtendedParameters(this.getJavaClass().getDataBarSync());
        this._maxiCodeParameters = new MaxiCodeExtendedParameters(this.getJavaClass().getMaxiCodeSync());
        this._dotCodeExtendedParameters = new DotCodeExtendedParameters(this.getJavaClass().getDotCodeSync());
        this._dataMatrixExtendedParameters = new DataMatrixExtendedParameters(this.getJavaClass().getDataMatrixSync());
        this._aztecExtendedParameters = new AztecExtendedParameters(this.getJavaClass().getAztecSync());
        this._gs1CompositeBarExtendedParameters = new GS1CompositeBarExtendedParameters(this.getJavaClass().getGS1CompositeBarSync());
    }

    /**
     * Gets a DataBar additional information DataBarExtendedParameters  of recognized barcode<br>
     * @return mixed A DataBar additional information DataBarExtendedParameters of recognized barcode
     */
    getDataBar()
    {
        return this._dataBarParameters;
    }

    /**
     * Gets a MaxiCode additional information<see cref="MaxiCodeExtendedParameters"/> of recognized barcode
     *
     * @return A MaxiCode additional information<see cref="MaxiCodeExtendedParameters"/> of recognized barcode
     */
    getMaxiCode()
    {
        return this._maxiCodeParameters;
    }

    /**
     *  Gets a special data OneDExtendedParameters of 1D recognized barcode Value: A special data OneDExtendedParameters of 1D recognized barcode
     */
    getOneD()
    {
        return this._oneDParameters;
    }

    /**
     * <p>Gets a DotCode additional information{@code DotCodeExtendedParameters} of recognized barcode</p>Value: A DotCode additional information{@code DotCodeExtendedParameters} of recognized barcode
     */
    getDotCode()
    {
        return this._dotCodeExtendedParameters;
    }

    /**
     * <p>Gets a DotCode additional information{@code DotCodeExtendedParameters} of recognized barcode</p>Value: A DotCode additional information{@code DotCodeExtendedParameters} of recognized barcode
     */
    getDataMatrix()
    {
        return this._dataMatrixExtendedParameters;
    }

    /**
     * <p>Gets a Aztec additional information{@code AztecExtendedParameters} of recognized barcode</p>Value: A Aztec additional information{@code AztecExtendedParameters} of recognized barcode
     */
    getAztec()
    {
        return this._aztecExtendedParameters;
    }

    /**
     * <p>Gets a GS1CompositeBar additional information{@code GS1CompositeBarExtendedParameters} of recognized barcode</p>Value: A GS1CompositeBar additional information{@code GS1CompositeBarExtendedParameters} of recognized barcode
     */
    getGS1CompositeBar()
    {
        return this._gs1CompositeBarExtendedParameters;
    }

    /**
     *  Gets a special data Code128ExtendedParameters of Code128 recognized barcode Value: A special data Code128ExtendedParameters of Code128 recognized barcode
     */
    getCode128()
    {
        return this._code128Parameters;
    }

    /**
     *  Gets a QR Structured Append information QRExtendedParameters of recognized barcode Value: A QR Structured Append information QRExtendedParameters of recognized barcode
     */
    getQR()
    {
        return this._qrParameters;
    }

    /**
     *  Gets a MacroPdf417 metadata information Pdf417ExtendedParameters of recognized barcode Value: A MacroPdf417 metadata information Pdf417ExtendedParameters of recognized barcode
     */
    getPdf417()
    {
        return this._pdf417Parameters;
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified BarCodeExtendedParameters value.<br>
     *
     * @param obj An System.Object value to compare to this instance.
     * @return true if obj has the same value as this instance; otherwise, false.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this BarCodeExtendedParameters.
     *
     * @return A string that represents this BarCodeExtendedParameters.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * QualitySettings allows to configure recognition quality and speed manually.<br>
 * You can quickly set up QualitySettings by embedded presets: HighPerformance, NormalQuality,<br>
 * HighQuality, MaxBarCodes or you can manually configure separate options.<br>
 * Default value of QualitySettings is NormalQuality.
 * @example
 * //This sample shows how to use QualitySettings with BarCodeReader
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * //set high performance mode
 * reader.setQualitySettings(QualitySettings.getHighPerformance());
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode CodeText: " + result.getCodeText());
 * });
 * @example
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * //normal quality mode is set by default
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *   console.log("BarCode CodeText: " + result.getCodeText());
 * });
 * @example
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * //set high quality mode with low speed recognition
 * reader.setQualitySettings(QualitySettings.getHighQuality());
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *   console.log("BarCode CodeText: " + result.getCodeText());
 * });
 * @example
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * //set max barcodes mode, which tries to find all possible barcodes, even incorrect. The slowest recognition mode
 * reader.setQualitySettings(QualitySettings.getMaxBarCodes());
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *   console.log("BarCode CodeText: " + result.getCodeText());
 * });
 * @example
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * //set high performance mode
 * reader.setQualitySettings(QualitySettings.getHighPerformance());
 * //set separate options
 * reader.getQualitySettings().setAllowMedianSmoothing(true);
 * reader.getQualitySettings().setMedianSmoothingWindowSize(5);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *     console.log("BarCode CodeText: " + result.getCodeText());
 * });
 * @example
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * //default mode is NormalQuality
 * //set separate options
 * reader.getQualitySettings().setAllowMedianSmoothing(true);
 * reader.getQualitySettings().setMedianSmoothingWindowSize(5);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *   console.log("BarCode CodeText: " + result.getCodeText());
 * });
 */
class QualitySettings extends joint.BaseJavaClass
{

    static get javaClassName()
    {
        return "com.aspose.mw.barcode.recognition.MwQualitySettings";
    }

    constructor(qualitySettings)
    {
        super(QualitySettings.initQualitySettings(qualitySettings));
        if (qualitySettings instanceof QualitySettings)
        {
            this.applyAll(qualitySettings);
        }
        this.init();
    }

    static initQualitySettings(qualitySettings)
    {
        let javaClassName = "com.aspose.mw.barcode.recognition.MwQualitySettings";
        if (qualitySettings instanceof QualitySettings || (qualitySettings === null))
        {
            let QualitySettings = java.import(javaClassName);
            return new QualitySettings();
        }
        else
        {
            return qualitySettings;
        }
    }

    init()
    {
    }

    /**
     * HighPerformance recognition quality preset. High quality barcodes are recognized well in this mode.<br>
     * @example
     * let reader = new BarCodeReader("test.png");
     * reader.setQualitySettings(QualitySettings.getHighPerformance());
     */
    static getHighPerformance()
    {
        let JavaQualitySettings = java.import(QualitySettings.javaClassName);
        return new QualitySettings(JavaQualitySettings.getHighPerformanceSync());
    }

    /**
     * NormalQuality recognition quality preset. Suitable for the most of barcodes
     *
     * @example
     * let reader = new BarCodeReader("test.png");
     * reader.setQualitySettings(QualitySettings.getNormalQuality());

     */
    static getNormalQuality()
    {
        let JavaQualitySettings = java.import(QualitySettings.javaClassName);
        return new QualitySettings(JavaQualitySettings.getNormalQualitySync());
    }

    /**
     * HighQualityDetection recognition quality preset. Same as NormalQuality but with high quality DetectorSettings
     *
     * @example
     * let reader = new BarCodeReader("test.png");
     * reader.setQualitySettings(QualitySettings.getHighQualityDetection());     *
     */
    static getHighQualityDetection()
    {
        let JavaQualitySettings = java.import(QualitySettings.javaClassName);
        return new QualitySettings(JavaQualitySettings.getHighQualityDetectionSync());
    }

    /**
     * MaxQualityDetection recognition quality preset. Same as NormalQuality but with highest quality DetectorSettings.<br>
     * Allows to detect diagonal and damaged barcodes.
     *
     * @example
     * let reader = new BarCodeReader("test.png");
     * reader.setQualitySettings(QualitySettings.getMaxQualityDetection());
     */
    static getMaxQualityDetection()
    {
        let JavaQualitySettings = java.import(QualitySettings.javaClassName);
        return new QualitySettings(JavaQualitySettings.getMaxQualityDetectionSync());
    }

    /**
     * HighQuality recognition quality preset. This preset is developed for low quality barcodes.
     *
     * @example
     * let reader = new BarCodeReader("test.png");
     * reader.setQualitySettings(QualitySettings.getHighQuality());
     */
    static getHighQuality()
    {
        let JavaQualitySettings = java.import(QualitySettings.javaClassName);
        return new QualitySettings(JavaQualitySettings.getHighQualitySync());
    }

    /**
     * Recognition mode which sets size (from 1 to infinity) of barcode minimal element: matrix cell or bar.
     * @return size (from 1 to infinity) of barcode minimal element: matrix cell or bar.
     */
    getXDimension()
    {
        return this.getJavaClass().getXDimensionSync();
    }
    /**
     * Recognition mode which sets size (from 1 to infinity) of barcode minimal element: matrix cell or bar.
     * @param value (from 1 to infinity) of barcode minimal element: matrix cell or bar.
     */
    setXDimension(value)
    {
        this.getJavaClass().setXDimensionSync(value);
    }

    /**
     * Minimal size of XDimension in pixels which is used with UseMinimalXDimension.
     * @return Minimal size of XDimension in pixels which is used with UseMinimalXDimension.
     */
    getMinimalXDimension()
    {
        return this.getJavaClass().getMinimalXDimensionSync();
    }

    /**
     * Minimal size of XDimension in pixels which is used with UseMinimalXDimension.
     * @param value Minimal size of XDimension in pixels which is used with UseMinimalXDimension.
     */
    setMinimalXDimension(value)
    {
        this.getJavaClass().setMinimalXDimensionSync(value);
    }

    /**
     * Mode which enables methods to recognize barcode elements with the selected quality. Barcode element with lower quality requires more hard methods which slows the recognition.
     * @return Mode which enables methods to recognize barcode elements with the selected quality.
     */
    getBarcodeQuality()
    {
        return this.getJavaClass().getBarcodeQualitySync();
    }
    /**
     * Mode which enables methods to recognize barcode elements with the selected quality. Barcode element with lower quality requires more hard methods which slows the recognition.
     * @param value Mode which enables methods to recognize barcode elements with the selected quality.
     */
    setBarcodeQuality(value)
    {
        this.getJavaClass().setBarcodeQualitySync(value);
    }

    /**
     * <p>
     * Deconvolution (image restorations) mode which defines level of image degradation. Originally deconvolution is a function which can restore image degraded
     * (convoluted) by any natural function like blur, during obtaining image by camera. Because we cannot detect image function which corrupt the image,
     * we have to check most well know functions like sharp or mathematical morphology.
     * @return Deconvolution mode which defines level of image degradation.
     */
    getDeconvolution()
    {
        return this.getJavaClass().getDeconvolutionSync();
    }
    /**
     * Deconvolution (image restorations) mode which defines level of image degradation. Originally deconvolution is a function which can restore image degraded
     * (convoluted) by any natural function like blur, during obtaining image by camera. Because we cannot detect image function which corrupt the image,
     * we have to check most well know functions like sharp or mathematical morphology.
     * @param value Deconvolution mode which defines level of image degradation.
     */
    setDeconvolution(value)
    {
        this.getJavaClass().setDeconvolutionSync(value);
    }

    /**
     * <p>
     * Mode which enables or disables additional recognition of barcodes on images with inverted colors (luminance).
     * @return Additional recognition of barcodes on images with inverse colors
     */
    getInverseImage()
    {
        return this.getJavaClass().getInverseImageSync();
    }
    /**
     * Mode which enables or disables additional recognition of barcodes on images with inverted colors (luminance).
     * @param value Additional recognition of barcodes on images with inverse colors
     */
    setInverseImage(value)
    {
        this.getJavaClass().setInverseImageSync(value);
    }

    /**
     * Mode which enables or disables additional recognition of color barcodes on color images.
     * @return Additional recognition of color barcodes on color images.
     */
    getComplexBackground()
    {
        return this.getJavaClass().getComplexBackgroundSync();
    }

    /**
     * Mode which enables or disables additional recognition of color barcodes on color images.
     * @param value Additional recognition of color barcodes on color images.
     */
    setComplexBackground(value)
    {
        this.getJavaClass().setComplexBackgroundSync(value);
    }

    /**
     * <p>
     * Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text.
     * @return Allows engine to recognize incorrect barcodes.
     */
    getAllowIncorrectBarcodes()
    {
        return this.getJavaClass().getAllowIncorrectBarcodesSync();
    }
    /**
     * <p>
     * Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text.
     * @param value Allows engine to recognize incorrect barcodes.
     */
    setAllowIncorrectBarcodes(value)
    {
        this.getJavaClass().setAllowIncorrectBarcodesSync(value);
    }

    /**
     * <p>
     * Function apply all values from Src setting to Dst
     * </p>
     * @param Src source settings
     */
    applyAll(Src)
    {
        this.setXDimension(Src.getXDimension());
        this.setMinimalXDimension(Src.getMinimalXDimension());
        this.setBarcodeQuality(Src.getBarcodeQuality());
        this.setDeconvolution(Src.getDeconvolution());
        this.setInverseImage(Src.getInverseImage());
        this.setComplexBackground(Src.getComplexBackground());
        this.setAllowIncorrectBarcodes(Src.getAllowIncorrectBarcodes());
    }
}

/**
 * Contains the data of subtype for Code128 type barcode
 */
class Code128DataPortion extends joint.BaseJavaClass
{
    static get javaClassName()
    {
        return "com.aspose.mw.barcode.recognition.MwCode128DataPortion";
    }

    /**
     * Creates a new instance of the {@code Code128DataPortion} class with start code symbol and decoded codetext.
     *
     * @param code128SubType A start encoding symbol
     * @param data A partial codetext
     */
    constructor(code128SubType, data)
    {
        let java_link = java.import(Code128DataPortion.javaClassName);
        let code128DataPortion = new java_link(code128SubType + "", data);
        super(code128DataPortion);
        this.init();
    }

    static construct(javaClass)
    {
        let code128DataPortion = new Code128DataPortion(0, "");
        code128DataPortion.setJavaClass(javaClass);
        return code128DataPortion;
    }

    /**
     * Gets the part of code text related to subtype.
     *
     * @return The part of code text related to subtype
     */
    getData()
    {
        return this.getJavaClass().getDataSync();
    }

    /**
     * Gets the part of code text related to subtype.
     *
     * @return The part of code text related to subtype
     */
    setData(value)
    {
        this.getJavaClass().setDataSync(value);
    }

    /**
     * Gets the type of Code128 subset
     *
     * @return The type of Code128 subset
     */
    getCode128SubType()
    {
        return this.getJavaClass().getCode128SubTypeSync();
    }

    /**
     * Sets the type of Code128 subset
     *
     * @return The type of Code128 subset
     */
    setCode128SubType(value)
    {
        this.getJavaClass().setCode128SubTypeSync(value);
    }

    init()
    {
    }

    /**
     * Returns a human-readable string representation of this {@code Code128DataPortion}.
     * @return A string that represents this {@code Code128DataPortion}.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * Stores a DataBar additional information of recognized barcode
 *@example
 *  let reader = new BarCodeReader("c:\\test.png", DecodeType.DATABAR_OMNI_DIRECTIONAL);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode Type: " + result.getCodeTypeName());
 *    console.log("BarCode CodeText: " + result.getCodeText());
 *    console.log("QR Structured Append Quantity: " + result.getExtended().getQR().getQRStructuredAppendModeBarCodesQuantity());
 * });
 */
class DataBarExtendedParameters extends joint.BaseJavaClass
{

    init()
    {
    }

    /**
     * Gets the DataBar 2D composite component flag. Default value is false.
     * @return The DataBar 2D composite component flag.
     */
    is2DCompositeComponent()
    {
        return this.getJavaClass().is2DCompositeComponentSync();
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified DataBarExtendedParameters value.<br>
     * @param obj DataBarExtendedParameters value to compare to this instance.<br>
     * @return true if obj has the same value as this instance; otherwise, false<br>.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     * @return A 32-bit signed integer hash code.
     */
    hashcode()
    {
        return this.getJavaClass().hashcodeSync();
    }

    /**
     * Returns a human-readable string representation of this <see cref="DataBarExtendedParameters"/>.
     * @return A string that represents this <see cref="DataBarExtendedParameters"/>.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * AustraliaPost decoding parameters. Contains parameters which make influence on recognized data of AustraliaPost symbology.
 */
class AustraliaPostSettings extends joint.BaseJavaClass
{
    static get javaClassName()
    {
        return "com.aspose.mw.barcode.recognition.MwAustraliaPostSettings";
    }

    init()
    {
    }

    /**
     * AustraliaPostSettings constructor
     */
    constructor(settings)
    {
        if (settings != null)
        {
            super(settings.getJavaClass());
        }
        else
        {
            let java_link = java.import(AustraliaPostSettings.javaClassName);
            let australiaPostSettings = new java_link();
            super(australiaPostSettings);
        }
    }

    static construct(javaClass)
    {
        let australiaPostSettings = new AustraliaPostSettings(null);
        australiaPostSettings.setJavaClass(javaClass);
        return australiaPostSettings;
    }

    /**
     * Gets the Interpreting Type for the Customer Information of AustralianPost BarCode.DEFAULT is CustomerInformationInterpretingType.OTHER.
     * @return The interpreting type (CTable, NTable or Other) of customer information for AustralianPost BarCode
     */
    getCustomerInformationInterpretingType()
    {
        return this.getJavaClass().getCustomerInformationInterpretingTypeSync();
    }

    /**
     * Sets the Interpreting Type for the Customer Information of AustralianPost BarCode.DEFAULT is CustomerInformationInterpretingType.OTHER.<br>
     * @param value The interpreting type (CTable, NTable or Other) of customer information for AustralianPost BarCode
     */
    setCustomerInformationInterpretingType(value)
    {
        this.getJavaClass().setCustomerInformationInterpretingTypeSync(value);
    }

    /**
     * The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method.<br>
     * CTable encoding method does not have any gaps in encoding table and sequnce "333" of filling paterns is decoded as letter "z".
     *
     * @example
     *
     * let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "5912345678AB");
     * generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.C_TABLE);
     * let image = generator.generateBarCodeImage(BarcodeImageFormat.PNG);
     * let reader = new BarCodeReader(image, null, DecodeType.AUSTRALIA_POST);
     * reader.getBarcodeSettings().getAustraliaPost().setCustomerInformationInterpretingType(CustomerInformationInterpretingType.C_TABLE);
     * reader.getBarcodeSettings().getAustraliaPost().setIgnoreEndingFillingPatternsForCTable(true);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log("BarCode Type: " + result.getCodeType());
     *     console.log("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @return The flag which force AustraliaPost decoder to ignore last filling patterns during CTable method decoding
     */
    getIgnoreEndingFillingPatternsForCTable()
    {
        return this.getJavaClass().getIgnoreEndingFillingPatternsForCTableSync();
    }

    /**
     * The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method.<br>
     * CTable encoding method does not have any gaps in encoding table and sequnce "333" of filling paterns is decoded as letter "z".
     *
     * @example
     *
     * let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "5912345678AB");
     * generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.C_TABLE);
     * let image = generator.generateBarCodeImage(BarcodeImageFormat.PNG);
     * let reader = new BarCodeReader(image, null, DecodeType.AUSTRALIA_POST);
     * reader.getBarcodeSettings().getAustraliaPost().setCustomerInformationInterpretingType(CustomerInformationInterpretingType.C_TABLE);
     * reader.getBarcodeSettings().getAustraliaPost().setIgnoreEndingFillingPatternsForCTable(true);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log("BarCode Type: " + result.getCodeType());
     *     console.log("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @return The flag which force AustraliaPost decoder to ignore last filling patterns during CTable method decoding
     */
    setIgnoreEndingFillingPatternsForCTable(value)
    {
        this.getJavaClass().setIgnoreEndingFillingPatternsForCTableSync(value);
    }
}

/**
 * The main BarCode decoding parameters. Contains parameters which make influence on recognized data.
 */
class BarcodeSettings extends joint.BaseJavaClass
{

    _australiaPost;

    static get javaClassName()
    {
        return "com.aspose.mw.barcode.recognition.MwBarcodeSettings";
    }

    /**
     * BarcodeSettings copy constructor
     * @param settings The source of the data
     */
    constructor(settings)
    {
        if (settings != null)
        {
            super(settings.getJavaClass());
        }
        else
        {
            let java_link = java.import(BarcodeSettings.javaClassName);
            let barcodeSettings = new java_link();
            super(barcodeSettings);
        }
    }

    /**
     * BarcodeSettings copy constructor
     * @param settings The source of the data
     */
    static construct(javaClass)
    {
        let barcodeSettings = new BarcodeSettings(null);
        barcodeSettings.setJavaClass(javaClass);
        return barcodeSettings;
    }

    init()
    {
        this._australiaPost = AustraliaPostSettings.construct(this.getJavaClass().getAustraliaPostSync());
    }

    /**
     * Enable checksum validation during recognition for 1D and Postal barcodes.<br>
     * Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.<br>
     * Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5<br>
     * Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN<br>
     * Checksum always used: Rest symbologies<br>
     *
     * @example
     *
     * let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
     * generator.save("c:/test.png", BarcodeImageFormat.PNG);
     * let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
     * //checksum disabled
     * reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.OFF);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *      console.log ("BarCode CodeText: " + result.getCodeText());
     *      console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
     *      console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
     * });
     *
     * @example
     * let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
     * //checksum enabled
     * reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.ON);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *      console.log ("BarCode CodeText: " + result.CodeText);
     *      console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
     *      console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
     * });
     * @return Enable checksum validation during recognition for 1D and Postal barcodes.
     */
    getChecksumValidation()
    {
        return this.getJavaClass().getChecksumValidationSync();
    }

    /**
     * Enable checksum validation during recognition for 1D and Postal barcodes.<br>
     * Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.<br>
     * Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5<br>
     * Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN<br>
     * Checksum always used: Rest symbologies<br>
     *
     * @example
     *
     * let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
     * generator.save("c:/test.png", BarcodeImageFormat.PNG);
     * let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
     * //checksum disabled
     * reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.OFF);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *      console.log ("BarCode CodeText: " + result.getCodeText());
     *      console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
     *      console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
     * });
     *
     * @example
     * let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
     * //checksum enabled
     * reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.ON);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *      console.log ("BarCode CodeText: " + result.CodeText);
     *      console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
     *      console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
     * });
     * @param value  Enable checksum validation during recognition for 1D and Postal barcodes.
     */
    setChecksumValidation(value)
    {
        this.getJavaClass().setChecksumValidationSync(value);
    }

    /**
     * Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
     *
     * @example
     *
     * let generator = new BarcodeGenerator(EncodeTypes.GS_1_CODE_128, "(02)04006664241007(37)1(400)7019590754");
     * generator.save("c:/test.png", BarcodeImageFormat.PNG);
     * let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);
     *
     * //StripFNC disabled
     * reader.getBarcodeSettings().setStripFNC(false);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log ("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @example
     * let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);
     *
     * //StripFNC enabled
     * reader.getBarcodeSettings().setStripFNC(true);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log ("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @return Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
     */
    getStripFNC()
    {
        return this.getJavaClass().getStripFNCSync();
    }

    /**
     * Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
     *
     * @example
     *
     * let generator = new BarcodeGenerator(EncodeTypes.GS_1_CODE_128, "(02)04006664241007(37)1(400)7019590754");
     * generator.save("c:/test.png", BarcodeImageFormat.PNG);
     * let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);
     *
     * //StripFNC disabled
     * reader.getBarcodeSettings().setStripFNC(false);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log ("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @example
     * let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);
     *
     * //StripFNC enabled
     * reader.getBarcodeSettings().setStripFNC(true);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log ("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @param value  Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
     */
    setStripFNC(value)
    {
        this.getJavaClass().setStripFNCSync(value);
    }

    /**
     * The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true.
     *
     * @example
     *
     * let generator = new BarcodeGenerator(EncodeTypes.QR, "Слово"))
     * $im = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
     *
     * //detects encoding for Unicode codesets is enabled
     * let reader = new BarCodeReader(im, DecodeType.QR);
     * reader.getBarcodeSettings().setDetectEncoding(true);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log ("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @example
     * //detect encoding is disabled
     * let reader = new BarCodeReader(im, DecodeType.QR);
     * reader.getBarcodeSettings().setDetectEncoding(false);
     * reader.readBarCodes().forEach(function(result, i, results)
     * console.log ("BarCode CodeText: " + result.getCodeText());
     *
     * @return The flag which force engine to detect codetext encoding for Unicode codesets
     */
    getDetectEncoding()
    {
        return this.getJavaClass().getDetectEncodingSync();
    }

    /**
     * The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true.
     *
     * @example
     *
     * let generator = new BarcodeGenerator(EncodeTypes.QR, "Слово"))
     * $im = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
     *
     * //detects encoding for Unicode codesets is enabled
     * let reader = new BarCodeReader(im, DecodeType.QR);
     * reader.getBarcodeSettings().setDetectEncoding(true);
     * reader.readBarCodes().forEach(function(result, i, results)
     * {
     *     console.log ("BarCode CodeText: " + result.getCodeText());
     * });
     *
     * @example
     * //detect encoding is disabled
     * let reader = new BarCodeReader(im, DecodeType.QR);
     * reader.getBarcodeSettings().setDetectEncoding(false);
     * reader.readBarCodes().forEach(function(result, i, results)
     * console.log ("BarCode CodeText: " + result.getCodeText());
     *
     * @return The flag which force engine to detect codetext encoding for Unicode codesets
     */
    setDetectEncoding(value)
    {
        this.getJavaClass().setDetectEncodingSync(value);
    }

    /**
     * Gets AustraliaPost decoding parameters
     * @return The AustraliaPost decoding parameters which make influence on recognized data of AustraliaPost symbology
     */
    getAustraliaPost()
    {
        return this._australiaPost;
    }
}

/**
 * Represents recognition abort exception which is thrown in timeout exceeding during recognition with BarCodeReader.
 */
class RecognitionAbortedException extends Error
{
    javaClass;

    static get javaClassName()
    {
        return "com.aspose.mw.barcode.recognition.MwRecognitionAbortedException";
    }

    /**
     * Gets the execution time of current recognition session
     * @return The execution time of current recognition session
     */
    getExecutionTime()
    {
        return this.javaClass.getExecutionTimeSync();
    }

    /**
     * Sets the execution time of current recognition session
     * @param value The execution time of current recognition session
     */
    setExecutionTime(value)
    {
        this.javaClass.setExecutionTimeSync(value);
    }

    /**
     * Initializes a new instance of the <see cref="RecognitionAbortedException" /> class with specified recognition abort message.
     * @param message The error message of the exception.
     * @param executionTime The execution time of current recognition session.
     */
    constructor(message, executionTime)
    {
        super(message);
        let java_class_link = new java.import(RecognitionAbortedException.javaClassName);
        if (message != null && executionTime != null)
        {
            this.javaClass = new java_class_link(message, executionTime);
        }
        else if (executionTime != null)
        {
            this.javaClass = new java_class_link(executionTime);
        }
        else
        {
            this.javaClass = new java_class_link();
        }
    }

    static construct(javaClass)
    {
        let exception = new RecognitionAbortedException(null, null);
        exception.javaClass = javaClass;
        return exception;
    }

    init()
    {

    }
}

/**
 * Stores a MaxiCode additional information of recognized barcode
 */
class MaxiCodeExtendedParameters extends joint.BaseJavaClass
{

    constructor(javaClass)
    {
        super(javaClass);
    }

    init()
    {
    }

    /**
     * Gets a MaxiCode encode mode.
     *  Default value: Mode4
     */
    getMaxiCodeMode()
    {
        return this.getJavaClass().getMaxiCodeModeSync();
    }

    /**
     * Sets a MaxiCode encode mode.
     *  Default value: Mode4
     */
    setMaxiCodeMode(maxiCodeMode)
    {
        this.getJavaClass().setMaxiCodeModeSync(maxiCodeMode);
    }

    /**
     * Gets a MaxiCode barcode id in structured append mode.
     * Default value: 0
     */
    getMaxiCodeStructuredAppendModeBarcodeId()
    {
        return this.getJavaClass().getMaxiCodeStructuredAppendModeBarcodeIdSync();
    }

    /**
     * Sets a MaxiCode barcode id in structured append mode.
     * Default value: 0
     */
    setMaxiCodeStructuredAppendModeBarcodeId(value)
    {
        this.getJavaClass().setMaxiCodeStructuredAppendModeBarcodeIdSync(value);
    }

    /**
     * Gets a MaxiCode barcodes count in structured append mode.
     * Default value: -1
     */
    getMaxiCodeStructuredAppendModeBarcodesCount()
    {
        return this.getJavaClass().getMaxiCodeStructuredAppendModeBarcodesCountSync();
    }

    /**
     * Sets a MaxiCode barcodes count in structured append mode.
     * Default value: -1
     */
    setMaxiCodeStructuredAppendModeBarcodesCount(value)
    {
        this.getJavaClass().setMaxiCodeStructuredAppendModeBarcodesCountSync(value);
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified <see cref="MaxiCodeExtendedParameters"/> value.
     * @param obj An Object value to compare to this instance.
     * @return <b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     * @return A 32-bit signed integer hash code.
     */
    getHashCode()
    {
        return this.getJavaClass().getHashCodeSync();
    }

    /**
     * Returns a human-readable string representation of this <see cref="MaxiCodeExtendedParameters"/>.
     * @return A string that represents this <see cref="MaxiCodeExtendedParameters"/>.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * <p>
 * Stores special data of DotCode recognized barcode
 * </p>
 * This sample shows how to get DotCode raw values<br>
 *
 * @example
 * let generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, "12345");
 * generator.save("c:\\test.png", BarCodeImageFormat.PNG);
 *
 * let reader = new BarCodeReader("c:\\test.png", null, DecodeType.DOT_CODE);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *     print("BarCode type: " + result.getCodeTypeName());
 *     print("BarCode codetext: " + result.getCodeText());
 *     print("DotCode barcode ID: " + result.getExtended().getDotCode().getDotCodeStructuredAppendModeBarcodeId());
 *     print("DotCode barcodes count: " + result.getExtended().getDotCode().getDotCodeStructuredAppendModeBarcodesCount());
 * });
 */
class DotCodeExtendedParameters extends joint.BaseJavaClass
{
    constructor(javaClass)
    {
        super(javaClass);
    }

    /**
     * <p>Gets the DotCode structured append mode barcodes count. Default value is -1. Count must be a value from 1 to 35.</p>Value: The count of the DotCode structured append mode barcode.
     */
    getDotCodeStructuredAppendModeBarcodesCount()
    { return this.getJavaClass().getDotCodeStructuredAppendModeBarcodesCountSync(); }

    /**
     * <p>Gets the ID of the DotCode structured append mode barcode. ID starts from 1 and must be less or equal to barcodes count. Default value is -1.</p>Value: The ID of the DotCode structured append mode barcode.
     */
    getDotCodeStructuredAppendModeBarcodeId()
    { return this.getJavaClass().getDotCodeStructuredAppendModeBarcodeIdSync(); }

    /**
     * <p>
     * Indicates whether code is used for instruct reader to interpret the following data as instructions for initialization or reprogramming of the bar code reader.
     * Default value is false.
     * </p>
     */
    getDotCodeIsReaderInitialization()
    { return this.getJavaClass().getDotCodeIsReaderInitializationSync(); }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code DotCodeExtendedParameters} value.
     * </p>
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     * @param obj An System.Object value to compare to this instance.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * <p>
     * Returns a human-readable string representation of this {@code DotCodeExtendedParameters}.
     * </p>
     * @return A string that represents this {@code DotCodeExtendedParameters}.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }

    init()
    {
    }
}

/**
 * <p>
 * Stores special data of DataMatrix recognized barcode
 * </p><p><hr><blockquote><pre>
 * This sample shows how to get DataMatrix raw values
 * <pre>
 * let generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, "12345"))
 * generator.save("c:\\test.png", BarcodeImageFormat.PNG);
 *
 * let reader = new BarCodeReader("c:\\test.png", null, DecodeType.DATA_MATRIX))
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode type: " + result.getCodeTypeName());
 *    console.log("BarCode codetext: " + result.getCodeText());
 *    console.log("DataMatrix barcode ID: " + result.getExtended().getDataMatrix().getStructuredAppendBarcodeId());
 *    console.log("DataMatrix barcodes count: " + result.getExtended().getDataMatrix().getStructuredAppendBarcodesCount());
 *    console.log("DataMatrix file ID: " + result.getExtended().getDataMatrix().getStructuredAppendFileId());
 *    console.log("DataMatrix is reader programming: " + result.getExtended().getDataMatrix().isReaderProgramming());
 * });
 * </pre>
 * </pre></blockquote></hr></p>
 */
class DataMatrixExtendedParameters extends joint.BaseJavaClass
{
    constructor(javaClass)
    {
        super(javaClass);
    }

    init()
    {
    }

    /**
     * <p>Gets the DataMatrix structured append mode barcodes count. Default value is -1. Count must be a value from 1 to 35.</p>Value: The count of the DataMatrix structured append mode barcode.
     */
    getStructuredAppendBarcodesCount()
    {
        return this.getJavaClass().getStructuredAppendBarcodesCountSync();
    }

    /**
     * <p>Gets the ID of the DataMatrix structured append mode barcode. ID starts from 1 and must be less or equal to barcodes count. Default value is -1.</p>Value: The ID of the DataMatrix structured append mode barcode.
     */
    getStructuredAppendBarcodeId()
    {
        return this.getJavaClass().getStructuredAppendBarcodeIdSync();
    }

    /**
     * <p>Gets the ID of the DataMatrix structured append mode barcode. ID starts from 1 and must be less or equal to barcodes count. Default value is -1.</p>Value: The ID of the DataMatrix structured append mode barcode.
     */
    getStructuredAppendFileId()
    {
        return this.getJavaClass().getStructuredAppendFileIdSync();
    }

    /**
     * <p>
     * Indicates whether code is used for instruct reader to interpret the following data as instructions for initialization or reprogramming of the bar code reader.
     * Default value is false.
     * </p>
     */
    isReaderProgramming()
    {
        return this.getJavaClass().isReaderProgrammingSync();
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code DataMatrixExtendedParameters} value.
     * </p>
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     * @param obj An System.Object value to compare to this instance.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * <p>
     * Returns a human-readable string representation of this {@code DataMatrixExtendedParameters}.
     * </p>
     * @return A string that represents this {@code DataMatrixExtendedParameters}.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * <p>
 * Stores special data of {@code <b>GS1 Composite Bar</b>} recognized barcode
 * </p>
 */
class GS1CompositeBarExtendedParameters extends joint.BaseJavaClass
{
    constructor(javaClass)
    {
        super(javaClass);
    }

    init()
    {
    }

    /**
     * <p>Gets the 1D (linear) barcode type of GS1 Composite</p>Value: 2D barcode type
     */
    getOneDType()
    {
        return this.getJavaClass().getOneDTypeSync();
    }

    /**
     * <p>Gets the 1D (linear) barcode value of GS1 Composite</p>Value: 1D barcode value
     */
    getOneDCodeText()
    {
        return this.getJavaClass().getOneDCodeTextSync();
    }

    /**
     * <p>Gets the 2D barcode type of GS1 Composite</p>Value: 2D barcode type
     */
    getTwoDType()
    {
        return this.getJavaClass().getTwoDTypeSync();
    }

    /**
     * <p>Gets the 2D barcode value of GS1 Composite</p>Value: 2D barcode value
     */
    getTwoDCodeText()
    {
        return this.getJavaClass().getTwoDCodeTextSync();
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code GS1CompositeBarExtendedParameters} value.
     * </p>
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     * @param obj An System.Object value to compare to this instance.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * <p>
     * Returns a human-readable string representation of this {@code GS1CompositeBarExtendedParameters}.
     * </p>
     * @return A string that represents this {@code GS1CompositeBarExtendedParameters}.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * <p>
 * Stores special data of Aztec recognized barcode
 * </p><p><hr><blockquote><pre>
 * This sample shows how to get Aztec raw values
 * <pre>
 * let generator = new BarcodeGenerator(EncodeTypes.AZTEC, "12345");
 * generator.save("test.png", BarcodeImageFormat::PNG);
 *
 * @example
 * BarCodeReader reader = new BarCodeReader("test.png", null, DecodeType.AZTEC);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *     console.log("BarCode type: " + result.getCodeTypeName());
 *     console.log("BarCode codetext: " + result.getCodeText());
 *     console.log("Aztec barcode ID: " + result.getExtended().getAztec().getStructuredAppendBarcodeId());
 *     console.log("Aztec barcodes count: " + result.getExtended().getAztec().getStructuredAppendBarcodesCount());
 *     console.log("Aztec file ID: " + result.getExtended().getAztec().getStructuredAppendFileId());
 *     console.log("Aztec is reader initialization: " + result.getExtended().getAztec().isReaderInitialization());
 * });
 * </pre>
 * </pre></blockquote></hr></p>
 */
class AztecExtendedParameters extends joint.BaseJavaClass
{
    constructor(javaClass)
    {
        super(javaClass);
    }

    init()
    {
    }

    /**
     * <p>Gets the Aztec structured append mode barcodes count. Default value is 0. Count must be a value from 1 to 26.</p>Value: The barcodes count of the Aztec structured append mode.
     */
    getStructuredAppendBarcodesCount()
    {
        return this.getJavaClass().getStructuredAppendBarcodesCountSync();
    }

    /**
     * <p>Gets the ID of the Aztec structured append mode barcode. ID starts from 1 and must be less or equal to barcodes count. Default value is 0.</p>Value: The barcode ID of the Aztec structured append mode.
     */
    getStructuredAppendBarcodeId()
    {
        return this.getJavaClass().getStructuredAppendBarcodeIdSync();
    }

    /**
     * <p>Gets the File ID of the Aztec structured append mode. Default value is empty string</p>Value: The File ID of the Aztec structured append mode.
     */
    getStructuredAppendFileId()
    {
        return this.getJavaClass().getStructuredAppendFileIdSync();
    }

    /**
     * <p>
     * Indicates whether code is used for instruct reader to interpret the following data as instructions for initialization or reprogramming of the bar code reader.
     * Default value is false.
     * </p>
     */
    isReaderInitialization()
    {
        return this.getJavaClass().isReaderInitializationSync();
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code AztecExtendedParameters} value.
     * </p>
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     * @param obj An System.Object value to compare to this instance.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     * @return 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    /**
     * <p>
     * Returns a human-readable string representation of this {@code AztecExtendedParameters}.
     * </p>
     * @return A string that represents this {@code AztecExtendedParameters}.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }
}

/**
 * Specify the type of barcode to read.
 *
 * @example
 * //This sample shows how to detect Code39 and Code128 barcodes.
 * let reader = new BarCodeReader("test.png", null,  [ DecodeType.CODE_39_STANDARD, DecodeType.CODE_128 ]);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode Type: " + result.getCodeTypeName());
 *    console.log("BarCode CodeText: " + result.getCodeText());
 * });
 *
 * @enum
 */
DecodeType =
    {
        /**
         * Unspecified decode type.
         */
        NONE: -1,

        /**
         * Specifies that the data should be decoded with {@code <b>CODABAR</b>} barcode specification
         */
        CODABAR: 0,

        /**
         * Specifies that the data should be decoded with {@code <b>CODE 11</b>} barcode specification
         */
        CODE_11: 1,

        /**
         * Specifies that the data should be decoded with {@code <b>Standard CODE 39</b>} barcode specification
         */
        CODE_39_STANDARD: 2,

        /**
         * Specifies that the data should be decoded with {@code <b>Extended CODE 39</b>} barcode specification
         */
        CODE_39_EXTENDED: 3,

        /**
         * Specifies that the data should be decoded with {@code <b>Standard CODE 93</b>} barcode specification
         */
        CODE_93_STANDARD: 4,

        /**
         * Specifies that the data should be decoded with {@code <b>Extended CODE 93</b>} barcode specification
         */
        CODE_93_EXTENDED: 5,

        /**
         * Specifies that the data should be decoded with {@code <b>CODE 128</b>} barcode specification
         */
        CODE_128: 6,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 CODE 128</b>} barcode specification
         */
        GS_1_CODE_128: 7,

        /**
         * Specifies that the data should be decoded with {@code <b>EAN-8</b>} barcode specification
         */
        EAN_8: 8,

        /**
         * Specifies that the data should be decoded with {@code <b>EAN-13</b>} barcode specification
         */
        EAN_13: 9,

        /**
         * Specifies that the data should be decoded with {@code <b>EAN14</b>} barcode specification
         */
        EAN_14: 10,

        /**
         * Specifies that the data should be decoded with {@code <b>SCC14</b>} barcode specification
         */
        SCC_14: 11,

        /**
         * Specifies that the data should be decoded with {@code <b>SSCC18</b>} barcode specification
         */
        SSCC_18: 12,

        /**
         * Specifies that the data should be decoded with {@code <b>UPC-A</b>} barcode specification
         */
        UPCA: 13,

        /**
         * Specifies that the data should be decoded with {@code <b>UPC-E</b>} barcode specification
         */
        UPCE: 14,

        /**
         * Specifies that the data should be decoded with {@code <b>ISBN</b>} barcode specification
         */
        ISBN: 15,

        /**
         * Specifies that the data should be decoded with {@code <b>Standard 2 of 5</b>} barcode specification
         */
        STANDARD_2_OF_5: 16,

        /**
         * Specifies that the data should be decoded with {@code <b>INTERLEAVED 2 of 5</b>} barcode specification
         */
        INTERLEAVED_2_OF_5: 17,

        /**
         * Specifies that the data should be decoded with {@code <b>Matrix 2 of 5</b>} barcode specification
         */
        MATRIX_2_OF_5: 18,

        /**
         * Specifies that the data should be decoded with {@code <b>Italian Post 25</b>} barcode specification
         */
        ITALIAN_POST_25: 19,

        /**
         * Specifies that the data should be decoded with {@code <b>IATA 2 of 5</b>} barcode specification. IATA (International Air Transport Association) uses this barcode for the management of air cargo.
         */
        IATA_2_OF_5: 20,

        /**
         * Specifies that the data should be decoded with {@code <b>ITF14</b>} barcode specification
         */
        ITF_14: 21,

        /**
         * Specifies that the data should be decoded with {@code <b>ITF6</b>} barcode specification
         */
        ITF_6: 22,

        /**
         * Specifies that the data should be decoded with {@code <b>MSI Plessey</b>} barcode specification
         */
        MSI: 23,

        /**
         * Specifies that the data should be decoded with {@code <b>VIN</b>} (Vehicle Identification Number) barcode specification
         */
        VIN: 24,

        /**
         * Specifies that the data should be decoded with {@code <b>DeutschePost Ident code</b>} barcode specification
         */
        DEUTSCHE_POST_IDENTCODE: 25,

        /**
         * Specifies that the data should be decoded with {@code <b>DeutschePost Leit code</b>} barcode specification
         */
        DEUTSCHE_POST_LEITCODE: 26,

        /**
         * Specifies that the data should be decoded with {@code <b>OPC</b>} barcode specification
         */
        OPC: 27,

        /**
         *  Specifies that the data should be decoded with {@code <b>PZN</b>} barcode specification. This symbology is also known as Pharma Zentral Nummer
         */
        PZN: 28,

        /**
         * Specifies that the data should be decoded with {@code <b>Pharmacode</b>} barcode. This symbology is also known as Pharmaceutical BINARY Code
         */
        PHARMACODE: 29,

        /**
         * Specifies that the data should be decoded with {@code <b>DataMatrix</b>} barcode symbology
         */
        DATA_MATRIX: 30,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1DataMatrix</b>} barcode symbology
         */
        GS_1_DATA_MATRIX: 31,

        /**
         * Specifies that the data should be decoded with {@code <b>QR Code</b>} barcode specification
         */
        QR: 32,

        /**
         * Specifies that the data should be decoded with {@code <b>Aztec</b>} barcode specification
         */
        AZTEC: 33,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>GS1 Aztec</b>} barcode specification
         * </p>
         */
        GS_1_AZTEC: 81,

        /**
         * Specifies that the data should be decoded with {@code <b>Pdf417</b>} barcode symbology
         */
        PDF_417: 34,

        /**
         * Specifies that the data should be decoded with {@code <b>MacroPdf417</b>} barcode specification
         */
        MACRO_PDF_417: 35,

        /**
         * Specifies that the data should be decoded with {@code <b>MicroPdf417</b>} barcode specification
         */
        MICRO_PDF_417: 36,

        /**
         * Specifies that the data should be decoded with <b>MicroPdf417</b> barcode specification
         */
        GS_1_MICRO_PDF_417: 82,

        /**
         * Specifies that the data should be decoded with {@code <b>CodablockF</b>} barcode specification
         */
        CODABLOCK_F: 65,
        /**
         * Specifies that the data should be decoded with <b>Royal Mail Mailmark</b> barcode specification.
         */
        MAILMARK: 66,

        /**
         * Specifies that the data should be decoded with {@code <b>Australia Post</b>} barcode specification
         */
        AUSTRALIA_POST: 37,

        /**
         * Specifies that the data should be decoded with {@code <b>Postnet</b>} barcode specification
         */
        POSTNET: 38,

        /**
         * Specifies that the data should be decoded with {@code <b>Planet</b>} barcode specification
         */
        PLANET: 39,

        /**
         * Specifies that the data should be decoded with USPS {@code <b>OneCode</b>} barcode specification
         */
        ONE_CODE: 40,

        /**
         * Specifies that the data should be decoded with {@code <b>RM4SCC</b>} barcode specification. RM4SCC (Royal Mail 4-state Customer Code) is used for automated mail sort process in UK.
         */
        RM_4_SCC: 41,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 DATABAR omni-directional</b>} barcode specification
         */
        DATABAR_OMNI_DIRECTIONAL: 42,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 DATABAR truncated</b>} barcode specification
         */
        DATABAR_TRUNCATED: 43,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 DATABAR limited</b>} barcode specification
         */
        DATABAR_LIMITED: 44,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 DATABAR expanded</b>} barcode specification
         */
        DATABAR_EXPANDED: 45,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 DATABAR stacked omni-directional</b>} barcode specification
         */
        DATABAR_STACKED_OMNI_DIRECTIONAL: 53,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 DATABAR stacked</b>} barcode specification
         */
        DATABAR_STACKED: 54,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 DATABAR expanded stacked</b>} barcode specification
         */
        DATABAR_EXPANDED_STACKED: 55,

        /**
         * Specifies that the data should be decoded with {@code <b>Patch code</b>} barcode specification. Barcode symbology is used for automated scanning
         */
        PATCH_CODE: 46,

        /**
         * Specifies that the data should be decoded with {@code <b>ISSN</b>} barcode specification
         */
        ISSN: 47,

        /**
         * Specifies that the data should be decoded with {@code <b>ISMN</b>} barcode specification
         */
        ISMN: 48,

        /**
         * Specifies that the data should be decoded with {@code <b>Supplement(EAN2, EAN5)</b>} barcode specification
         */
        SUPPLEMENT: 49,

        /**
         * Specifies that the data should be decoded with {@code <b>Australian Post Domestic eParcel Barcode</b>} barcode specification
         */
        AUSTRALIAN_POSTE_PARCEL: 50,

        /**
         * Specifies that the data should be decoded with {@code <b>Swiss Post Parcel Barcode</b>} barcode specification
         */
        SWISS_POST_PARCEL: 51,

        /**
         * Specifies that the data should be decoded with {@code <b>SCode16K</b>} barcode specification
         */
        CODE_16_K: 52,

        /**
         * Specifies that the data should be decoded with {@code <b>MicroQR Code</b>} barcode specification
         */
        MICRO_QR: 56,

        /**
         * Specifies that the data should be decoded with <b>RectMicroQR (rMQR) Code</b> barcode specification
         */
        RECT_MICRO_QR: 83,

        /**
         * Specifies that the data should be decoded with {@code <b>CompactPdf417</b>} (Pdf417Truncated) barcode specification
         */
        COMPACT_PDF_417: 57,

        /**
         * Specifies that the data should be decoded with {@code <b>GS1 QR</b>} barcode specification
         */
        GS_1_QR: 58,

        /**
         * Specifies that the data should be decoded with {@code <b>MaxiCode</b>} barcode specification
         */
        MAXI_CODE: 59,

        /**
         * Specifies that the data should be decoded with {@code <b>MICR E-13B</b>} blank specification
         */
        MICR_E_13_B: 60,

        /**
         * Specifies that the data should be decoded with {@code <b>Code32</b>} blank specification
         */
        CODE_32: 61,

        /**
         * Specifies that the data should be decoded with {@code <b>DataLogic 2 of 5</b>} blank specification
         */
        DATA_LOGIC_2_OF_5: 62,

        /**
         * Specifies that the data should be decoded with {@code <b>DotCode</b>} blank specification
         */
        DOT_CODE: 63,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>GS1 DotCode</b>} blank specification
         * </p>
         */
        GS_1_DOT_CODE: 77,

        /**
         * Specifies that the data should be decoded with {@code <b>DotCode</b>} blank specification
         */
        DUTCH_KIX: 64,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC LIC Code39</b>} blank specification
         * </p>
         */
        HIBC_CODE_39_LIC: 67,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC LIC Code128</b>} blank specification
         * </p>
         */
        HIBC_CODE_128_LIC: 68,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC LIC Aztec</b>} blank specification
         * </p>
         */
        HIBC_AZTEC_LIC: 69,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC LIC DataMatrix</b>} blank specification
         * </p>
         */
        HIBC_DATA_MATRIX_LIC: 70,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC LIC QR</b>} blank specification
         * </p>
         */
        HIBCQRLIC: 71,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC PAS Code39</b>} blank specification
         * </p>
         */
        HIBC_CODE_39_PAS: 72,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC PAS Code128</b>} blank specification
         * </p>
         */
        HIBC_CODE_128_PAS: 73,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC PAS Aztec</b>} blank specification
         * </p>
         */
        HIBC_AZTEC_PAS: 74,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC PAS DataMatrix</b>} blank specification
         * </p>
         */
        HIBC_DATA_MATRIX_PAS: 75,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>HIBC PAS QR</b>} blank specification
         * </p>
         */
        HIBCQRPAS: 76,

        /**
         *  Specifies that the data should be decoded with <b>Han Xin Code</b> blank specification
         */
        HAN_XIN: 78,

        /**
         * Specifies that the data should be decoded with <b>Han Xin Code</b> blank specification
         */
        GS_1_HAN_XIN: 79,

        /**
         * <p>
         * Specifies that the data should be decoded with {@code <b>GS1 Composite Bar</b>} barcode specification
         * </p>
         */
        GS_1_COMPOSITE_BAR: 80,

        /**
         * Specifies that data will be checked with all of  1D  barcode symbologies
         */
        TYPES_1D: 97,

        /**
         * Specifies that data will be checked with all of  1.5D POSTAL  barcode symbologies, like  Planet, Postnet, AustraliaPost, OneCode, RM4SCC, DutchKIX
         */
        POSTAL_TYPES: 95,

        /**
         * Specifies that data will be checked with most commonly used symbologies
         */
        MOST_COMMON_TYPES: 96,

        /**
         * Specifies that data will be checked with all of <b>2D</b> barcode symbologies
         */
        TYPES_2D: 98,

        /**
         * Specifies that data will be checked with all available symbologies
         */
        ALL_SUPPORTED_TYPES: 99,

        javaClassName: "com.aspose.mw.barcode.recognition.MwDecodeTypeUtils",

        /**
         * Determines if the specified BaseDecodeType contains any 1D barcode symbology
         * @param symbology
         * @return true if BaseDecodeType contains any 1D barcode symbology; otherwise, returns false
         */
        is1D(symbology)
        {
            let javaClass = new java(DecodeType.javaClassName);
            return javaClass.is1DSync(symbology);
        },

        /**
         * Determines if the specified BaseDecodeType contains any Postal barcode symbology
         * @param symbology BaseDecodeType to test
         * @return true if BaseDecodeType contains any Postal barcode symbology; otherwise, returns false
         */
        isPostal(symbology)
        {
            let javaClass = new java(DecodeType.javaClassName);
            return javaClass.isPostalSync(symbology);
        },

        /**
         * Determines if the specified BaseDecodeType contains any 2D barcode symbology
         * @param symbology BaseDecodeType to test.
         * @return true if BaseDecodeType contains any 2D barcode symbology; otherwise, returns false
         */
        is2D(symbology)
        {
            let javaClass = new java(DecodeType.javaClassName);
            return javaClass.is2DSync(symbology);
        },

        containsAny(decodeType, ...decodeTypes)
        {
            let javaClass = new java(DecodeType.javaClassName);
            return javaClass.containsAnySync(...decodeTypes);
        }
    };

/**
 * Contains types of Code128 subset
 * @enum
 */
Code128SubType =
    {
        /**
         * ASCII characters 00 to 95 (0–9, A–Z and control codes), special characters, and FNC 1–4 ///
         */
        CODE_SET_A: 1,

        /**
         * ASCII characters 32 to 127 (0–9, A–Z, a–z), special characters, and FNC 1–4 ///
         */
        CODE_SET_B: 2,

        /**
         * 00–99 (encodes two digits with a single code point) and FNC1 ///
         */
        CODE_SET_C: 3,
    };

/**
 * Defines the interpreting type(C_TABLE or N_TABLE) of customer information for AustralianPost BarCode.
 * @example
 * let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "5912345678ABCde");
 * generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.C_TABLE);
 * image = generator.generateBarCodeImage();
 * let reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
 * reader.setCustomerInformationInterpretingType(CustomerInformationInterpretingType.C_TABLE);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *     console.log("BarCode Type: " + result.getCodeType());
 *     console.log("BarCode CodeText: " + result.getCodeText());
 * });
 *
 *@example
 *  generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "59123456781234567");
 *  generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.N_TABLE);
 *  image = generator.generateBarCodeImage();
 *  reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
 *  reader.setCustomerInformationInterpretingType(CustomerInformationInterpretingType.N_TABLE);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *     console.log("BarCode Type: " + result.getCodeType());
 *     console.log("BarCode CodeText: " + result.getCodeText());
 * });
 *
 * @example
 * let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "59123456780123012301230123");
 * generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.OTHER);
 * image = generator.generateBarCodeImage();
 * let reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
 * reader.CustomerInformationInterpretingType = CustomerInformationInterpretingType.OTHER);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode Type: " + result.getCodeType());
 *    console.log("BarCode CodeText: " + result.getCodeText());
 * });
 *
 * @enum
 */
CustomerInformationInterpretingType =
    {

        /**
         * Use C_TABLE to interpret the customer information. Allows A..Z, a..z, 1..9, space and # sing.
         *
         * @example
         * let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "5912345678ABCde");
         * generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.C_TABLE);
         * let image = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
         * let reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
         * reader.setCustomerInformationInterpretingType(CustomerInformationInterpretingType.C_TABLE);
         * reader.readBarCodes().forEach(function(result, i, results)
         * {
         *     console.log("BarCode Type: " + result.getCodeType());
         *     console.log("BarCode CodeText: " + result.getCodeText());
         * });
         */
        C_TABLE: 0,

        /**
         * Use N_TABLE to interpret the customer information. Allows digits.
         *
         * @example
         *  let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "59123456781234567");
         *  generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.N_TABLE);
         *  let image = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
         *  let reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
         *  reader.setCustomerInformationInterpretingType(CustomerInformationInterpretingType.N_TABLE);
         *  reader.readBarCodes().forEach(function(result, i, results)
         *  {
         *     console.log("BarCode Type: " + result.getCodeType());
         *     console.log("BarCode CodeText: " + result.getCodeText());
         *  });
         */
        N_TABLE: 1,
        /**
         * Do not interpret the customer information. Allows 0, 1, 2 or 3 symbol only.
         *
         * @example
         * let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "59123456780123012301230123");
         * generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.OTHER);
         * let image = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
         * let reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
         * reader.setCustomerInformationInterpretingType(CustomerInformationInterpretingType.OTHER));
         * reader.readBarCodes().forEach(function(result, i, results)
         * {
         *    console.log("BarCode Type: " + result.getCodeType());
         *    console.log("BarCode CodeText: " + result.getCodeText());
         * });
         */
        OTHER: 2,
    };

/**
 * Contains recognition confidence level
 *
 * @example
 * //This sample shows how BarCodeConfidence changed, depending on barcode type
 * //Moderate confidence
 * let generator = new BarcodeGenerator(EncodeTypes.CODE_128, "12345");
 * generator.save("test.png");
 * let reader = new BarCodeReader("test.png", null,  [DecodeType.CODE_39_STANDARD, DecodeType.CODE_128]);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    console.log("BarCode Type: " + result.getCodeTypeName());
 *    console.log("BarCode CodeText: " + result.getCodeText());
 *    console.log("BarCode Confidence: " + result.getConfidence());
 *    console.log("BarCode ReadingQuality: " + result.getReadingQuality());
 * });
 *
 * @example
 * //Strong confidence
 * let generator = new BarcodeGenerator(EncodeTypes.QR, "12345");
 * generator.save("test.png");
 * let reader = new BarCodeReader("test.png", null,  [DecodeType.CODE_39_STANDARD, DecodeType.QR]);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *     console.log("BarCode Type: " + result.getCodeTypeName());
 *     console.log("BarCode CodeText: " + result.getCodeText());
 *     console.log("BarCode Confidence: " + result.getConfidence());
 *     console.log("BarCode ReadingQuality: " + result.getReadingQuality());
 * });
 *
 * @enum
 */
BarCodeConfidence =
    {
        /**
         * Recognition confidence of barcode where codetext was not recognized correctly or barcode was detected as posible fake
         */
        NONE: 0,

        /**
         * Recognition confidence of barcode (mostly 1D barcodes) with weak checksumm or even without it. Could contains some misrecognitions in codetext<br>
         * or even fake recognitions if  is low
         *
         * @see BarCodeResult.ReadingQuality
         */
        MODERATE: 80,

        /**
         * Recognition confidence which was confirmed with BCH codes like Reed–Solomon. There must not be errors in read codetext or fake recognitions
         */
        STRONG: 100
    };

/**
 * Enable checksum validation during recognition for 1D barcodes.
 *
 *     Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.
 *
 *     Checksum never used: Codabar
 *
 * Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN
 *
 * Checksum always used: Rest symbologies
 *
 * This sample shows influence of ChecksumValidation on recognition quality and results
 *       \code
 * generator = BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128")
 * generator.save("test.png", BarCodeImageFormat.PNG)
 * reader = Recognition.BarCodeReader("test.png", None, DecodeType.EAN_13)
 * #checksum disabled
 * reader.setChecksumValidation(ChecksumValidation.OFF)
 * for result in reader.readBarCodes():
 * print("BarCode CodeText: " + result.getCodeText())
 * print("BarCode Value: " + result.getExtended().getOneD().getValue())
 * print("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum())
 *
 *       \endcode
 *       \code
 * reader = Recognition.BarCodeReader("test.png", None, DecodeType.EAN_13)
 * #checksum enabled
 * reader.setChecksumValidation(ChecksumValidation.ON)
 * for result in reader.readBarCodes():
 * print("BarCode CodeText: " + result.getCodeText())
 * print("BarCode Value: " + result.getExtended().getOneD().getValue())
 * print("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum())
 *      \endcode
 *
 */
ChecksumValidation =
    {

    /**
     * If checksum is required by the specification - it will be validated.
     */

    DEFAULT: 0,

    /**
    * Always validate checksum if possible.
    */
    ON: 1,

    /**
    * Do not validate checksum
    */
    OFF: 2
}

/**
 * <p>
 *  <p>
 *  Deconvolution (image restorations) mode which defines level of image degradation. Originally deconvolution is a function which can restore image degraded
 *  (convoluted) by any natural function like blur, during obtaining image by camera. Because we cannot detect image function which corrupt the image,
 *  we have to check most well know functions like sharp or mathematical morphology.
 *  </p>
 *  </p><p><hr><blockquote><pre>
 *  This sample shows how to use Deconvolution mode
 *  <pre>
 *  let reader = new BarCodeReader("test.png", null, [DecodeType.CODE_39_EXTENDED, DecodeType.CODE_128]);
 *  reader.getQualitySettings().setDeconvolution(DeconvolutionMode.SLOW);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *     console.log("BarCode CodeText: " + result.getCodeText());
 *  });
 * 	</pre>
 *  </pre></blockquote></hr></p>
 */
DeconvolutionMode =
    {
    /**
     * <p>Enables fast deconvolution methods for high quality images.</p>
     */
    FAST: 0,
    /**
     * <p>Enables normal deconvolution methods for common images.</p>
     */
    NORMAL: 1,
    /**
     * <p>Enables slow deconvolution methods for low quality images.</p>
     */
    SLOW: 2
};
/**
 * <p>
 * <p>
 * Mode which enables or disables additional recognition of barcodes on images with inverted colors (luminance).
 * </p>
 * </p><p><hr><blockquote><pre>
 *  This sample shows how to use InverseImage mode
 *  <pre>
 *
 *  let reader = new BarCodeReader("test.png", null, [DecodeType.CODE_39_EXTENDED, DecodeType.CODE_128]);
 *  reader.getQualitySettings().setInverseImage(InverseImageMode.ENABLED);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *     console.log("BarCode CodeText: " + result.getCodeText());
 *  });
 * 	</pre>
 *  </pre></blockquote></hr></p>
 */
InverseImageMode =
{
    /**
     * <p>At this time the same as Disabled. Disables additional recognition of barcodes on inverse images.</p>
     */
    AUTO: 0,
    /**
     * <p>Disables additional recognition of barcodes on inverse images.</p>
     */
    DISABLED: 1,
    /**
     * <p>Enables additional recognition of barcodes on inverse images</p>
     */
    ENABLED: 2
};

/**
 * <p>
 *  <p>
 *  Recognition mode which sets size (from 1 to infinity) of barcode minimal element: matrix cell or bar.
 *  </p>
 *  </p><p><hr><blockquote><pre>
 *  This sample shows how to use XDimension mode
 *  <pre>
 *  let reader = new BarCodeReader("test.png", null, [DecodeType.CODE_39_EXTENDED, DecodeType.CODE_128]);
 *  reader.getQualitySettings().setXDimension(XDimensionMode.SMALL);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *     console.log("BarCode CodeText: " + result.getCodeText());
 *  });
 * 	</pre>
 *  </pre></blockquote></hr></p>
 */
XDimensionMode =
{
    /**
     * <p>Value of XDimension is detected by AI (SVM). At this time the same as Normal</p>
     */
    AUTO: 0,
    /**
     * <p>Detects barcodes with small XDimension in 1 pixel or more with quality from BarcodeQuality</p>
     */
    SMALL: 1,
    /**
     * <p>Detects barcodes with classic XDimension in 2 pixels or more with quality from BarcodeQuality or high quality barcodes.</p>
     */
    NORMAL: 2,
    /**
     * <p>Detects barcodes with large XDimension with quality from BarcodeQuality captured with high-resolution cameras.</p>
     */
    LARGE: 3,
    /**
     * <p>Detects barcodes from size set in MinimalXDimension with quality from BarcodeQuality</p>
     */
    USE_MINIMAL_X_DIMENSION: 4
}

/**
 * <p>
 *  <p>
 *  Mode which enables or disables additional recognition of color barcodes on color images.
 *  </p>
 *  </p><p><hr><blockquote><pre>
 *  This sample shows how to use ComplexBackground mode
 *  <pre>
 *  let reader = new BarCodeReader("test.png", null, [DecodeType.CODE_39_EXTENDED, DecodeType.CODE_128]);
 *  reader.getQualitySettings().setComplexBackground(ComplexBackgroundMode.ENABLED);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *     console.log("BarCode CodeText: " + result.getCodeText());
 *  });
 * 	</pre>
 *  </pre></blockquote></hr></p>
 */
ComplexBackgroundMode =
{
    /**
     * <p>At this time the same as Disabled. Disables additional recognition of color barcodes on color images.</p>
     */
    AUTO: 0,
    /**
     * <p>Disables additional recognition of color barcodes on color images.</p>
     */
    DISABLED: 1,
    /**
     * <p>Enables additional recognition of color barcodes on color images.</p>
     */
    ENABLED: 2

}

/**
 * <p>
 *  <p>
 *  Mode which enables methods to recognize barcode elements with the selected quality. Barcode element with lower quality requires more hard methods which slows the recognition.
 *  </p>
 *  </p><p><hr><blockquote><pre>
 *  This sample shows how to use BarcodeQuality mode
 *  <pre>
 *  let reader = new BarCodeReader("test.png", null, [DecodeType.CODE_39_EXTENDED, DecodeType.CODE_128]);
 *  reader.getQualitySettings().setBarcodeQuality(BarcodeQualityMode.LOW);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *     console.log("BarCode CodeText: " + result.getCodeText());
 *  });
 * 	</pre>
 *  </pre></blockquote></hr></p>
 */
BarcodeQualityMode =
{
    /**
     * <p>Enables recognition methods for High quality barcodes.</p>
     */
    HIGH: 0,
    /**
     * <p>Enables recognition methods for Common(Normal) quality barcodes.</p>
     */
    NORMAL: 1,
    /**
     * <p>Enables recognition methods for Low quality barcodes.</p>
     */
    LOW: 2
}

module.exports = {
    BarCodeReader,
    Quadrangle,
    QRExtendedParameters,
    Pdf417ExtendedParameters,
    OneDExtendedParameters,
    Code128ExtendedParameters,
    DecodeType,
    ChecksumValidation,
    BarCodeResult,
    BarCodeRegionParameters,
    BarCodeExtendedParameters,
    QualitySettings,
    BarCodeConfidence,
    Code128SubType,
    Code128DataPortion,
    DataBarExtendedParameters,
    AustraliaPostSettings,
    BarcodeSettings,
    CustomerInformationInterpretingType,
    RecognitionAbortedException,
    DotCodeExtendedParameters,
    DataMatrixExtendedParameters,
    GS1CompositeBarExtendedParameters,
    DeconvolutionMode,
    InverseImageMode,
    XDimensionMode,
    ComplexBackgroundMode,
    BarcodeQualityMode
};