Class DownscaleQuality


  • public class DownscaleQuality
    extends java.lang.Object
    Simple enumerated constants for downscaling (scaling to smaller image size)--since we have various options for what algorithm to use. Not general-purpose, applies only to methods used in ImageUtil. Types constants can be looked up using forString(String, DownscaleQuality) and the corresponding string for the quality
    • Field Detail

      • constList

        private static java.util.Map<java.lang.String,​DownscaleQuality> constList
        Internal map string type to DQ instance
      • HIGH_QUALITY

        public static final DownscaleQuality HIGH_QUALITY
        Highest-quality downscaling; probably slowest as well.
      • LOW_QUALITY

        public static final DownscaleQuality LOW_QUALITY
        Low-quality, but not worst quality
      • AREA

        public static final DownscaleQuality AREA
        One step, fast, but should be better than low-quality.
      • type

        private final java.lang.String type
    • Constructor Detail

      • DownscaleQuality

        private DownscaleQuality​(java.lang.String type)
    • Method Detail

      • addConstant

        private static DownscaleQuality addConstant​(java.lang.String type)
        Create and add constant instance
        Parameters:
        type - Unique string for the instance
        Returns:
        The constant for that type
      • init

        private static void init()
      • asString

        public java.lang.String asString()
      • forString

        public static DownscaleQuality forString​(java.lang.String type,
                                                 DownscaleQuality dflt)
        Retrieves the DownscaleQuality instance for the corresponding string.
        Parameters:
        type - The string describing the quality, e.g. HIGH
        dflt - Default value to use if not found
        Returns:
        The constant quality instance for the type, or the default if not found.