Package com.openhtmltopdf.util
Class DownscaleQuality
java.lang.Object
com.openhtmltopdf.util.DownscaleQuality
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final DownscaleQuality
One step, fast, but should be better than low-quality.private static Map
<String, DownscaleQuality> Internal map string type to DQ instancestatic final DownscaleQuality
Low quality, but very fast.static final DownscaleQuality
Highest-quality downscaling; probably slowest as well.static final DownscaleQuality
Low-quality, but not worst qualityprivate final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static DownscaleQuality
addConstant
(String type) Create and add constant instanceasString()
static DownscaleQuality
forString
(String type, DownscaleQuality dflt) Retrieves the DownscaleQuality instance for the corresponding string.private static void
init()
-
Field Details
-
constList
Internal map string type to DQ instance -
HIGH_QUALITY
Highest-quality downscaling; probably slowest as well. -
LOW_QUALITY
Low-quality, but not worst quality -
FAST
Low quality, but very fast. -
AREA
One step, fast, but should be better than low-quality. -
type
-
-
Constructor Details
-
DownscaleQuality
-
-
Method Details
-
addConstant
Create and add constant instance- Parameters:
type
- Unique string for the instance- Returns:
- The constant for that type
-
init
private static void init() -
asString
-
forString
Retrieves the DownscaleQuality instance for the corresponding string.- Parameters:
type
- The string describing the quality, e.g. HIGHdflt
- Default value to use if not found- Returns:
- The constant quality instance for the type, or the default if not found.
-