Package net.sourceforge.jiu.ops

Examples of net.sourceforge.jiu.ops.WrongParameterException


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


         (
          (in instanceof BilevelImage)
         )
       )
    {
      throw new WrongParameterException("Unsupported input image type: " + in.getClass().getName());
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      setOutputImage(new MemoryGray8Image(in.getWidth(), in.getHeight()));
    }
    else
    {
      if (!(out instanceof Gray8Image))
      {
        throw new WrongParameterException("Specified output image type must be of class Gray8Image; 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

      {
        process((Gray8Image)in, (Gray8Image)out);
      }
      else
      {
        throw new WrongParameterException("Cannot handle gray bits other than 1..7.");
      }
    }
    else
    if (in instanceof RGB24Image)
    {
      init(templateData, in.getWidth());
      if (quantizer == null)
      {
        throw new MissingParameterException("No quantizer was specified.");
      }
      if (useTruecolorOutput)
      {
        process((RGB24Image)in, (RGB24Image)out);
      }
      else
      {
        process((RGB24Image)in, (Paletted8Image)out);
      }
    }
    else
    {
      throw new WrongParameterException("Cannot handle this image: " + in.toString());
    }
  }
View Full Code Here

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

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

          (in instanceof BilevelImage) ||
          (in instanceof Gray8Image)
         )
       )
    {
      throw new WrongParameterException("Unsupported input image type: " + in.getClass().getName());
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      setOutputImage(new MemoryGray16Image(in.getWidth(), in.getHeight()));
    }
    else
    {
      if (!(out instanceof Gray16Image))
      {
        throw new WrongParameterException("Specified output image type must be of class Gray16Image; 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

    }
    ensureInputImageIsAvailable();
    PixelImage in = getInputImage();
    if (!(in instanceof GrayIntegerImage))
    {
      throw new WrongParameterException("Input image must implement GrayIntegerImage.");
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      out = new MemoryBilevelImage(in.getWidth(), in.getHeight());
      setOutputImage(out);
    }
    else
    {
      if (!(out instanceof BilevelImage))
      {
        throw new WrongParameterException("Output image must implement BilevelImage.");
      }
      ensureOutputImageResolution(in.getWidth(), in.getHeight());
    }
    process((GrayIntegerImage)in, (BilevelImage)out);
  }
View Full Code Here

    PixelImage in = getInputImage();
    boolean gray8 = in instanceof Gray8Image;
    boolean gray16 = in instanceof Gray16Image;
    if (!(gray8 || gray16))
    {
      throw new WrongParameterException("Input image must be either Gray8Image or Gray16Image.");
    }
    if (destBits.intValue() == 1)
    {
      process((GrayIntegerImage)in, gray8 ? 0x80 : 0x8000, (BilevelImage)getOutputImage());
    }
    else
    if (gray8)
    {
      if (destBits.intValue() > 7)
      {
        throw new WrongParameterException("For a Gray8Image destination bits must be 7 or less.");
      }
      PixelImage out = getOutputImage();
      if (out == null)
      {
        out = new MemoryGray8Image(in.getWidth(), in.getHeight());
      }
      else
      {
        if (!(out instanceof Gray8Image))
        {
          throw new WrongParameterException("For this input image, output image must be a Gray8Image.");
        }
      }
      createLut(8);
      process((GrayIntegerImage)in, (GrayIntegerImage)out);
    }
    else
    if (gray16)
    {
      PixelImage out = getOutputImage();
      if (out == null)
      {
        out = new MemoryGray16Image(in.getWidth(), in.getHeight());
      }
      else
      {
        if (destBits.intValue() <= 8 && !(out instanceof Gray8Image))
        {
          throw new WrongParameterException("For this input image, output image must be a Gray8Image.");
        }
        if (destBits.intValue() <= 15 && !(out instanceof Gray16Image))
        {
          throw new WrongParameterException("For this input image, output image must be a Gray16Image.");
        }
      }
      createLut(16);
      process((GrayIntegerImage)in, (GrayIntegerImage)out);
    }
View Full Code Here

    {
      process((Paletted8Image)in);
    }
    else
    {
      throw new WrongParameterException("Type of input image unsupported: " +  in.getImageType().getName());
    }
  }
View Full Code Here

    }
    else
    {
      if (!(image instanceof Gray8Image))
      {
        throw new WrongParameterException("Specified output image must be of type Gray8Image for input image of type Paletted8Image.");
      }
      out = (Gray8Image)image;
      ensureImagesHaveSameResolution();
    }
    Palette palette = in.getPalette();
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.