/** * Sets the value of a single preference for the rendering algorithms. * Hint categories include controls for rendering quality and overall * time/quality trade-off in the rendering process. Refer to the * <code>RenderingHints</code> class for definitions of some common * keys and values. * @param hintKey the key of the hint to be set. * @param hintValue the value indicating preferences for the specified * hint category. * @see RenderingHints */ public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue){ _hints.put(hintKey, hintValue); }
layout.setTileGridXOffset(image.getMinX()); layout.setTileGridYOffset(image.getMinY()); hints.put(JAI.KEY_IMAGE_LAYOUT, layout);
private RenderingHints getHints() { final RenderingHints hints = new RenderingHints(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); return hints; }
hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); offscreen.addRenderingHints(hints);
hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); offscreen.addRenderingHints(hints);
/** * Constructs a new object with the specified key/value pair. * * @param key The key of the particular hint property. * @param value The value of the hint property specified with {@code key}. */ public Hints(final RenderingHints.Key key, final Object value) { super(null); // Don't use 'super(key,value)' because it doesn't check validity. super.put(key, value); }
/** * Constructs a new object with two key/value pair. * * @param key1 The key for the first pair. * @param value1 The value for the first pair. * @param key2 The key2 for the second pair. * @param value2 The value2 for the second pair. * @since 2.4 */ public Hints( final RenderingHints.Key key1, final Object value1, final RenderingHints.Key key2, final Object value2) { this(key1, value1); super.put(key2, value2); }
private RenderingHints createDefaultRenderingHints(Graphics2D graphics) { RenderingHints r = new RenderingHints(null); r.put(RenderingHints.KEY_INTERPOLATION, isBitonal(graphics) ? RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR : RenderingHints.VALUE_INTERPOLATION_BICUBIC); r.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); r.put(RenderingHints.KEY_ANTIALIASING, isBitonal(graphics) ? RenderingHints.VALUE_ANTIALIAS_OFF : RenderingHints.VALUE_ANTIALIAS_ON); return r; }
/** * Utility method used to copy (key,value) pairs into this Hints map. * * @param pairs An array of Key/Value pairs. * @throws IllegalArgumentException if a value is illegal. */ private void fromPairs(final Object[] pairs) throws IllegalArgumentException { if ((pairs.length & 1) != 0) { throw new IllegalArgumentException( Errors.format(ErrorKeys.ODD_ARRAY_LENGTH_$1, pairs.length)); } for (int i = 0; i < pairs.length; i += 2) { super.put(pairs[i], pairs[i + 1]); } }
private static RenderingHints createRenderingHints(Hints hints, RasterLayerRequest request) { RenderingHints renderHints = new RenderingHints(null); if (request.getInterpolation() != null) { renderHints.put(JAI.KEY_INTERPOLATION, request.getInterpolation()); } return renderHints; }
case NOCOLOROPT: renderingHints = new RenderingHints(null); renderingHints.put(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); renderingHints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); renderingHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); break;
if ((l != null) && (l instanceof ImageLayout)) { final ImageLayout layout = (ImageLayout) ((ImageLayout) l).clone(); localHints.put(JAI.KEY_IMAGE_LAYOUT, layout);
if ((l != null) && (l instanceof ImageLayout)) { final ImageLayout layout = (ImageLayout) ((ImageLayout) l).clone(); localHints.put(JAI.KEY_IMAGE_LAYOUT, layout);
newCm.createCompatibleSampleModel(image.getWidth(), image.getHeight())); hints.put(JAI.KEY_IMAGE_LAYOUT, layout); return hints;
hints.put(JAI.KEY_TRANSFORM_ON_COLORMAP, Boolean.FALSE);
hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout); } else { hints.put(JAI.KEY_IMAGE_LAYOUT, layout);
hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout); } else { hints.put(JAI.KEY_IMAGE_LAYOUT, layout);