public class RenderSettings
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.awt.RenderingHints |
HINTS_MEDIUM
Rendering hints for the
MEDIUM render settings. |
protected static java.awt.RenderingHints |
HINTS_QUALITY
Rendering hints for the default
QUALITY render settings. |
protected static java.awt.RenderingHints |
HINTS_QUALITY_BICUBIC
Rendering hints for the
HINTS_QUALITY_BICUBIC render settings. |
protected static java.awt.RenderingHints |
HINTS_QUALITY_SOFT
Rendering hints for the
HINTS_QUALITY_SOFT render settings. |
protected static java.awt.RenderingHints |
HINTS_SPEED
Rendering hints for the
SPEED render settings. |
protected static int |
MAX_BLUR_SIZE
Maximum height and width of an image to use blur filtering before scaling down.
|
| Constructor and Description |
|---|
RenderSettings(int baseMode)
Create a new set of render settings, based on the given constant base mode.
|
RenderSettings(int baseMode,
java.awt.RenderingHints hints)
Create a new set of render settings, based on the given constant base mode and the provided
special rendering hints.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addImageFilter(java.awt.image.ImageFilter filter)
Adds a new image filter to the filter processing list.
|
double |
getBlurFactor()
Returns the base blur factor to use when scaling down.
|
float |
getCompressionQuality()
Returns the image save compression quality, used for JPEG images (and other formats that support such a setting).
|
java.util.List<java.awt.image.ImageFilter> |
getImageFilters()
Returns a copy of the list of image filters that should be applied to the processed image.
|
int |
getMaximumBlurSize()
Returns the maximum size of an image that is blurred before applying a downscaling operation.
|
protected java.awt.RenderingHints |
getRenderingHints()
Returns the image rendering hints to to be used for image scaling etc.
|
protected int |
getThreadNicePriority()
Returns the thread priority to use for image operations that require a lot of CPU power.
|
protected int |
getThreadOldPriority()
Returns the stored thread priority used.
|
java.awt.Color |
getTransparentReplaceColor()
Returns the background color replacement for the transparent color.
|
boolean |
isUseBlur()
Returns
true if blur is used when downscaling an image to a thumbnail. |
void |
setCompressionQuality(float compressionQuality)
Sets the image save compression quality, used for JPEG images (and other formats that support such a setting).
|
void |
setMaximumBlurSize(int maximumBlurSize)
Sets the maximum size of an image that is blurred before applying a downscaling operation.
|
protected void |
setThreadNicePriority(int threadNicePriority)
Sets the thread priority to use for image operations that require a lot of CPU power.
|
protected void |
setThreadOldPriority(int threadOldPriority)
Sets the stored thread priority.
|
void |
setTransparentReplaceColor(java.awt.Color transparentColor)
Sets the backgound color replacement for the transparent color.
|
protected void |
setUseBlur(boolean useBlur)
Controls if blur should be used at all.
|
protected static final java.awt.RenderingHints HINTS_MEDIUM
MEDIUM render settings.protected static final java.awt.RenderingHints HINTS_QUALITY
QUALITY render settings.protected static final java.awt.RenderingHints HINTS_QUALITY_BICUBIC
HINTS_QUALITY_BICUBIC render settings.protected static final java.awt.RenderingHints HINTS_QUALITY_SOFT
HINTS_QUALITY_SOFT render settings.protected static final java.awt.RenderingHints HINTS_SPEED
SPEED render settings.protected static final int MAX_BLUR_SIZE
Since the blur operation is quite expensive in memory, this should not be used for very large images. This sets the threshold.
public RenderSettings(int baseMode)
baseMode - the base mode of the settings, for example Simapi.RENDER_QUALITYpublic RenderSettings(int baseMode,
java.awt.RenderingHints hints)
baseMode - the base mode of the settings, for example Simapi.RENDER_QUALITYhints - the special rendering hints to use for image processing operations like scaling etc.public void addImageFilter(java.awt.image.ImageFilter filter)
filter - the image filter to addpublic double getBlurFactor()
public float getCompressionQuality()
This is used only if the image type supports different qualities.
For example, this it is used when writing JPEG images.
A quality of 0.1 is very poor, 0.75 is ok, 1.0 is maximum.
public java.util.List<java.awt.image.ImageFilter> getImageFilters()
public int getMaximumBlurSize()
If the image size is to big, "out of memory" errors may occur.
The default is 3000 x 3000 pixel.
public java.awt.Color getTransparentReplaceColor()
This is used if transparency is not supported by the selected image format.
The default color is Color.WHITE.
public boolean isUseBlur()
true if blur is used when downscaling an image to a thumbnail.This improves the thumbnail quality, but uses a lot more CPU and memory resources.
true if blur is used when downscaling an image to a thumbnailpublic void setCompressionQuality(float compressionQuality)
This is used only if the image type supports different qualities.
For example, this it is used when writing JPEG images.
A quality of 0.1 is very poor, 0.75 is ok, 1.0 is maximum.
compressionQuality - the compression quality to set (must be between 0 and 1)public void setMaximumBlurSize(int maximumBlurSize)
maximumBlurSize - the maximum size of an image to setpublic void setTransparentReplaceColor(java.awt.Color transparentColor)
This is used if transparency is not supported by the selected image format.
transparentColor - the backgound color replacement for the transparent color to setprotected java.awt.RenderingHints getRenderingHints()
This method is protected to avoid changes to the constant values defined in this class.
protected int getThreadNicePriority()
protected int getThreadOldPriority()
protected void setThreadNicePriority(int threadNicePriority)
threadNicePriority - the thread priority to setprotected void setThreadOldPriority(int threadOldPriority)
threadOldPriority - the thread priority to storeprotected void setUseBlur(boolean useBlur)
useBlur - if false, don't use blur