Examples of Error


Examples of jjil.core.Error

     * @throws jjil.core.Error if the width or height is negative or zero.
     */
    public void setWindow(int cX, int cY, int nWidth, int nHeight)
      throws jjil.core.Error {
      if (nWidth <= 0 || nHeight <= 0) {
            throw new Error(
                Error.PACKAGE.ALGORITHM,
                ErrorCodes.OUTPUT_IMAGE_SIZE_NEGATIVE,
                new Integer(nWidth).toString(),
                new Integer(nHeight).toString(),
                null);
View Full Code Here

Examples of jjil.core.Error

     * @throws jjil.core.Error if the input image is not gray,
     * or the trapezoid already specified extends outside its bounds.
     */
    public void push(Image image) throws jjil.core.Error {
        if (!(image instanceof Gray8Image)) {
            throw new Error(
            Error.PACKAGE.ALGORITHM,
            ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
            image.toString(),
            null,
            null);
View Full Code Here

Examples of jjil.core.Error

     * @throws jjil.core.Error if the warp is not 2x3 or the warp is not
     * decomposable (warp[0][0] or warp[1][1] is 0).
     */
    public void setWarp(double[][] warp) throws jjil.core.Error {
        if (warp.length != 2 || warp[0].length != 3 || warp[1].length != 3) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_WRONG_SIZE,
                            warp.toString(),
                            null,
                            null);
        }
        double fDivisorY = warp[0][0] * warp[1][1] - warp[0][1] * warp[1][0];
        if (warp[0][0] == 0.0d || warp[1][1] == 0.0d || fDivisorY == 0.0d) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_OUT_OF_RANGE,
                            warp.toString(),
                            null,
                            null);
View Full Code Here

Examples of jjil.core.Error

            int cYSteps,
            double cMinSlope,
            double cMaxSlope,
            int cSlopeSteps) throws jjil.core.Error {
        if (cMaxY < cMinY) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_RANGE_NULL_OR_NEGATIVE,
                            new Integer(cMinY).toString(),
                            new Integer(cMaxY).toString(),
                            null);
        }
        this.cMinY = cMinY;
        this.cMaxY = cMaxY;
        if (cMaxSlope < cMinSlope) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_RANGE_NULL_OR_NEGATIVE,
                            new Double(cMinSlope).toString(),
                            new Double(cMaxSlope).toString(),
                            null);
        }
        if (cSlopeSteps <= 0) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_OUT_OF_RANGE,
                            new Integer(cSlopeSteps).toString(),
                            new Integer(1).toString(),
                            new Integer(Integer.MAX_VALUE).toString());
        }
        if (cYSteps <= 0) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_OUT_OF_RANGE,
                            new Integer(cYSteps).toString(),
                            new Integer(1).toString(),
                            new Integer(Integer.MAX_VALUE).toString());
View Full Code Here

Examples of jjil.core.Error

        /* fill the Hough accumulator
         */
        for (Enumeration e = points.elements(); e.hasMoreElements();) {
            Object o = e.nextElement();
            if (!(o instanceof Point)) {
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                jjil.algorithm.ErrorCodes.OBJECT_NOT_EXPECTED_TYPE,
                                o.toString(),
                                "Point",
                                null);
View Full Code Here

Examples of jjil.core.Error

    public void detect(Gray8Image imGray) throws jjil.core.Error {
        this.rc = new RectCollection();
       
        if (imGray.getWidth() < this.hcc.getWidth() ||
            imGray.getHeight() < this.hcc.getHeight()) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.IMAGE_TOO_SMALL,
                            imGray.toString(),
                            this.hcc.toString(),
                            null);
View Full Code Here

Examples of jjil.core.Error

    {
        Gray8Image imGray;
        if (image instanceof Gray8Image) {
            imGray = (Gray8Image) image;
        } else {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                            image.toString(),
                            null,
                            null);
View Full Code Here

Examples of jjil.core.Error

     * @throws jjil.core.Error if the input image is not gray.
     */
    public void push(Image image) throws jjil.core.Error
    {
        if (!(image instanceof Gray8Image)) {
            throw new Error(
                      Error.PACKAGE.ALGORITHM,
                      ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                      image.toString(),
                      null,
                      null);
View Full Code Here

Examples of jjil.core.Error

     * @return the standard deviation, times 256.
     * @throws jjil.core.Error if the variance computed in push() is less than zero.
     */
    public float getStdDev() throws jjil.core.Error {
        float f = getVariance(); // getVariance()
        if (f < 0) throw new Error(
                  Error.PACKAGE.ALGORITHM,
                  ErrorCodes.STATISTICS_VARIANCE_LESS_THAN_ZERO,
                  new Float(f).toString(),
                  null,
                  null);
View Full Code Here

Examples of jjil.core.Error

        String szInt = "";
        STATE_INT state = STATE_INT.BEGIN;
        int nChar = isr.read();
        do {
            if (nChar == -1) {
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.INPUT_TERMINATED_EARLY,
                                isr.toString(),
                                null,
                                null);
            }
            char c = (char) nChar;
            /**
             * Parse float using FSM
             * BEGIN -> DIGITS
             * DIGITS -> DIGITS
             */
            switch (state) {
                case BEGIN:
                    if (c == '-' || c == '+' || Character.isDigit(c)) {
                        szInt += c;
                        nChar = isr.read();
                        state = STATE_INT.DIGITS;
                    } else {
                        // parse error, no digits
                        throw new Error(
                                        Error.PACKAGE.ALGORITHM,
                                        ErrorCodes.PARSE_ERROR,
                                        isr.toString(),
                                        null,
                                        null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.