Enum Class ResamplingMethod

java.lang.Object
java.lang.Enum<ResamplingMethod>
io.scanbot.sdk.pdfgeneration.ResamplingMethod
All Implemented Interfaces:
Serializable, Comparable<ResamplingMethod>, Constable

public enum ResamplingMethod extends Enum<ResamplingMethod>
Resampling method.
  • Enum Constant Details

    • NONE

      public static final ResamplingMethod NONE
      Always geometrically rescale the image to fit the page if necessary. Fast. Otherwise, downscale the bitmap to match the `dpi` setting via the selected method before adding it to the PDF if the calculated image DPI after stretching is greater than `dpi`. Slower.
    • NEAREST

      public static final ResamplingMethod NEAREST
      Nearest-neighbor interpolation. Lowest quality. Produces blocky images, especially when upsampling.
    • LINEAR

      public static final ResamplingMethod LINEAR
      Bi-linear interpolation. Better quality than nearest-neighbor, slower. Okay when the target size is not too different from the source size.
    • CUBIC

      public static final ResamplingMethod CUBIC
      Bi-cubic interpolation. Better quality than bi-linear, slower. Produces high-quality results in a larger range than that of bi-linear.
    • LANCZOS4

      public static final ResamplingMethod LANCZOS4
      Lanczos (Sinc) interpolation over 8x8 neighborhood. Produces very high quality results, but slower than bi-cubic. Retains sharp edges like those of text when downsampling.
    • AREA

      public static final ResamplingMethod AREA
      Accurate, produces moire-free results, but tends to produce blurrier images. When upsampling, it is similar to nearest-neighbor.
  • Method Details

    • values

      public static ResamplingMethod[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ResamplingMethod valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null