net.sourceforge.jiu.geometry

Class 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

Field Summary

private Integer
outHeight
private Integer
outWidth

Fields inherited from class net.sourceforge.jiu.ops.ImageToImageOperation

canInAndOutBeEqual, inputImage, outputImage

Fields inherited from class net.sourceforge.jiu.ops.Operation

abort, progressListeners

Method Summary

void
process()
private void
process(IntegerImage in, IntegerImage out)
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, process, removeProgressListener, setAbort, setProgress, setProgress

Field Details

outHeight

private Integer outHeight

outWidth

private Integer outWidth

Method Details

process

public void process()
            throws MissingParameterException,
                   WrongParameterException
Overrides:
process in interface Operation

process

private void process(IntegerImage in,
                     IntegerImage out)

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