Enum ResamplingMethod

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ResamplingMethod>

    public enum ResamplingMethod
    extends java.lang.Enum<ResamplingMethod>
    Resampling method.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AREA
      Accurate, produces moire-free results, but tends to produce blurrier images.
      CUBIC
      Bi-cubic interpolation.
      LANCZOS4
      Lanczos (Sinc) interpolation over 8x8 neighborhood.
      LINEAR
      Bi-linear interpolation.
      NEAREST
      Nearest-neighbor interpolation.
      NONE
      Always geometrically rescale the image to fit the page if necessary.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ResamplingMethod valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ResamplingMethod[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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 Detail

      • values

        public static ResamplingMethod[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ResamplingMethod c : ResamplingMethod.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ResamplingMethod valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null