Examples of PixelImage


Examples of net.sourceforge.jiu.data.PixelImage

    if (ditherData == null)
    {
      setDefaults();
    }
    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);
    }
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

    {
      throw new MissingParameterException("The number of destination bits has not been specified.");
    }
    ensureInputImageIsAvailable();
    ensureImagesHaveSameResolution();
    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
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

   * image from the argument file, then calls {@link #convertImageToPalette}
   * and returns the palette created that way.
   */
  public static Palette load(File paletteFile)
  {
    PixelImage image;
    try
    {
      image = ImageLoader.load(paletteFile, (Vector)null);
    }
    catch (Exception e)
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)
    {
      process((RGB24Image)in);
    }
    else
    if (in instanceof RGB48Image)
    {
      process((RGB48Image)in);
    }
    else
    if (in instanceof Paletted8Image)
    {
      process((Paletted8Image)in);
    }
    else
    {
      throw new WrongParameterException("Type of input image unsupported: " +  in.getImageType().getName());
    }
  }
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

  private void process(Paletted8Image in) throws
    MissingParameterException,
    WrongParameterException
  {
    PixelImage image = getOutputImage();
    Gray8Image out = null;
    if (image == null)
    {
      out = new MemoryGray8Image(in.getWidth(), in.getHeight());
    }
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

    setOutputImage(out);
  }

  private void process(RGB24Image in) throws WrongParameterException
  {
    PixelImage out = getOutputImage();
    if (out == null)
    {
      out = new MemoryGray8Image(in.getWidth(), in.getHeight());
    }
    else
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

    process(in, (GrayIntegerImage)out);
  }

  private void process(RGB48Image in) throws WrongParameterException
  {
    PixelImage out = getOutputImage();
    if (out == null)
    {
      out = new MemoryGray16Image(in.getWidth(), in.getHeight());
    }
    else
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

   * @param args program arguments; must have length one, the only argument being the input image file name
   * @throws Exception
   */
  public static void main(String[] args) throws Exception
  {
    PixelImage inputImage = ImageLoader.load(args[0]);
    if (inputImage == null)
    {
      System.err.println("Could not load image from " + args[0]);
      return;
    }
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

    if (quantizer == null)
    {
      throw new MissingParameterException("No MedianCutQuantizer object was specified.");
    }
    ensureInputImageIsAvailable();
    PixelImage pixelImage = getInputImage();
    if (!(pixelImage instanceof RGB24Image))
    {
      throw new WrongParameterException("Input image must implement RGB24Image.");
    }
    RGB24Image originalImage = (RGB24Image)pixelImage;
View Full Code Here

Examples of net.sourceforge.jiu.data.PixelImage

        "The number of destination bits has not been specified.");
    }
    int bits = destBits.intValue();
    ensureInputImageIsAvailable();
    ensureImagesHaveSameResolution();
    PixelImage in = getInputImage();
    boolean rgb24 = in instanceof RGB24Image;
    boolean rgb48 = in instanceof RGB48Image;
    if (!(rgb24 || rgb48))
    {
      throw new WrongParameterException(
        "Input image must be either RGB24Image or RGB48Image.");
    }
    if (rgb24 && bits >= 8)
    {
      throw new WrongParameterException(
        "Number of output bits per sample must be 7 or lower for RGB24Image.");
    }
    PixelImage out = getOutputImage();
    int inDepth = 0;
    if (rgb24)
    {
      inDepth = 8;
    }
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.