Interface ImageUtil.Scaler

All Known Implementing Classes:
ImageUtil.AbstractFastScaler, ImageUtil.AreaAverageScaler, ImageUtil.FastScaler, ImageUtil.HighQualityScaler, ImageUtil.OldScaler
Enclosing class:
ImageUtil

private static interface ImageUtil.Scaler
  • Method Details

    • getScaledInstance

      @CheckReturnValue BufferedImage getScaledInstance(BufferedImage img, ScalingOptions opt)
      Convenience method that returns a scaled instance of the provided BufferedImage, taken from article on java.net by Chris Campbell.
      Expects the image to be fully loaded (e.g. no need to wait for loading on requesting height or width)
      Parameters:
      img - the original image to be scaled
      opt - scaling options described below: imageType type of image from BufferedImage (values starting with TYPE) hint one of the rendering hints that corresponds to RenderingHints.KEY_INTERPOLATION (e.g. RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR, RenderingHints.VALUE_INTERPOLATION_BILINEAR, RenderingHints.VALUE_INTERPOLATION_BICUBIC) higherQuality if true, this method will use a multistep scaling technique that provides higher quality than the usual one-step technique (only useful in downscaling cases, where targetWidth or targetHeight is smaller than the original dimensions, and generally only when the BILINEAR hint is specified) targetWidth the desired width of the scaled instance, in pixels targetHeight the desired height of the scaled instance, in pixels
      Returns:
      a scaled version of the original BufferedImage