JIU 0.12.0 Homepage

net.sourceforge.jiu.geometry
Class ScaleReplication

java.lang.Object
  extended bynet.sourceforge.jiu.ops.Operation
      extended bynet.sourceforge.jiu.ops.ImageToImageOperation
          extended bynet.sourceforge.jiu.geometry.ScaleReplication

public class ScaleReplication
extends ImageToImageOperation

Changes the pixel resolution of an image by replicating (or dropping) pixels. A fast but low quality scaling algorithm that works with all kinds of image types. Resample provides better quality, but is slower and works with intensity-based image data types only.

Usage example

The input image will be scaled to an image that is twice as wide as itself and three times as high.
 ScaleReplication scale = new ScaleReplication();
 scale.setInputImage(image); // something implementing IntegerImage
 scale.setSize(image.getWidth() * 2, image.getHeight() * 2);
 scale.process();
 PixelImage scaledImage = scale.getOutputImage();
 

Author:
Marco Schmidt

Constructor Summary
ScaleReplication()
           
 
Method Summary
 void process()
          This method does the actual work of the operation.
 void setSize(int width, int height)
          Specify the resolution to be used for the image to be created.
 
Methods inherited from class net.sourceforge.jiu.ops.ImageToImageOperation
canInputAndOutputBeEqual, ensureImagesHaveSameResolution, ensureInputImageIsAvailable, ensureOutputImageResolution, getInputImage, getOutputImage, setCanInputAndOutputBeEqual, setInputImage, setOutputImage
 
Methods inherited from class net.sourceforge.jiu.ops.Operation
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScaleReplication

public ScaleReplication()
Method Detail

process

public void process()
             throws MissingParameterException,
                    WrongParameterException
Description copied from class: Operation
This method does the actual work of the operation. It must be called after all parameters have been given to the operation object.

Overrides:
process in class Operation
Throws:
MissingParameterException - if any mandatory parameter was not given to the operation
WrongParameterException - if at least one of the input parameters was not initialized appropriately (values out of the valid interval, etc.)

setSize

public void setSize(int width,
                    int height)
Specify the resolution to be used for the image to be created.

Parameters:
width - horizontal resolution of the new image
height - vertical resolution of the new image
Throws:
IllegalArgumentException - if any of the arguments is smaller than 1

JIU 0.12.0 Homepage

Copyright © 2000, 2001, 2002, 2003, 2004 Marco Schmidt