Package net.sourceforge.jiu.ops

Examples of net.sourceforge.jiu.ops.WrongParameterException


    PixelImage out = getOutputImage();
    if (out != null)
    {
      if (out.getWidth() != width)
      {
        throw new WrongParameterException("Output image must have width " + width + " (got: " + out.getWidth() + ").");
      }
      if (out.getHeight() != height)
      {
        throw new WrongParameterException("Output image must have height " + height + " (got: " + out.getHeight() + ").");
      }
    }
  }
View Full Code Here


    {
      process((IntegerImage)in, (IntegerImage)getOutputImage());
    }
    else
    {
      throw new WrongParameterException("Input image must implement IntegerImage.");
    }
  }
View Full Code Here

  {
    ensureInputImageIsAvailable();
    PixelImage in = getInputImage();
    if (!(in instanceof IntegerImage))
    {
      throw new WrongParameterException("Input image must be of type IntegerImage.");
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      out = in.createCompatibleImage(in.getWidth(), in.getHeight());
      setOutputImage(out);
    }
    else
    {
      if (in.getNumChannels() != out.getNumChannels())
      {
        throw new WrongParameterException("Output image must have same number of channels as input image.");
      }
      ensureImagesHaveSameResolution();
    }
  }
View Full Code Here

    }
    PixelImage image = getInputImage();
    if (image.getWidth() == outWidth.intValue() &&
        image.getHeight() == outHeight.intValue())
    {
      throw new WrongParameterException("Input image already has the size specified by setSize.");
    }
    ensureOutputImageResolution(outWidth.intValue(), outHeight.intValue());
    if (image instanceof IntegerImage)
    {
      process((IntegerImage)image, (IntegerImage)getOutputImage());
    }
    else
    {
      throw new WrongParameterException("Input image must implement IntegerImage.");
    }
  }
View Full Code Here

    {
      process((IntegerImage)in, (IntegerImage)getOutputImage());
    }
    else
    {
      throw new WrongParameterException("Input image must be of type IntegerImage.");
    }
  }
View Full Code Here

    PixelImage out = getOutputImage();
    if (in != null && out != null)
    {
      if (in.getWidth() != out.getWidth())
      {
        throw new WrongParameterException("Input and output image must have the same width.");
      }
      if (in.getHeight() != out.getHeight())
      {
        throw new WrongParameterException("Input and output image must have the same height.");
      }
    }
  }
View Full Code Here

    PixelImage out = getOutputImage();
    if (out != null)
    {
      if (out.getWidth() != width)
      {
        throw new WrongParameterException("Output image must have width " + width + " (got: " + out.getWidth() + ").");
      }
      if (out.getHeight() != height)
      {
        throw new WrongParameterException("Output image must have height " + height + " (got: " + out.getHeight() + ").");
      }
    }
  }
View Full Code Here

    }
    else
    {
      if (!(image instanceof BilevelImage))
      {
        throw new WrongParameterException("Specified input image must implement BilevelImage for this image type.");
      }
    }
    if (getAscii().booleanValue())
    {
      loadBilevelImageAscii();
View Full Code Here

    WrongParameterException
  {
    out = getOutputAsDataOutput();
    if (out == null)
    {
      throw new WrongParameterException("Cannot get a DataOutput object to use for saving.");
    }
    PixelImage pi = getImage();
    if (pi == null)
    {
      throw new MissingParameterException("Input image missing.");
    }
    if (!(pi instanceof IntegerImage))
    {
      throw new WrongParameterException("Input image must implement IntegerImage.");
    }
    IntegerImage image = (IntegerImage)pi;
    width = image.getWidth();
    height = image.getHeight();
    setBoundsIfNecessary(width, height);
    if (image instanceof RGB24Image)
    {
      imageType = IMAGE_TYPE_COLOR;
      maxSample = 255;
      save((RGB24Image)image);
    }
    else
    if (image instanceof RGB48Image)
    {
      imageType = IMAGE_TYPE_COLOR;
      maxSample = 65535;
      save((RGB48Image)image);
    }
    else
    if (image instanceof BilevelImage)
    {
      imageType = IMAGE_TYPE_BILEVEL;
      maxSample = 1;
      save((BilevelImage)image);
    }
    else
    if (image instanceof Gray8Image)
    {
      imageType = IMAGE_TYPE_GRAY;
      maxSample = 255;
      save((Gray8Image)image);
    }
    else
    if (image instanceof Gray16Image)
    {
      imageType = IMAGE_TYPE_GRAY;
      maxSample = 65535;
      save((Gray16Image)image);
    }
    else
    {
      throw new WrongParameterException("Unsupported input image type: " +
        image.getClass().getName());
    }
    close();
  }
View Full Code Here

    {
      throw new MissingParameterException("Input image object missing.");
    }
    if (!(pin instanceof IntegerImage))
    {
      throw new WrongParameterException("ScaleReplication only works on IntegerImage objects.");
    }
    if (outWidth == null)
    {
      throw new MissingParameterException("Output width value missing.");
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.jiu.ops.WrongParameterException

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.