ReplicateScaleFilter

Name

ReplicateScaleFilter

[Graphic: Figure from the text]

Description

The ReplicateScaleFilter class uses a simple-minded algorithm to scale an image. If the image is to be reduced, rows and columns of pixels are removed. If the image is to be expanded, rows and columns are duplicated (replicated).

Class Definition

public class ReplicateScaleFilter extends java.awt.image.ImageFilter {
 // Variables protected int destHeight; protected int destWidth; protected Object outpixbuf; protected int srcHeight; protected int srcWidth; protected int[] srccols; protected int[] srcrows; // Constructor public ReplicateScaleFilter(int width, int height); // Instance Methods public void setDimensions (int w, int h);
public void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize);
public void setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize);
public void setProperties(Hashtable props);
}

Variables

destHeight

protected int destHeight

Height of the scaled image.

destWidth

protected int destWidth

Width of the scaled image.

outpixbuf

protected Object outpixbuf

An internal buffer.

srcHeight

protected int srcHeight

Height of the original image.

srcWidth

protected int srcWidth

Width of the original image.

srccols

protected int[] srccols

Internal array used to map incoming columns to outgoing columns.

srcrows

protected int[] srcrows

Internal array used to map incoming rows to outgoing rows.

Constructor

ReplicateScaleFilter

public ReplicateScaleFilter (int width, int height)

Instance Methods

setDimensions

public void setDimensions (int w, int h)

setPixels

void setPixels (int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize)

void setPixels (int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize)

setProperties

public void setProperties (Hashtable props)

See Also

ColorModel, Hashtable, ImageConsumer, ImageFilter, ImageProducer