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).
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); }
Height of the scaled image.
Width of the scaled image.
An internal buffer.
Height of the original image.
Width of the original image.
Internal array used to map incoming columns to outgoing columns.
Internal array used to map incoming rows to outgoing rows.
Width of scaled image.
Height of scaled image.
Constructs a ReplicateScaleFilter that scales the original image to the specified size. If both width and height are -1, the destination image size will be set to the source image size. If either one of the parameters is -1, it will be set to preserve the aspect ratio of the original image.
Width of the source image.
Height of the source image.
ImageFilter.setDimensions(int, int)
Sets the size of the source image.
x-coordinate of top-left corner of pixel data delivered with this method call.
y-coordinate of top-left corner of pixel data delivered with this method call.
Width of the rectangle of pixel data delivered with this method call.
Height of the rectangle of pixel data delivered with this method call.
Color model of image data.
Image data.
Offset from beginning of the pixels array.
Size of each line of data in pixels array.
ImageFilter.setPixels(int, int, int, int, ColorModel, byte[], int, int)
Receives a rectangle of image data from the ImageProducer; scales these pixels and delivers them to any ImageConsumers.
x-coordinate of top-left corner of pixel data delivered with this method call.
y-coordinate of top-left corner of pixel data delivered with this method call.
Width of the rectangle of pixel data delivered with this method call.
Height of the rectangle of pixel data delivered with this method call.
Color model of image data.
Image data.
Offset from beginning of the pixels array.
Size of each line of data in pixels array.
ImageFilter.setPixels(int, int, int, int, ColorModel, int[], int, int)
Receives a rectangle of image data from the ImageProducer; scales these pixels and delivers them to any ImageConsumers.
The properties for the image.
ImageFilter.setProperties(Hashtable)
Adds the "rescale" image property to the properties list.
ColorModel, Hashtable, ImageConsumer, ImageFilter, ImageProducer