Ignore:
Timestamp:
2010-02-09T19:42:26+01:00 (15 years ago)
Author:
clementm
Message:

WMSLayer image drawing filtering options:

  • Nearest Neighbor = Default, fastest : poor readability if zooming out
  • Bilinear, fast : good readability if low resolution, blury if zooming in
  • Bicubic, slow: best readability when zooming out, good readability if zooming in
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java

    r19702 r19949  
    1010import java.awt.Image;
    1111import java.awt.Point;
     12import java.awt.RenderingHints;
    1213import java.awt.Toolkit;
    1314import java.awt.image.BufferedImage;
     
    234235    public void paint(Graphics2D g, final MapView mv, Bounds bounds) {
    235236        synchronized(this){
     237            Object savedInterpolation = g.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
     238            if (savedInterpolation == null) savedInterpolation = RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
     239            String interpolation = Main.pref.get("cadastrewms.imageInterpolation", "Standard");
     240            if (interpolation.equals("bilinear"))
     241                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
     242            else if (interpolation.equals("bicubic"))
     243                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
     244            else
     245                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
    236246            for (GeorefImage img : images)
    237247                img.paint(g, mv, CadastrePlugin.backgroundTransparent,
    238248                        CadastrePlugin.transparency, CadastrePlugin.drawBoundaries);
     249            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, savedInterpolation);
    239250        }
    240251        if (this.isRaster) {
Note: See TracChangeset for help on using the changeset viewer.