Package net.sourceforge.jiu.data

Examples of net.sourceforge.jiu.data.PixelImage


   * is an image loaded) and creates a new canvas for the
   * current image.
   */
  public void updateImage()
  {
    PixelImage image = editor.getImage();
    if (scrollPane != null)
    {
      remove(scrollPane);
    }
    if (image != null)
View Full Code Here


   * Creates a description string for the current image and sets the
   * status bar to that text.
   */
  public void updateStatusBar()
  {
    PixelImage image = editor.getImage();
    String statusBarText;
    if (image == null)
    {
      statusBarText = "";
    }
View Full Code Here

    }
  }

  private void fillRowBuffer(int y, byte[] row, int offs)
  {
    PixelImage image = getImage();
    int x1 = getBoundsX1();
    int w = getBoundsWidth();
    if (image instanceof BilevelImage)
    {
      BilevelImage bilevelImage = (BilevelImage)image;
View Full Code Here

  {
    PNGCodec codec = new PNGCodec();
    codec.setFile(args[0], CodecMode.LOAD);
    codec.process();
    codec.close();
    PixelImage image = codec.getImage();
    codec = new PNGCodec();
    codec.setFile(args[1], CodecMode.SAVE);
    codec.setImage(image);
    codec.setDpi(300, 300);
    codec.appendComment("Test comment #1.");
View Full Code Here

    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)
      {
        throw new OperationFailedException("I/O failure: " + ioe.toString());
View Full Code Here

    byte[] buffer = new byte[CHUNK_SIZE_IHDR];
    width = getBoundsWidth();
    ArrayConverter.setIntBE(buffer, 0, width);
    height = getBoundsHeight();
    ArrayConverter.setIntBE(buffer, 4, height);
    PixelImage image = getImage();
    alpha = false;
    numChannels = 1;
    if (image instanceof BilevelImage)
    {
      precision = 1;
View Full Code Here

    MissingParameterException,
    WrongParameterException
  {
    ensureInputImageIsAvailable();
    ensureImagesHaveSameResolution();
    PixelImage image = getInputImage();
    if (image instanceof IntegerImage)
    {
      process((IntegerImage)image, (IntegerImage)getOutputImage());
    }
    else
View Full Code Here

  {
    if (inputImages == null || inputImages.size() < 1)
    {
      return;
    }
    PixelImage in = getInputImage(0);
    int width = in.getWidth();
    int height = in.getHeight();
    int index = 1;
    while (index < inputImages.size())
    {
      in = getInputImage(index);
      if (in.getWidth() != width)
      {
        throw new WrongParameterException("Width of images #0 and #" + index + " are not equal.");
      }
      if (in.getHeight() != height)
      {
        throw new WrongParameterException("Height of images #0 and #" + index + " are not equal.");
      }
      index++;
    }   
    PixelImage out = getOutputImage();
    if (out != null)
    {
      if (out.getWidth() != width)
      {
        throw new WrongParameterException("Width of input images #0 and output image are not equal.");
      }
      if (out.getHeight() != height)
      {
        throw new WrongParameterException("Height of input images #0 and output image are not equal.");
      }
    }
  }
View Full Code Here

  public void process() throws
    MissingParameterException,
    WrongParameterException
  {
    ensureInputImageIsAvailable();
    PixelImage in = getInputImage();
    ensureOutputImageResolution(in.getHeight(), in.getWidth());
    if (in instanceof IntegerImage)
    {
      process((IntegerImage)in, (IntegerImage)getOutputImage());
    }
    else
View Full Code Here

   * @param height the vertical pixel resolution that the output image must have
   * @throws WrongParameterException if the resolutions differ
   */
  public void ensureOutputImageResolution(int width, int height) throws WrongParameterException
  {
    PixelImage out = getOutputImage();
    if (out != null)
    {
      if (out.getWidth() != width)
      {
        throw new WrongParameterException("Output image must have width " + width + " (got: " + out.getWidth() + ").");
      }
      if (out.getHeight() != height)
      {
        throw new WrongParameterException("Output image must have height " + height + " (got: " + out.getHeight() + ").");
      }
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.jiu.data.PixelImage

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.