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,12 +94,16 @@ public abstract class ImageWrapper {
|
|||
}
|
||||
|
||||
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);
|
||||
width = w;
|
||||
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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue