Added additional resizeFast() method that works like resize() but uses a cheaper

resampling algoritm.
This commit is contained in:
hns 2003-01-29 16:16:21 +00:00
parent d93efaa377
commit af2a5e9793

View file

@ -94,13 +94,17 @@ public abstract class ImageWrapper {
} }
public void resize (int w, int h) { public void resize (int w, int h) {
// ImageFilter filter = new ReplicateScaleFilter (w, h);
// img = Toolkit.getDefaultToolkit ().createImage(new FilteredImageSource(img.getSource(), filter));
img = img.getScaledInstance (w, h, Image.SCALE_SMOOTH); img = img.getScaledInstance (w, h, Image.SCALE_SMOOTH);
width = w; width = w;
height = h; height = h;
} }
public void resizeFast (int w, int h) {
img = img.getScaledInstance (w, h, Image.SCALE_FAST);
width = w;
height = h;
}
public abstract void reduceColors (int colors); public abstract void reduceColors (int colors);
public abstract void saveAs (String filename); public abstract void saveAs (String filename);