Package net.sourceforge.jiu.ops

Examples of net.sourceforge.jiu.ops.WrongParameterException


    {
      list = createColorList((RGB24Image)in);
    }
    else
    {
      throw new WrongParameterException("Input image must implement RGB24Image.");
    }
    root = new MedianCutNode(null, 0, list.getNumEntries() - 1);
    root.setMinColor(0, 0, 0);
    root.setMaxColor(maxValue, maxValue, maxValue);
    findPalette();
    if (doNotMap)
    {
      return;
    }
    PixelImage out = getOutputImage();
    if (getTruecolorOutput())
    {
      if (out == null)
      {
        out = in.createCompatibleImage(in.getWidth(), in.getHeight());
        setOutputImage(out);
      }
      else
      {
        if (!(out instanceof RGB24Image))
        {
          throw new WrongParameterException("Output image must implement RGB24Image.");
        }
      }
      mapImage((RGB24Image)in, (RGB24Image)out);
    }
    else
    {
      Palette palette = createPalette();
      if (out == null)
      {
        out = new MemoryPaletted8Image(in.getWidth(), in.getHeight(), palette);
        setOutputImage(out);
      }
      else
      {
        if (out instanceof Paletted8Image)
        {
          ((Paletted8Image)out).setPalette(palette);
        }
        else
        {
          throw new WrongParameterException("Output image must implement Paletted8Image.");
        }
      }
      mapImage((RGB24Image)in, (Paletted8Image)out);
    }
  }
View Full Code Here


        }
      }
    }
    else
    {
      throw new WrongParameterException("Not a supported or reducible image type: " + inputImage.toString());
    }
  }
View Full Code Here

  {
    ensureInputImageIsAvailable();
    PixelImage in = getInputImage();
    if (!(in instanceof RGB24Image))
    {
      throw new WrongParameterException("Input image must be of type RGB24Image.");
    }
    PixelImage out = getOutputImage();
    if (out != null && !(out instanceof Paletted8Image))
    {
      throw new WrongParameterException("Output image must be of type Paletted8Image.");
    }
    process((RGB24Image)in, (Paletted8Image)out);
  }
View Full Code Here

    }
    else
    {
      if (in.getClass() != out.getClass())
      {
        throw new WrongParameterException("Specified output image type must be the same as input image type.");
      }
      if (in.getWidth() != out.getWidth())
      {
        throw new WrongParameterException("Specified output image must have same width as input image.");
      }
      if (in.getHeight() != out.getHeight())
      {
        throw new WrongParameterException("Specified output image must have same height as input image.");
      }
    }
  }
View Full Code Here

    {
      process((IntegerImage)in);
    }
    else
    {
      throw new WrongParameterException("Input image type unsupported: " + in.toString());
    }
  }
View Full Code Here

        palette.put(i, i, i, i);
      }
    }
    else
    {
      throw new WrongParameterException("Unsupported input image type: " + in.getClass().getName());
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      setOutputImage(new MemoryPaletted8Image(in.getWidth(), in.getHeight(), palette));
    }
    else
    {
      if (!(out instanceof Paletted8Image))
      {
        throw new WrongParameterException("Specified output image type must be of class Paletted8Image; got " + in.getClass().getName());
      }
      if (in.getWidth() != out.getWidth())
      {
        throw new WrongParameterException("Specified output image must have same width as input image.");
      }
      if (in.getHeight() != out.getHeight())
      {
        throw new WrongParameterException("Specified output image must have same height as input image.");
      }
    }
  }
View Full Code Here

          (in instanceof Paletted8Image) ||
          (in instanceof Gray8Image)
         )
       )
    {
      throw new WrongParameterException("Unsupported input image type: " + in.getClass().getName());
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      setOutputImage(new MemoryRGB24Image(in.getWidth(), in.getHeight()));
    }
    else
    {
      if (!(out instanceof RGB24Image))
      {
        throw new WrongParameterException("Specified output image type must be of class RGB24Image; got " + in.getClass().getName());
      }
      if (in.getWidth() != out.getWidth())
      {
        throw new WrongParameterException("Specified output image must have same width as input image.");
      }
      if (in.getHeight() != out.getHeight())
      {
        throw new WrongParameterException("Specified output image must have same height as input image.");
      }
    }
  }
View Full Code Here

      return;
    }
    int x1 = getBoundsX1();
    if (x1 >= width)
    {
      throw new WrongParameterException("Codec bounds x1 (" + x1 +
        ") must be smaller than image width (" + width + ").");
    }
    int x2 = getBoundsX2();
    if (x2 >= width)
    {
      throw new WrongParameterException("Codec bounds x2 (" + x2 +
        ") must be smaller than image width (" + width + ").");
    }
    int y1 = getBoundsY1();
    if (y1 >= height)
    {
      throw new WrongParameterException("Codec bounds y1 (" + y1 +
        ") must be smaller than image height (" + height + ").");
    }
    int y2 = getBoundsY2();
    if (y2 >= height)
    {
      throw new WrongParameterException("Codec bounds y2 (" + y2 +
        ") must be smaller than image height (" + height + ").");
    }
  }
View Full Code Here

    PixelImage image = getImage();
    if (image != null)
    {
      if (image.getWidth() != getBoundsWidth())
      {
        throw new WrongParameterException("Specified input image must have width equal to getBoundsWidth().");
      }
      if (image.getHeight() != getBoundsHeight())
      {
        throw new WrongParameterException("Specified input image must have height equal to getBoundsHeight().");
      }
    }
  }
View Full Code Here

      {
        save();
      }
      else
      {
        throw new WrongParameterException("Could find neither objects for loading nor for saving.");
      }
    }
    catch (IOException ioe)
    {
      throw new OperationFailedException("I/O error in RAS codec: " + ioe.toString());
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.