Enum Scalr.Method

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AUTOMATIC
      Used to indicate that the scaling implementation should decide which method to use in order to get the best looking scaled image in the least amount of time.
      BALANCED
      Used to indicate that the scaling implementation should use a scaling operation balanced between SPEED and QUALITY.
      QUALITY
      Used to indicate that the scaling implementation should do everything it can to create as nice of a result as possible.
      SPEED
      Used to indicate that the scaling implementation should scale as fast as possible and return a result.
      ULTRA_QUALITY
      Used to indicate that the scaling implementation should go above and beyond the work done by QUALITY to make the image look exceptionally good at the cost of more processing time.
    • Enum Constant Detail

      • AUTOMATIC

        public static final Scalr.Method AUTOMATIC
        Used to indicate that the scaling implementation should decide which method to use in order to get the best looking scaled image in the least amount of time.

        The scaling algorithm will use the Scalr.THRESHOLD_QUALITY_BALANCED or Scalr.THRESHOLD_BALANCED_SPEED thresholds as cut-offs to decide between selecting the QUALITY, BALANCED or SPEED scaling algorithms.

        By default the thresholds chosen will give nearly the best looking result in the fastest amount of time. We intend this method to work for 80% of people looking to scale an image quickly and get a good looking result.

      • SPEED

        public static final Scalr.Method SPEED
        Used to indicate that the scaling implementation should scale as fast as possible and return a result. For smaller images (800px in size) this can result in noticeable aliasing but it can be a few magnitudes times faster than using the QUALITY method.
      • BALANCED

        public static final Scalr.Method BALANCED
        Used to indicate that the scaling implementation should use a scaling operation balanced between SPEED and QUALITY. Sometimes SPEED looks too low quality to be useful (e.g. text can become unreadable when scaled using SPEED) but using QUALITY mode will increase the processing time too much. This mode provides a "better than SPEED" quality in a "less than QUALITY" amount of time.
      • QUALITY

        public static final Scalr.Method QUALITY
        Used to indicate that the scaling implementation should do everything it can to create as nice of a result as possible. This approach is most important for smaller pictures (800px or smaller) and less important for larger pictures as the difference between this method and the SPEED method become less and less noticeable as the source-image size increases. Using the AUTOMATIC method will automatically prefer the QUALITY method when scaling an image down below 800px in size.
      • ULTRA_QUALITY

        public static final Scalr.Method ULTRA_QUALITY
        Used to indicate that the scaling implementation should go above and beyond the work done by QUALITY to make the image look exceptionally good at the cost of more processing time. This is especially evident when generating thumbnails of images that look jagged with some of the other Scalr.Methods (even QUALITY).
    • Method Detail

      • values

        public static Scalr.Method[] 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 (Scalr.Method c : Scalr.Method.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Scalr.Method valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null