RenderingHints class defines and manages collections of
keys and associated values which allow an application to provide input
into the choice of algorithms used by other classes which perform
rendering and image manipulation services.
The java.awt.Graphics2D class, and classes that implement
java.awt.image.BufferedImageOp and
java.awt.image.RasterOp all provide methods to get and
possibly to set individual or groups of RenderingHints
keys and their associated values.
When those implementations perform any rendering or image manipulation
operations they should examine the values of any RenderingHints
that were requested by the caller and tailor the algorithms used
accordingly and to the best of their ability.
Note that since these keys and values are hints, there is
no requirement that a given implementation supports all possible
choices indicated below or that it can respond to requests to
modify its choice of algorithm.
The values of the various hint keys may also interact such that
while all variants of a given key are supported in one situation,
the implementation may be more restricted when the values associated
with other keys are modified.
For example, some implementations may be able to provide several
types of dithering when the antialiasing hint is turned off, but
have little control over dithering when antialiasing is on.
The full set of supported keys and hints may also vary by destination
since runtimes may use different underlying modules to render to
the screen, or to java. objects,
or while printing.
Implementations are free to ignore the hints completely, but should try to use an implementation algorithm that is as close as possible to the request. If an implementation supports a given algorithm when any value is used for an associated hint key, then minimally it must do so when the value for that key is the exact value that specifies the algorithm.
The keys used to control the hints are all special values that
subclass the associated RenderingHints. class.
Many common hints are expressed below as static constants in this
class, but the list is not meant to be exhaustive.
Other hints may be created by other packages by defining new objects
which subclass the Key class and defining the associated values.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | RenderingHints.
Defines the base type of all keys used along with the
|
| Modifier and Type | Field and Description |
|---|---|
| pack-priv HashMap | |
| public static final RenderingHints. | KEY_ALPHA_INTERPOLATION
Alpha interpolation hint key. |
| public static final RenderingHints. | KEY_ANTIALIASING
Antialiasing hint key. |
| public static final RenderingHints. | KEY_COLOR_RENDERING
Color rendering hint key. |
| public static final RenderingHints. | KEY_DITHERING
Dithering hint key. |
| public static final RenderingHints. | KEY_FRACTIONALMETRICS
Font fractional metrics hint key. |
| public static final RenderingHints. | KEY_INTERPOLATION
Interpolation hint key. |
| public static final RenderingHints. | KEY_RENDERING
Rendering hint key. |
| public static final RenderingHints. | KEY_RESOLUTION_VARIANT
Image resolution variant hint key. |
| public static final RenderingHints. | KEY_STROKE_CONTROL
Stroke normalization control hint key. |
| public static final RenderingHints. | KEY_TEXT_ANTIALIASING
Text antialiasing hint key. |
| public static final RenderingHints. | KEY_TEXT_LCD_CONTRAST
LCD text contrast rendering hint key. |
| public static final Object | VALUE_ALPHA_INTERPOLATION_DEFAULT
Alpha interpolation hint value -- alpha blending algorithms are chosen by the implementation for a good tradeoff of performance vs. quality. |
| public static final Object | VALUE_ALPHA_INTERPOLATION_QUALITY
Alpha interpolation hint value -- alpha blending algorithms are chosen with a preference for precision and visual quality. |
| public static final Object | VALUE_ALPHA_INTERPOLATION_SPEED
Alpha interpolation hint value -- alpha blending algorithms are chosen with a preference for calculation speed. |
| public static final Object | VALUE_ANTIALIAS_DEFAULT
Antialiasing hint value -- rendering is done with a default antialiasing mode chosen by the implementation. |
| public static final Object | VALUE_ANTIALIAS_OFF
Antialiasing hint value -- rendering is done without antialiasing. |
| public static final Object | VALUE_ANTIALIAS_ON
Antialiasing hint value -- rendering is done with antialiasing. |
| public static final Object | VALUE_COLOR_RENDER_DEFAULT
Color rendering hint value -- perform color conversion calculations as chosen by the implementation to represent the best available tradeoff between performance and accuracy. |
| public static final Object | VALUE_COLOR_RENDER_QUALITY
Color rendering hint value -- perform the color conversion calculations with the highest accuracy and visual quality. |
| public static final Object | VALUE_COLOR_RENDER_SPEED
Color rendering hint value -- perform the fastest color conversion to the format of the output device. |
| public static final Object | VALUE_DITHER_DEFAULT
Dithering hint value -- use a default for dithering chosen by the implementation. |
| public static final Object | VALUE_DITHER_DISABLE
Dithering hint value -- do not dither when rendering geometry. |
| public static final Object | VALUE_DITHER_ENABLE
Dithering hint value -- dither when rendering geometry, if needed. |
| public static final Object | VALUE_FRACTIONALMETRICS_DEFAULT
Font fractional metrics hint value -- character glyphs are positioned with accuracy chosen by the implementation. |
| public static final Object | VALUE_FRACTIONALMETRICS_OFF
Font fractional metrics hint value -- character glyphs are positioned with advance widths rounded to pixel boundaries. |
| public static final Object | VALUE_FRACTIONALMETRICS_ON
Font fractional metrics hint value -- character glyphs are positioned with sub-pixel accuracy. |
| public static final Object | VALUE_INTERPOLATION_BICUBIC
Interpolation hint value -- the color samples of 9 nearby
integer coordinate samples in the image are interpolated using
a cubic function in both |
| public static final Object | VALUE_INTERPOLATION_BILINEAR
Interpolation hint value -- the color samples of the 4 nearest neighboring integer coordinate samples in the image are interpolated linearly to produce a color sample. |
| public static final Object | VALUE_INTERPOLATION_NEAREST_NEIGHBOR
Interpolation hint value -- the color sample of the nearest neighboring integer coordinate sample in the image is used. |
| public static final Object | VALUE_RENDER_DEFAULT
Rendering hint value -- rendering algorithms are chosen by the implementation for a good tradeoff of performance vs. quality. |
| public static final Object | VALUE_RENDER_QUALITY
Rendering hint value -- rendering algorithms are chosen with a preference for output quality. |
| public static final Object | VALUE_RENDER_SPEED
Rendering hint value -- rendering algorithms are chosen with a preference for output speed. |
| public static final Object | VALUE_RESOLUTION_VARIANT_BASE
Image resolution variant hint value -- the standard resolution of an image is always used. |
| public static final Object | VALUE_RESOLUTION_VARIANT_DEFAULT
Image resolution variant hint value -- an image resolution variant is chosen based on a default heuristic which may depend on the policies of the platform |
| public static final Object | VALUE_RESOLUTION_VARIANT_DPI_FIT
Image resolution variant hint value -- an image resolution variant is chosen based only on the DPI of the screen. |
| public static final Object | VALUE_RESOLUTION_VARIANT_SIZE_FIT
Image resolution variant hint value -- an image resolution variant is chosen based on the DPI of the screen and the transform in the Graphics2D context. |
| public static final Object | VALUE_STROKE_DEFAULT
Stroke normalization control hint value -- geometry may be modified or left pure depending on the tradeoffs in a given implementation. |
| public static final Object | VALUE_STROKE_NORMALIZE
Stroke normalization control hint value -- geometry should be normalized to improve uniformity or spacing of lines and overall aesthetics. |
| public static final Object | VALUE_STROKE_PURE
Stroke normalization control hint value -- geometry should be left unmodified and rendered with sub-pixel accuracy. |
| public static final Object | VALUE_TEXT_ANTIALIAS_DEFAULT
Text antialiasing hint value -- text rendering is done according
to the |
| public static final Object | VALUE_TEXT_ANTIALIAS_GASP
Text antialiasing hint value -- text rendering is requested to
use information in the font resource which specifies for each point
size whether to apply |
| public static final Object | VALUE_TEXT_ANTIALIAS_LCD_HBGR
Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixels in order from display left to right of B,G,R such that the horizontal subpixel resolution is three times that of the full pixel horizontal resolution (HBGR). |
| public static final Object | VALUE_TEXT_ANTIALIAS_LCD_HRGB
Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixels in order from display left to right of R,G,B such that the horizontal subpixel resolution is three times that of the full pixel horizontal resolution (HRGB). |
| public static final Object | VALUE_TEXT_ANTIALIAS_LCD_VBGR
Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixel organisation from display top to bottom of B,G,R such that the vertical subpixel resolution is three times that of the full pixel vertical resolution (VBGR). |
| public static final Object | VALUE_TEXT_ANTIALIAS_LCD_VRGB
Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixel organisation from display top to bottom of R,G,B such that the vertical subpixel resolution is three times that of the full pixel vertical resolution (VRGB). |
| public static final Object | VALUE_TEXT_ANTIALIAS_OFF
Text antialiasing hint value -- text rendering is done without any form of antialiasing. |
| public static final Object | VALUE_TEXT_ANTIALIAS_ON
Text antialiasing hint value -- text rendering is done with some form of antialiasing. |
| Access | Constructor and Description |
|---|---|
| public | RenderingHints(Map<RenderingHints.
a map of key/value pairs to initialize the hints
or null if the object should be empty initConstructs a new object with keys and values initialized from the specified Map object which may be null. |
| public | RenderingHints(RenderingHints.
the key of the particular hint property key,the value of the hint property specified with
value)keyConstructs a new object with the specified key/value pair. |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(RenderingHints
the set of key/value pairs to be added to this
hints)RenderingHints objectAdds all of the keys and corresponding values from the specified
|
| public void | |
| public Object | Returns: a clone of this instance.Overrides java. Creates a clone of this |
| public boolean | Returns: true if this RenderingHints
contains a mapping for the specified key.key whose presence in this
key)RenderingHints is to be tested.Implements java. Returns |
| public boolean | Returns: true if this RenderingHints
maps one or more keys to the specified value.value whose presence in this
value)RenderingHints is to be tested.Implements java. Returns true if this RenderingHints maps one or more keys to the specified value. |
| public Set | Returns: aSet view of the mappings contained in
this RenderingHints.Implements java. Returns a |
| public boolean | Returns: true if the specified Object
is equal to this RenderingHints.Object to be compared for equality with
this RenderingHints.Overrides java. Implements java. Compares the specified |
| public Object | Returns: the value to which the key is mapped in this object ornull if the key is not mapped to any value in
this object.a rendering hint key key)Implements java. Returns the value to which the specified key is mapped. |
| public int | Returns: the hash code value for thisRenderingHints.Overrides java. Implements java. Returns the hash code value for this |
| public boolean | Returns: true if this
RenderingHints contains no key-value mappings.Implements java. Returns |
| public Set | Returns: aSet view of the keys contained
in this RenderingHints.Implements java. Returns a |
| public Object | Returns: the previous value of the specified key in this object ornull if it did not have one.the rendering hint key. key, Object the rendering hint value. value)Implements java. Maps the specified |
| public void | putAll(Map<?, ?>
the specified m)MapImplements java. Copies all of the mappings from the specified |
| public Object | Returns: the value to which the key had previously been mapped in thisRenderingHints object, or null
if the key did not have a mapping.the rendering hints key that needs to be removed key)Implements java. Removes the key and its corresponding value from this
|
| public int | Returns: the number of key-value mappings in thisRenderingHints.Implements java. Returns the number of key-value mappings in this
|
| public String | Returns: a string representation of this object.Overrides java. Returns a rather long string representation of the hashmap
which contains the mappings of keys to values for this
|
| public Collection | Returns: aCollection view of the values
contained in this RenderingHints.Implements java. Returns a |
| hintmap | back to summary |
|---|---|
| pack-priv HashMap<Object, Object> hintmap | |
| KEY_ALPHA_INTERPOLATION | back to summary |
|---|---|
| public static final RenderingHints. Alpha interpolation hint key.
The This hint could control the choice of alpha blending calculations that sacrifice some precision to use fast lookup tables or lower precision SIMD instructions. This hint could also control whether or not the color and alpha values are converted into a linear color space during the calculations for a more linear visual effect at the expense of additional per-pixel calculations. The allowable values for this hint are | |
| KEY_ANTIALIASING | back to summary |
|---|---|
| public static final RenderingHints. Antialiasing hint key.
The A typical antialiasing algorithm works by blending the existing colors of the pixels along the boundary of a shape with the requested fill paint according to the estimated partial pixel coverage of the shape. The allowable values for this hint are | |
| KEY_COLOR_RENDERING | back to summary |
|---|---|
| public static final RenderingHints. Color rendering hint key.
The When a rendering or image manipulation operation produces a color value that must be stored into a destination, it must first convert that color into a form suitable for storing into the destination image or surface. Minimally, the color components must be converted to bit representations and ordered in the correct order or an index into a color lookup table must be chosen before the data can be stored into the destination memory. Without this minimal conversion, the data in the destination would likely represent random, incorrect or possibly even unsupported values. Algorithms to quickly convert the results of rendering operations into the color format of most common destinations are well known and fairly optimal to execute.
Simply performing the most basic color format conversion to
store colors into a destination can potentially ignore a
difference in the calibration of the
The allowable values for this hint are | |
| KEY_DITHERING | back to summary |
|---|---|
| public static final RenderingHints. Dithering hint key.
The
Some rendering destinations may support a limited number of
color choices which may not be able to accurately represent
the full spectrum of colors that can result during rendering
operations.
For such a destination the The allowable values for this hint are | |
| KEY_FRACTIONALMETRICS | back to summary |
|---|---|
| public static final RenderingHints. Font fractional metrics hint key.
The Rendering text to a low resolution device like a screen will necessarily involve a number of rounding operations as the high quality and very precise definition of the shape and metrics of the character glyphs must be matched to discrete device pixels. Ideally the positioning of glyphs during text layout would be calculated by scaling the design metrics in the font according to the point size, but then the scaled advance width will not necessarily be an integer number of pixels. If the glyphs are positioned with sub-pixel accuracy according to these scaled design metrics then the rasterization would ideally need to be adjusted for each possible sub-pixel origin. Unfortunately, scaling each glyph customized to its exact subpixel origin during text layout would be prohibitively expensive so a simplified system based on integer device positions is typically used to lay out the text. The rasterization of the glyph and the scaled advance width are both adjusted together to yield text that looks good at device resolution and has consistent integer pixel distances between glyphs that help the glyphs look uniformly and consistently spaced and readable. This process of rounding advance widths for rasterized glyphs to integer distances means that the character density and the overall length of a string of text will be different from the theoretical design measurements due to the accumulation of a series of small differences in the adjusted widths of each glyph. The specific differences will be different for each glyph, some being wider and some being narrower than their theoretical design measurements. Thus the overall difference in character density and length will vary by a number of factors including the font, the specific device resolution being targeted, and the glyphs chosen to represent the string being rendered. As a result, rendering the same string at multiple device resolutions can yield widely varying metrics for whole strings.
When When disabled, the scaled design metrics are rounded or adjusted to integer distances for layout. The distances between any specific pair of glyphs will be more uniform on the device, but the density and total length of long strings may no longer match the theoretical intentions of the font designer. Disabling this hint will typically produce more readable results on low resolution devices like computer monitors. The allowable values for this key are | |
| KEY_INTERPOLATION | back to summary |
|---|---|
| public static final RenderingHints. Interpolation hint key.
The Implicitly images are defined to provide color samples at integer coordinate locations. When images are rendered upright with no scaling onto a destination, the choice of which image pixels map to which device pixels is obvious and the samples at the integer coordinate locations in the image are transferred to the pixels at the corresponding integer locations on the device pixel grid one for one. When images are rendered in a scaled, rotated, or otherwise transformed coordinate system, then the mapping of device pixel coordinates back to the image can raise the question of what color sample to use for the continuous coordinates that lie between the integer locations of the provided image samples. Interpolation algorithms define functions which provide a color sample for any continuous coordinate in an image based on the color samples at the surrounding integer coordinates. The allowable values for this hint are | |
| KEY_RENDERING | back to summary |
|---|---|
| public static final RenderingHints. Rendering hint key.
The The allowable values for this hint are | |
| KEY_RESOLUTION_VARIANT | back to summary |
|---|---|
| public static final RenderingHints. Image resolution variant hint key.
The
| |
| KEY_STROKE_CONTROL | back to summary |
|---|---|
| public static final RenderingHints. Stroke normalization control hint key.
The Some implementations may be able to use an optimized platform rendering library which may be faster than traditional software rendering algorithms on a given platform, but which may also not support floating point coordinates. Some implementations may also have sophisticated algorithms which perturb the coordinates of a path so that wide lines appear more uniform in width and spacing. If an implementation performs any type of modification or "normalization" of a path, it should never move the coordinates by more than half a pixel in any direction. The allowable values for this hint are
| |
| KEY_TEXT_ANTIALIASING | back to summary |
|---|---|
| public static final RenderingHints. Text antialiasing hint key.
The The allowable values for this hint are | |
| KEY_TEXT_LCD_CONTRAST | back to summary |
|---|---|
| public static final RenderingHints. LCD text contrast rendering hint key.
The value is an
| |
| VALUE_ALPHA_INTERPOLATION_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_ALPHA_INTERPOLATION_DEFAULT Alpha interpolation hint value -- alpha blending algorithms are chosen by the implementation for a good tradeoff of performance vs. quality.
| |
| VALUE_ALPHA_INTERPOLATION_QUALITY | back to summary |
|---|---|
| public static final Object VALUE_ALPHA_INTERPOLATION_QUALITY Alpha interpolation hint value -- alpha blending algorithms are chosen with a preference for precision and visual quality.
| |
| VALUE_ALPHA_INTERPOLATION_SPEED | back to summary |
|---|---|
| public static final Object VALUE_ALPHA_INTERPOLATION_SPEED Alpha interpolation hint value -- alpha blending algorithms are chosen with a preference for calculation speed.
| |
| VALUE_ANTIALIAS_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_ANTIALIAS_DEFAULT Antialiasing hint value -- rendering is done with a default antialiasing mode chosen by the implementation.
| |
| VALUE_ANTIALIAS_OFF | back to summary |
|---|---|
| public static final Object VALUE_ANTIALIAS_OFF Antialiasing hint value -- rendering is done without antialiasing.
| |
| VALUE_ANTIALIAS_ON | back to summary |
|---|---|
| public static final Object VALUE_ANTIALIAS_ON Antialiasing hint value -- rendering is done with antialiasing.
| |
| VALUE_COLOR_RENDER_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_COLOR_RENDER_DEFAULT Color rendering hint value -- perform color conversion calculations as chosen by the implementation to represent the best available tradeoff between performance and accuracy.
| |
| VALUE_COLOR_RENDER_QUALITY | back to summary |
|---|---|
| public static final Object VALUE_COLOR_RENDER_QUALITY Color rendering hint value -- perform the color conversion calculations with the highest accuracy and visual quality.
| |
| VALUE_COLOR_RENDER_SPEED | back to summary |
|---|---|
| public static final Object VALUE_COLOR_RENDER_SPEED Color rendering hint value -- perform the fastest color conversion to the format of the output device.
| |
| VALUE_DITHER_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_DITHER_DEFAULT Dithering hint value -- use a default for dithering chosen by the implementation.
| |
| VALUE_DITHER_DISABLE | back to summary |
|---|---|
| public static final Object VALUE_DITHER_DISABLE Dithering hint value -- do not dither when rendering geometry.
| |
| VALUE_DITHER_ENABLE | back to summary |
|---|---|
| public static final Object VALUE_DITHER_ENABLE Dithering hint value -- dither when rendering geometry, if needed.
| |
| VALUE_FRACTIONALMETRICS_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_FRACTIONALMETRICS_DEFAULT Font fractional metrics hint value -- character glyphs are positioned with accuracy chosen by the implementation.
| |
| VALUE_FRACTIONALMETRICS_OFF | back to summary |
|---|---|
| public static final Object VALUE_FRACTIONALMETRICS_OFF Font fractional metrics hint value -- character glyphs are positioned with advance widths rounded to pixel boundaries.
| |
| VALUE_FRACTIONALMETRICS_ON | back to summary |
|---|---|
| public static final Object VALUE_FRACTIONALMETRICS_ON Font fractional metrics hint value -- character glyphs are positioned with sub-pixel accuracy.
| |
| VALUE_INTERPOLATION_BICUBIC | back to summary |
|---|---|
| public static final Object VALUE_INTERPOLATION_BICUBIC Interpolation hint value -- the color samples of 9 nearby
integer coordinate samples in the image are interpolated using
a cubic function in both
As the image is scaled up, there are no blocky edges and the
interpolation should appear smoother and with better depictions
of any edges in the original image than with
| |
| VALUE_INTERPOLATION_BILINEAR | back to summary |
|---|---|
| public static final Object VALUE_INTERPOLATION_BILINEAR Interpolation hint value -- the color samples of the 4 nearest neighboring integer coordinate samples in the image are interpolated linearly to produce a color sample. Conceptually the image is viewed as a set of infinitely small point color samples which have value only at the centers of integer coordinate pixels and the space between those pixel centers is filled with linear ramps of colors that connect adjacent discrete samples in a straight line.
As the image is scaled up, there are no blocky edges between
the colors in the image as there are with
| |
| VALUE_INTERPOLATION_NEAREST_NEIGHBOR | back to summary |
|---|---|
| public static final Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR Interpolation hint value -- the color sample of the nearest neighboring integer coordinate sample in the image is used. Conceptually the image is viewed as a grid of unit-sized square regions of color centered around the center of each image pixel. As the image is scaled up, it will look correspondingly blocky. As the image is scaled down, the colors for source pixels will be either used unmodified, or skipped entirely in the output representation.
| |
| VALUE_RENDER_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_RENDER_DEFAULT Rendering hint value -- rendering algorithms are chosen by the implementation for a good tradeoff of performance vs. quality.
| |
| VALUE_RENDER_QUALITY | back to summary |
|---|---|
| public static final Object VALUE_RENDER_QUALITY Rendering hint value -- rendering algorithms are chosen with a preference for output quality.
| |
| VALUE_RENDER_SPEED | back to summary |
|---|---|
| public static final Object VALUE_RENDER_SPEED Rendering hint value -- rendering algorithms are chosen with a preference for output speed.
| |
| VALUE_RESOLUTION_VARIANT_BASE | back to summary |
|---|---|
| public static final Object VALUE_RESOLUTION_VARIANT_BASE Image resolution variant hint value -- the standard resolution of an image is always used.
| |
| VALUE_RESOLUTION_VARIANT_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_RESOLUTION_VARIANT_DEFAULT Image resolution variant hint value -- an image resolution variant is chosen based on a default heuristic which may depend on the policies of the platform
| |
| VALUE_RESOLUTION_VARIANT_DPI_FIT | back to summary |
|---|---|
| public static final Object VALUE_RESOLUTION_VARIANT_DPI_FIT Image resolution variant hint value -- an image resolution variant is chosen based only on the DPI of the screen.
| |
| VALUE_RESOLUTION_VARIANT_SIZE_FIT | back to summary |
|---|---|
| public static final Object VALUE_RESOLUTION_VARIANT_SIZE_FIT Image resolution variant hint value -- an image resolution variant is chosen based on the DPI of the screen and the transform in the Graphics2D context.
| |
| VALUE_STROKE_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_STROKE_DEFAULT Stroke normalization control hint value -- geometry may be modified or left pure depending on the tradeoffs in a given implementation. Typically this setting allows an implementation to use a fast integer coordinate based platform rendering library, but does not specifically request normalization for uniformity or aesthetics.
| |
| VALUE_STROKE_NORMALIZE | back to summary |
|---|---|
| public static final Object VALUE_STROKE_NORMALIZE Stroke normalization control hint value -- geometry should be normalized to improve uniformity or spacing of lines and overall aesthetics. Note that different normalization algorithms may be more successful than others for given input paths.
| |
| VALUE_STROKE_PURE | back to summary |
|---|---|
| public static final Object VALUE_STROKE_PURE Stroke normalization control hint value -- geometry should be left unmodified and rendered with sub-pixel accuracy.
| |
| VALUE_TEXT_ANTIALIAS_DEFAULT | back to summary |
|---|---|
| public static final Object VALUE_TEXT_ANTIALIAS_DEFAULT Text antialiasing hint value -- text rendering is done according
to the
| |
| VALUE_TEXT_ANTIALIAS_GASP | back to summary |
|---|---|
| public static final Object VALUE_TEXT_ANTIALIAS_GASP Text antialiasing hint value -- text rendering is requested to
use information in the font resource which specifies for each point
size whether to apply TrueType fonts typically provide this information in the 'gasp' table. In the absence of this information, the behaviour for a particular font and size is determined by implementation defaults. Note A font designer will typically carefully hint a font for
the most common user interface point sizes. Consequently the 'gasp'
table will likely specify to use only hinting at those sizes and not
"smoothing". So in many cases the resulting text display is
equivalent to Logical fonts which are composed of multiple physical fonts will for consistency will use the setting most appropriate for the overall composite font.
| |
| VALUE_TEXT_ANTIALIAS_LCD_HBGR | back to summary |
|---|---|
| public static final Object VALUE_TEXT_ANTIALIAS_LCD_HBGR Text antialiasing hint value -- request that text be displayed
optimised for an LCD display with subpixels in order from display
left to right of B,G,R such that the horizontal subpixel resolution
is three times that of the full pixel horizontal resolution (HBGR).
This is a much less common configuration than HRGB.
Selecting this hint for displays with one of the other LCD subpixel
configurations will likely result in unfocused text.
See
| |
| VALUE_TEXT_ANTIALIAS_LCD_HRGB | back to summary |
|---|---|
| public static final Object VALUE_TEXT_ANTIALIAS_LCD_HRGB Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixels in order from display left to right of R,G,B such that the horizontal subpixel resolution is three times that of the full pixel horizontal resolution (HRGB). This is the most common configuration. Selecting this hint for displays with one of the other LCD subpixel configurations will likely result in unfocused text. Notes An implementation when choosing whether to apply any of the LCD text hint values may take into account factors including requiring color depth of the destination to be at least 15 bits per pixel (ie 5 bits per color component), characteristics of a font such as whether embedded bitmaps may produce better results, or when displaying to a non-local networked display device enabling it only if suitable protocols are available, or ignoring the hint if performing very high resolution rendering or the target device is not appropriate: eg when printing.
These hints can equally be applied when rendering to software images,
but these images may not then be suitable for general export, as the
text will have been rendered appropriately for a specific subpixel
organisation. Also lossy images are not a good choice, nor image
formats such as GIF which have limited colors.
So unless the image is destined solely for rendering on a
display device with the same configuration, some other text
anti-aliasing hint such as
Selecting a value which does not match the LCD display in use will likely lead to a degradation in text quality. On display devices (ie CRTs) which do not have the same characteristics as LCD displays, the overall effect may appear similar to standard text anti-aliasing, but the quality may be degraded by color distortion. Analog connected LCD displays may also show little advantage over standard text-antialiasing and be similar to CRTs. In other words for the best results use an LCD display with a digital display connector and specify the appropriate sub-pixel configuration.
| |
| VALUE_TEXT_ANTIALIAS_LCD_VBGR | back to summary |
|---|---|
| public static final Object VALUE_TEXT_ANTIALIAS_LCD_VBGR Text antialiasing hint value -- request that text be displayed
optimised for an LCD display with subpixel organisation from display
top to bottom of B,G,R such that the vertical subpixel resolution is
three times that of the full pixel vertical resolution (VBGR).
Vertical orientation is very uncommon and probably mainly useful
for a physically rotated display.
Selecting this hint for displays with one of the other LCD subpixel
configurations will likely result in unfocused text.
See
| |
| VALUE_TEXT_ANTIALIAS_LCD_VRGB | back to summary |
|---|---|
| public static final Object VALUE_TEXT_ANTIALIAS_LCD_VRGB Text antialiasing hint value -- request that text be displayed
optimised for an LCD display with subpixel organisation from display
top to bottom of R,G,B such that the vertical subpixel resolution is
three times that of the full pixel vertical resolution (VRGB).
Vertical orientation is very uncommon and probably mainly useful
for a physically rotated display.
Selecting this hint for displays with one of the other LCD subpixel
configurations will likely result in unfocused text.
See
| |
| VALUE_TEXT_ANTIALIAS_OFF | back to summary |
|---|---|
| public static final Object VALUE_TEXT_ANTIALIAS_OFF Text antialiasing hint value -- text rendering is done without any form of antialiasing.
| |
| VALUE_TEXT_ANTIALIAS_ON | back to summary |
|---|---|
| public static final Object VALUE_TEXT_ANTIALIAS_ON Text antialiasing hint value -- text rendering is done with some form of antialiasing.
| |
| RenderingHints | back to summary |
|---|---|
| public RenderingHints(Map<RenderingHints. Constructs a new object with keys and values initialized from the specified Map object which may be null.
| |
| RenderingHints | back to summary |
|---|---|
| public RenderingHints(RenderingHints. Constructs a new object with the specified key/value pair.
| |
| add | back to summary |
|---|---|
| public void add(RenderingHints hints) Adds all of the keys and corresponding values from the specified
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Clears this | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Creates a clone of this
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Implements java. Returns
| |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Implements java. Returns true if this RenderingHints maps one or more keys to the
specified value.
More formally, returns (value==null ? v==null : value.equals(v)). This operation will probably require time linear in the RenderingHints size for most implementations
of RenderingHints.
| |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Returns a
The entrySet returned from a | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Compares the specified (t1.get(k)==null ? t2.get(k)==null : t1.get(k).equals(t2.get(k))). This ensures that the equals method works properly across
different implementations of the Map interface.
| |
| get | back to summary |
|---|---|
| public Object get(Object key) Implements java. Returns the value to which the specified key is mapped.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Returns the hash code value for this
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Returns
| |
| keySet | back to summary |
|---|---|
| public Set Implements java. Returns a | |
| put | back to summary |
|---|---|
| public Object put(Object key, Object value) Implements java. Maps the specified
| |
| putAll | back to summary |
|---|---|
| public void putAll(Map<?, ?> m) Implements java. Copies all of the mappings from the specified
| |
| remove | back to summary |
|---|---|
| public Object remove(Object key) Implements java. Removes the key and its corresponding value from this
| |
| size | back to summary |
|---|---|
| public int size() Implements java. Returns the number of key-value mappings in this
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a rather long string representation of the hashmap
which contains the mappings of keys to values for this
| |
| values | back to summary |
|---|---|
| public Collection Implements java. Returns a
| |
RenderingHints class to control various
algorithm choices in the rendering and imaging pipelines.
Instances of this class are immutable and unique which
means that tests for matches can be made using the
== operator instead of the more expensive
equals() method.
| Modifier and Type | Field and Description |
|---|---|
| private static HashMap | |
| private int |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Overrides java. The equals method for all Key objects will return the same result as the equality operator '=='. |
| private String | |
| public final int | hashCode()
Overrides java. The hash code for all Key objects will be the same as the system identity code of the object as defined by the System.identityHashCode() method. |
| protected final int | Returns: the private integer key that the subclass instantiated this Key with.Returns the private integer key that the subclass instantiated this Key with. |
| public abstract boolean | Returns: true if val is valid;
false otherwise.the val)Object to test for validityReturns true if the specified object is a valid value for this Key. |
| private static synchronized void |
| identitymap | back to summary |
|---|---|
| private static HashMap<Object, Object> identitymap | |
| privatekey | back to summary |
|---|---|
| private int privatekey | |
| Key | back to summary |
|---|---|
| protected Key(int privatekey) Construct a key using the indicated private key. Each subclass of Key maintains its own unique domain of integer keys. No two objects with the same integer key and of the same specific subclass can be constructed. An exception will be thrown if an attempt is made to construct another object of a given class with the same integer key as a pre-existing instance of that subclass of Key.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Overrides java. The equals method for all Key objects will return the same result as the equality operator '=='. | |
| getIdentity | back to summary |
|---|---|
| private String getIdentity() | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. The hash code for all Key objects will be the same as the system identity code of the object as defined by the System.identityHashCode() method. | |
| intKey | back to summary |
|---|---|
| protected final int intKey() Returns the private integer key that the subclass instantiated this Key with.
| |
| isCompatibleValue | back to summary |
|---|---|
| public abstract boolean isCompatibleValue(Object val) Returns true if the specified object is a valid value for this Key.
| |
| recordIdentity | back to summary |
|---|---|
| private static synchronized void recordIdentity(RenderingHints. | |