- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImagescaleImage(ImageData source, int factor) static BufferedImagescaleImage(ImageData source, int factor, boolean untrackedData) Scales the given pixel data by the specified factor.static BufferedImagescaleImage(BufferedImage source, int factor) static ImagescaleImage(Image base, int factor) Scales the given base image by the given factor.static ImagescaleImage(Image source, int targetWidth, int targetHeight) Scales the given image to the given exact target dimensions.
-
Method Details
-
scaleImage
-
scaleImage
Scales the given pixel data by the specified factor.The
untrackedDataparameter controls whether the result image will be backed by a tracked data buffer or not. Having a tracked data buffer will likely benefit on-screen display performance, while it may incur some initialization slow down. If you only need to process images off screen, f.e. read a source image, scale it, and save the result, then you may specifyuntracked = trueto save up on result initialization cost.- Parameters:
source- ...factor- ...untrackedData- ...- Returns:
- ...
- See Also:
-
scaleImage
Scales the given base image by the given factor.If the given image is static, the result is a
BufferedImage.If the given image is animated, the result is a
Toolkitcreated image using filtered source, like:Image base; ... int factor = 2; BufferedImageFilter xbrzFilter = new BufferedImageFilter(new XbrzOp(factor)); Image scaled = Toolkit.getDefaultToolkit() .createImage(new FilteredImageSource(base.getSource(), xbrzFilter));- Parameters:
base- ...factor- ...- Returns:
- ...
-
scaleImage
-
scaleImage
Scales the given image to the given exact target dimensions.The image is first upscaled using xBRZ, then smoothly downscaled as necessary.
As with
scaleImage(source, factor)this will produce aBufferedImageif the source image is static, or toolkit created image if the source is animated.- Parameters:
source- ...targetWidth- ...targetHeight- ...- Returns:
- ...
- See Also:
-