Package net.sourceforge.jiu.data

Examples of net.sourceforge.jiu.data.PixelImage


  public void process() throws
    MissingParameterException,
    WrongParameterException
  {
    ensureInputImageIsAvailable();
    PixelImage in = getInputImage();
    ensureOutputImageResolution(computeNewImageWidth(in.getWidth(), in.getHeight(), getAngle()), in.getHeight());
    if (in instanceof IntegerImage)
    {
      process((IntegerImage)in, (IntegerImage)getOutputImage());
    }
    else
View Full Code Here


    WrongParameterException
  {
    ensureInputImageIsAvailable();
    if (outWidth == null && outHeight == null && getOutputImage() != null)
    {
      PixelImage out = getOutputImage();
      outWidth = new Integer(out.getWidth());
      outHeight = new Integer(out.getHeight());
    }
    if (outWidth == null)
    {
      throw new MissingParameterException("Output width has not been initialized");
    }
    if (outHeight == null)
    {
      throw new MissingParameterException("Output height has not been initialized");
    }
    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)
View Full Code Here

  public void prepareImages() throws
    MissingParameterException,
    WrongParameterException
  {
    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

  private void loadBilevelImage() throws
    InvalidFileStructureException,
    IOException,
    WrongParameterException
  {
    PixelImage image = getImage();
    if (image == null)
    {
      setImage(new MemoryBilevelImage(getBoundsWidth(), getBoundsHeight()));
    }
    else
View Full Code Here

  private void loadGrayImage() throws InvalidFileStructureException, IOException, UnsupportedTypeException
  {
    final int WIDTH = getBoundsWidth();
    final int HEIGHT = getBoundsHeight();
    PixelImage pimage = getImage();
    if (pimage == null)
    {
      if (maxSample < 256)
      {
        pimage = new MemoryGray8Image(WIDTH, HEIGHT);
View Full Code Here

    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))
View Full Code Here

    MissingParameterException,
    WrongParameterException
  {
    ensureInputImageIsAvailable();
    ensureImagesHaveSameResolution();
    PixelImage in = getInputImage();
    if (in instanceof IntegerImage)
    {
      process((IntegerImage)in, (IntegerImage)getOutputImage());
    }
    else
View Full Code Here

   * @throws WrongParameterException if input and output images exist and their
   *  resolutions differ
   */
  public void ensureImagesHaveSameResolution() throws WrongParameterException
  {
    PixelImage in = getInputImage();
    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

   * @param height the vertical pixel resolution that the output image must have
   * @throws WrongParameterException if the resolutions differ
   */
  public void ensureOutputImageResolution(int width, int height) throws 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

  public void process() throws
    MissingParameterException,
    WrongParameterException
  {
    PixelImage pin = getInputImage();
    if (pin == null)
    {
      throw new MissingParameterException("Input image object missing.");
    }
    if (!(pin instanceof IntegerImage))
View Full Code Here

TOP

Related Classes of net.sourceforge.jiu.data.PixelImage

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.