Added additional resizeFast() method that works like resize() but uses a cheaper
resampling algoritm.
This commit is contained in:
parent
d93efaa377
commit
af2a5e9793
1 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue