- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImage
scaleImage
(ImageData source, int factor) static BufferedImage
scaleImage
(ImageData source, int factor, boolean untrackedData) Scales the given pixel data by the specified factor.static BufferedImage
scaleImage
(BufferedImage source, int factor) static Image
scaleImage
(Image base, int factor) Scales the given base image by the given factor.static Image
scaleImage
(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
untrackedData
parameter 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 = true
to 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
Toolkit
created 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 aBufferedImage
if the source image is static, or toolkit created image if the source is animated.- Parameters:
source
- ...targetWidth
- ...targetHeight
- ...- Returns:
- ...
- See Also:
-