Example usage for java.awt RenderingHints RenderingHints

List of usage examples for java.awt RenderingHints RenderingHints

Introduction

In this page you can find the example usage for java.awt RenderingHints RenderingHints.

Prototype

public RenderingHints(Key key, Object value) 

Source Link

Document

Constructs a new object with the specified key/value pair.

Usage

From source file:org.esa.nest.gpf.ERSCalibrator.java

private RenderedImage smoothImage(final RenderedImage rawImage) {

    final int slidingWindowWidth = windowWidth / blockWidth;
    final int slidingWindowHeight = windowHeight / blockHeight;

    final BorderExtender extender = BorderExtender.createInstance(BorderExtender.BORDER_REFLECT);
    final RenderingHints hints = new RenderingHints(JAI.KEY_BORDER_EXTENDER, extender);

    final ParameterBlock pb = new ParameterBlock();
    pb.addSource(rawImage);// www.jav  a2s .  co  m
    pb.add(slidingWindowWidth);
    pb.add(slidingWindowHeight);
    pb.add(slidingWindowWidth / 2);
    pb.add(slidingWindowHeight / 2);
    return JAI.create("boxfilter", pb, hints);
}

From source file:edu.ku.brc.ui.UIHelper.java

/**
 * Creates rendering hints for Text.//from ww w  . j  a  v a 2s  . com
 */
public static RenderingHints createTextRenderingHints() {
    RenderingHints renderingHints = new RenderingHints(RenderingHints.KEY_INTERPOLATION,
            RenderingHints.VALUE_INTERPOLATION_BICUBIC);
    Object value = RenderingHints.VALUE_TEXT_ANTIALIAS_ON;
    try {
        Field declaredField = RenderingHints.class.getDeclaredField("VALUE_TEXT_ANTIALIAS_LCD_HRGB");
        value = declaredField.get(null);

    } catch (Exception e) {
        // do nothing
    }
    renderingHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, value);
    return renderingHints;
}