Package jjil.core

Examples of jjil.core.Error


     * @param image the input Gray8Image
     * @throws jjil.core.Error if the input is not a Gray8Image.
     */
    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


     * @param cSigma the new sigma value
     * @throws jjil.core.Error if cSigma is out of range.
     */
    public void setSigma(int cSigma) throws jjil.core.Error {
        if (cSigma <= 1 || cSigma >= this.nCoeff.length) {
            throw new Error(
              Error.PACKAGE.ALGORITHM,
              ErrorCodes.PARAMETER_OUT_OF_RANGE,
              new Integer(cSigma).toString(),
              new Integer(1).toString(),
              new Integer(this.nCoeff.length).toString());
View Full Code Here

     * or the input image size is larger than the target size. This class
     * does not do subsampling, only interpolation.
     */
    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);
        }
        if (image.getWidth() > this.cWidth || image.getHeight() > this.cHeight) {
            throw new Error(
                  Error.PACKAGE.ALGORITHM,
                  ErrorCodes.STRETCH_OUTPUT_SMALLER_THAN_INPUT,
                  image.toString(),
                  new Integer(this.cWidth).toString(),
                  new Integer(this.cHeight).toString());
View Full Code Here

     * @param cHeight the new target height.
     * @throws jjil.core.Error if height is not positive
     */
    public void setHeight(int cHeight) throws jjil.core.Error {
        if (cHeight <= 0) {
            throw new Error(
              Error.PACKAGE.ALGORITHM,
              ErrorCodes.OUTPUT_IMAGE_SIZE_NEGATIVE,
              new Integer(cHeight).toString(),
              null,
              null);
View Full Code Here

     * @param cWidth the new target width.
     * @throws jjil.core.Error if height is not positive
     */
    public void setWidth(int cWidth) throws jjil.core.Error {
        if (cWidth <= 0) {
            throw new Error(
                    Error.PACKAGE.ALGORITHM,
                    ErrorCodes.OUTPUT_IMAGE_SIZE_NEGATIVE,
                    new Integer(cWidth).toString(),
                    null,
                    null);
View Full Code Here

     *    extends outside the input image, or the input image
     *    is not a Gray16Image.
     */
    public void push(Image image) throws jjil.core.Error {
        if (!(image instanceof Gray16Image)) {
            throw new Error(
                      Error.PACKAGE.ALGORITHM,
                      ErrorCodes.IMAGE_NOT_GRAY16IMAGE,
                      image.toString(),
                      null,
                      null);
        }
        Gray16Image imageInput = (Gray16Image) image;
        if (this.cX + this.cWidth > image.getWidth() ||
            this.cY + this.cHeight > image.getHeight()) {
            throw new Error(
                            Error.PACKAGE.CORE,
                            jjil.core.ErrorCodes.BOUNDS_OUTSIDE_IMAGE,
                            image.toString(),
                            this.toString(),
                            null);
View Full Code Here

            int x,
            int y,
            int width,
            int height) throws jjil.core.Error {
        if (x<0 || y<0) {
            throw new Error(
                            Error.PACKAGE.CORE,
                            jjil.core.ErrorCodes.BOUNDS_OUTSIDE_IMAGE,
                            new Integer(x).toString(),
                            new Integer(y).toString(),
                            null);
        }
        if (width<=0 || height<=0) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.INPUT_IMAGE_SIZE_NEGATIVE,
                            new Integer(width).toString(),
                            new Integer(height).toString(),
                            null);
View Full Code Here

            int cMaxX,
            int cMinSlope,
            int cMaxSlope,
            int cSteps) throws jjil.core.Error {
        if (cMaxX < cMinX) {
            throw new Error(
                      Error.PACKAGE.ALGORITHM,
                      ErrorCodes.PARAMETER_RANGE_NULL_OR_NEGATIVE,
                      new Integer(cMinX).toString(),
                      new Integer(cMaxX).toString(),
                      null);
        }
        this.cMinX = cMinX;
        this.cMaxX = cMaxX;
        if (cMaxSlope < cMinSlope) {
            throw new Error(
                      Error.PACKAGE.ALGORITHM,
                      ErrorCodes.PARAMETER_RANGE_NULL_OR_NEGATIVE,
                      new Integer(cMinSlope).toString(),
                      new Integer(cMaxSlope).toString(),
                      null);
        }
        if (cSteps <= 0) {
            throw new Error(
                      Error.PACKAGE.ALGORITHM,
                      ErrorCodes.PARAMETER_OUT_OF_RANGE,
                      new Integer(cSteps).toString(),
                      new Integer(1).toString(),
                      new Integer(Integer.MAX_VALUE).toString());
View Full Code Here

        /* 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,
                          ErrorCodes.OBJECT_NOT_EXPECTED_TYPE,
                          o.toString(),
                          "Point",
                          null);
View Full Code Here

    public RgbImage push(
            RgbImage imRgb,
            Gray8Image imMask) throws jjil.core.Error {
        if (imRgb.getWidth() != imMask.getWidth() ||
            imRgb.getHeight() != imMask.getHeight()) {
            throw new Error(
                            Error.PACKAGE.CORE,
                            jjil.core.ErrorCodes.IMAGE_MASK_SIZE_MISMATCH,
                            imRgb.toString(),
                            imMask.toString(),
                            null);
View Full Code Here

TOP

Related Classes of jjil.core.Error

Copyright © 2018 www.massapicom. 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.