Examples of PixelImage


Examples of net.sourceforge.jiu.data.PixelImage

  public void process() throws
    MissingParameterException,
    WrongParameterException
  {
    PixelImage in = getInputImage();
    if (in == null)
    {
      throw new MissingParameterException("Input image missing.");
    }
    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);
    }
    if (out != null && !(out instanceof BilevelImage))
    {
      throw new WrongParameterException("Output image must implement BilevelImage.");
    }
    if (out != null && (in.getWidth() != out.getWidth() || in.getHeight() != out.getHeight()))
    {
      throw new WrongParameterException("Input and output images must have the same resolution.");
    }
    process((GrayIntegerImage)in, (BilevelImage)out);
  }
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

  public void process() throws
    MissingParameterException,
    WrongParameterException
  {
    PixelImage in = getInputImage();
    if (in == null)
    {
      throw new MissingParameterException("Input image missing.");
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      out = in.createCompatibleImage(in.getWidth(), in.getHeight());
      setOutputImage(out);
    }
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

  public void process() throws
    MissingParameterException,
    WrongParameterException
  {
    ensureInputImageIsAvailable();
    PixelImage in = getInputImage();
    if (in instanceof Paletted8Image)
    {
      process((Paletted8Image)getInputImage(), (Paletted8Image)getOutputImage());
    }
    else
    if (in instanceof GrayIntegerImage || in instanceof RGBIntegerImage)
    {
      setNumTables(in.getNumChannels());
      IntegerImage ii = (IntegerImage)in;
      for (int channelIndex = 0; channelIndex < in.getNumChannels(); channelIndex++)
      {
        int numSamples = ii.getMaxSample(channelIndex) + 1;
        int[] table = createLookupTable(numSamples);
        setTable(channelIndex, table);
      }
      super.process();
    }
    else
    {
      throw new WrongParameterException("Unsupported image type: " + in.getClass().getName());
    }
  }
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

    OperationFailedException,
    WrongParameterException
  {
    ensureInputImageIsAvailable();
    ensureImagesHaveSameResolution();
    PixelImage in = getInputImage();
    if (in instanceof RGB24Image)
    {
      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());
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

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

Examples of net.sourceforge.jiu.data.PixelImage

  {
    if (in == null)
    {
      throw new MissingParameterException("Missing input image.");
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      setOutputImage(in.createCompatibleImage(in.getWidth(), in.getHeight()));
    }
    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

Examples of net.sourceforge.jiu.data.PixelImage

   */
  public void process() throws
    MissingParameterException,
    WrongParameterException
  {
    PixelImage in = getInputImage();
    prepare(in);
    if (in instanceof Paletted8Image)
    {
      process((Paletted8Image)in);
    }
    else
    if (in instanceof IntegerImage)
    {
      process((IntegerImage)in);
    }
    else
    {
      throw new WrongParameterException("Input image type unsupported: " + in.toString());
    }
  }
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

    }
    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

Examples of net.sourceforge.jiu.data.PixelImage

  public void process() throws
    MissingParameterException,
    WrongParameterException
  {
    PixelImage in = getInputImage();
    prepare(in);
    Paletted8Image out = (Paletted8Image)getOutputImage();
    if (in instanceof BilevelImage)
    {
      process((BilevelImage)in, out);
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

  public void process() throws
    MissingParameterException,
    WrongParameterException 
  {
    ensureInputImageIsAvailable();
    PixelImage image = getInputImage();
    if (image instanceof IntegerImage)
    {
      IntegerImage ii = (IntegerImage)image;
      int max = ii.getMaxSample(0);
      int index = 1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.