com.openhtmltopdf.util.ImageUtil#getScaledInstance(ScalingOptions, java.awt.image.BufferedImage) .
Encapsulates a set of parameters related to scaling quality and output. Values are final once constructed, except
for target width and height, which can be change and the options instance reused.
There is a default constructor for average quality and performance.
| Modifier and Type | Field and Description |
|---|---|
| private DownscaleQuality | |
| private Object | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | ScalingOptions(DownscaleQuality
Directs downscaling quality. One of the enumerated types of
downscalingHint, Object com. such as
com..Hint for interpolation to AWT image renderer, one of the Object constants from
interpolationHint)java. using java.Constructor with all options. |
| public | |
| public | ScalingOptions(int
Target width in pixels of image once scaled targetWidth, int Target height in pixels of image once scaled targetHeight, int Type of type, DownscaleQuality java. to create for output; see docs for
java.Directs downscaling quality. One of the enumerated types of
downscalingHint, Object com. such as
com..Hint for interpolation to AWT image renderer, one of the Object constants from
hint)java. using java.Constructor with all options. |
| Modifier and Type | Method and Description |
|---|---|
| public void | applyRenderingHints(Graphics2D
A Graphics2D instance on which scaled images will be rendered. g2)Applies any rendering hints configured for these ScalingOptions to a Graphics2D instance before image operations are called on it. |
| public DownscaleQuality | |
| public Object | |
| protected Map | Returns: Map of rendering hints.Returns a Map of image rendering hints applicable to |
| public int | |
| public int | |
| public void | |
| public void | |
| public void | |
| public boolean | Returns: true if image dimensions already match target sizean image width w, int an image height h)Returns true if the target size specified by these options matches the size provided (e.g. image is already at target size). |
| public boolean | Returns: true if image dimensions already match target sizeReturns true if the target size specified by these options matches the size provided (e.g. image is already at target size). |
| downscalingHint | back to summary |
|---|---|
| private DownscaleQuality downscalingHint | |
| renderingHint | back to summary |
|---|---|
| private Object renderingHint | |
| targetHeight | back to summary |
|---|---|
| private int targetHeight | |
| targetWidth | back to summary |
|---|---|
| private int targetWidth | |
| ScalingOptions | back to summary |
|---|---|
| public ScalingOptions(DownscaleQuality downscalingHint, Object interpolationHint) Constructor with all options.
| |
| ScalingOptions | back to summary |
|---|---|
| public ScalingOptions() Default scaling options, nearest neighbor interpolation, and fast downscaling. This is fast, but not great quality. | |
| ScalingOptions | back to summary |
|---|---|
| public ScalingOptions(int targetWidth, int targetHeight, int type, DownscaleQuality downscalingHint, Object hint) Constructor with all options.
| |
| applyRenderingHints | back to summary |
|---|---|
| public void applyRenderingHints(Graphics2D g2) Applies any rendering hints configured for these ScalingOptions to a Graphics2D instance before image operations are called on it. These might be
| |
| getDownscalingHint | back to summary |
|---|---|
public DownscaleQuality getDownscalingHint()
| |
| getRenderingHint | back to summary |
|---|---|
public Object getRenderingHint()
| |
| getRenderingHints | back to summary |
|---|---|
| protected Map Returns a Map of image rendering hints applicable to
| |
| getTargetHeight | back to summary |
|---|---|
| public int getTargetHeight() | |
| getTargetWidth | back to summary |
|---|---|
| public int getTargetWidth() | |
| setTargetDimensions | back to summary |
|---|---|
| public void setTargetDimensions(Dimension dim) | |
| setTargetHeight | back to summary |
|---|---|
| public void setTargetHeight(int targetHeight) | |
| setTargetWidth | back to summary |
|---|---|
| public void setTargetWidth(int targetWidth) | |
| sizeMatches | back to summary |
|---|---|
| public boolean sizeMatches(int w, int h) Returns true if the target size specified by these options matches the size provided (e.g. image is already at target size).
| |
| sizeMatches | back to summary |
|---|---|
| public boolean sizeMatches(Image img) Returns true if the target size specified by these options matches the size provided (e.g. image is already at target size).
| |