Package net.sourceforge.jiu.ops

Examples of net.sourceforge.jiu.ops.MissingParameterException


   */
  public void ensureInputImageIsAvailable() throws MissingParameterException
  {
    if (getInputImage() == null)
    {
      throw new MissingParameterException("Input image missing.");
    }
  }
View Full Code Here


      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.");
    }
View Full Code Here

    WrongParameterException
  {
    PixelImage pin = getInputImage();
    if (pin == null)
    {
      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.");
    }
    if (outHeight == null)
    {
      throw new MissingParameterException("Output height value missing.");
    }
    ensureImagesHaveSameResolution();
    process((IntegerImage)pin, (IntegerImage)getOutputImage());
  }
View Full Code Here

            "index " + getImageIndex() + " is thus not valid.");
        }
        InputStream input = getInputStream();
        if (input == null)
        {
          throw new MissingParameterException("InputStream object missing.");
        }
        checksum = new CRC32();
        checkedIn = new CheckedInputStream(input, checksum);
        in = new DataInputStream(checkedIn);
        load();
      }
      catch (IOException ioe)
      {
        throw new OperationFailedException("I/O failure: " + ioe.toString());
      }
    }
    else
    if (getMode() == CodecMode.SAVE)
    {
      try
      {
        PixelImage image = getImage();
        if (image == null)
        {
          throw new MissingParameterException("Need image for saving.");
        }
        out = getOutputAsDataOutput();
        if (out == null)
        {
          throw new MissingParameterException("Could not retrieve non-null DataOutput object for saving.");
        }
        setBoundsIfNecessary(image.getWidth(), image.getHeight());
        save();
      }
      catch (IOException ioe)
View Full Code Here

    WrongParameterException
  {
    PixelImage image = getImage();
    if (image == null)
    {
      throw new MissingParameterException("No image available for saving.");
    }
    width = image.getWidth();
    height = image.getHeight();
    setBoundsIfNecessary(width, height);
    width = getBoundsWidth();
    height = getBoundsHeight();
    if (image instanceof Paletted8Image)
    {
      Palette palette = ((Paletted8Image)image).getPalette();
      int numEntries = palette.getNumEntries();
      if (numEntries < 1 || numEntries > 256)
      {
        throw new WrongParameterException("Palette of image to be saved must have 1..256 entries.");
      }
      bitsPerPixel = 8;
      // determine minimum number of bits per pixel necessary to store image
      for (int i = 1; i <= 8; i++)
      {
        if ((1 << i) >= numEntries)
        {
          bitsPerPixel = i;
          break;
        }
      }
    }
    else
    if (image instanceof Gray8Image)
    {
      bitsPerPixel = 8;
    }
    else
    if (image instanceof BilevelImage)
    {
      bitsPerPixel = 1;
    }
    else
    {
      throw new UnsupportedTypeException("Unsupported image type: " + image.getClass().getName());
    }
    out = getOutputAsDataOutput();
    if (out == null)
    {
      throw new MissingParameterException("Output stream / random access file parameter missing.");
    }
    // now write the output stream
    try
    {
      writeStream();
View Full Code Here

    WrongFileFormatException
  {
    in = getInputAsDataInput();
    if (in == null)
    {
      throw new MissingParameterException("Input stream / random access file parameter missing.");
    }
    // now write the output stream
    try
    {
      loadHeader();
View Full Code Here

    // 1 image to be saved
    // 1.1 is it available?
    PixelImage image = getImage();
    if (image == null)
    {
      throw new MissingParameterException("No image available.");
    }
    // 1.2 is it supported?
    if (!(image instanceof Paletted8Image ||
          image instanceof Gray8Image ||
          image instanceof BilevelImage ||
          image instanceof RGB24Image))
    {
      throw new UnsupportedTypeException("Unsupported image type: " + image.getClass().getName());
    }
    // 2 is output stream available?
    out = getOutputAsDataOutput();
    if (out == null)
    {
      throw new MissingParameterException("Output stream / random access file parameter missing.");
    }
    // now write the output stream
    try
    {
      writeStream();
View Full Code Here

    WrongFileFormatException
  {
    in = getInputAsDataInput();
    if (in == null)
    {
      throw new MissingParameterException(
        "Input object missing (could not retrieve via getAsDataInput).");
    }
    try
    {
      // read and check the first two bytes
View Full Code Here

  {
    // get image, set bounds if necessary and check existing bounds
    PixelImage image = getImage();
    if (image == null)
    {
      throw new MissingParameterException("Need image to save.");
    }
    setBoundsIfNecessary(image.getWidth(), image.getHeight());
    checkBounds(image.getWidth(), image.getHeight());
    // get output object
    DataOutput out = getOutputAsDataOutput();
    if (out == null)
    {
      throw new MissingParameterException("Could not get DataOutput object when saving in Palm file format.");
    }
    // initialize fields to be written to the header
    width = getBoundsWidth();
    height = getBoundsHeight();
    flags = 0;
View Full Code Here

      if (getMode() == CodecMode.LOAD)
      {
        in = getInputAsDataInput();
        if (in == null)
        {
          throw new MissingParameterException("Input stream / file missing.");
        }
        load();
      }
      else
      {
View Full Code Here

TOP

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

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.