Search in sources :

Example 1 with InterpolationBicubic

use of javax.media.jai.InterpolationBicubic in project sldeditor by robward-scisys.

the class InterpolationValues method setValue.

/*
     * (non-Javadoc)
     *
     * @see
     * com.sldeditor.rendertransformation.types.RenderTransformValueInterface#setValue(java.lang.
     * Object)
     */
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;
    if (aValue instanceof LiteralExpressionImpl) {
        String displayName = ((Expression) aValue).toString();
        if (InterpolationNearest.class.getSimpleName().compareTo(displayName) == 0) {
            value = new InterpolationNearest();
        } else if (InterpolationBilinear.class.getSimpleName().compareTo(displayName) == 0) {
            value = new InterpolationBilinear();
        } else if (displayName.startsWith(InterpolationBicubic2.class.getSimpleName())) {
            sampleBits = extractSampleBits(INTERPOLATION_BICUBIC2_PATTERN_MATCH, displayName);
            value = new InterpolationBicubic2(sampleBits);
        } else if (displayName.startsWith(InterpolationBicubic.class.getSimpleName())) {
            sampleBits = extractSampleBits(INTERPOLATION_BICUBIC_PATTERN_MATCH, displayName);
            value = new InterpolationBicubic(sampleBits);
        }
    } else if ((aValue instanceof AttributeExpressionImpl) || (aValue instanceof FunctionExpressionImpl) || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
Also used : InterpolationBicubic(javax.media.jai.InterpolationBicubic) InterpolationNearest(javax.media.jai.InterpolationNearest) InterpolationBicubic2(javax.media.jai.InterpolationBicubic2) MathExpressionImpl(org.geotools.filter.MathExpressionImpl) Expression(org.opengis.filter.expression.Expression) AttributeExpressionImpl(org.geotools.filter.AttributeExpressionImpl) LiteralExpressionImpl(org.geotools.filter.LiteralExpressionImpl) InterpolationBilinear(javax.media.jai.InterpolationBilinear) FunctionExpressionImpl(org.geotools.filter.FunctionExpressionImpl)

Aggregations

InterpolationBicubic (javax.media.jai.InterpolationBicubic)1 InterpolationBicubic2 (javax.media.jai.InterpolationBicubic2)1 InterpolationBilinear (javax.media.jai.InterpolationBilinear)1 InterpolationNearest (javax.media.jai.InterpolationNearest)1 AttributeExpressionImpl (org.geotools.filter.AttributeExpressionImpl)1 FunctionExpressionImpl (org.geotools.filter.FunctionExpressionImpl)1 LiteralExpressionImpl (org.geotools.filter.LiteralExpressionImpl)1 MathExpressionImpl (org.geotools.filter.MathExpressionImpl)1 Expression (org.opengis.filter.expression.Expression)1