Changeset 29828 in osm for applications
- Timestamp:
- 2013-08-06T16:15:48+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java
r29677 r29828 42 42 43 43 private JCheckBox enableTableauAssemblage = new JCheckBox(tr("Use \"Tableau d''assemblage\"")); 44 45 private JCheckBox simplify2BitsColors = new JCheckBox(tr("Replace grey shades by white color only")); 44 46 45 47 private JCheckBox autoFirstLayer = new JCheckBox(tr("Select first WMS layer in list.")); … … 125 127 reversGrey.setSelected(Main.pref.getBoolean("cadastrewms.invertGrey", false)); 126 128 reversGrey.setToolTipText(tr("Invert the original black and white colors (and all intermediate greys). Useful for texts on dark backgrounds.")); 127 cadastrewms.add(reversGrey, GBC.eop().insets(0 0, 0, 0, 0));129 cadastrewms.add(reversGrey, GBC.eop().insets(0, 0, 0, 0)); 128 130 129 131 // option to enable transparency … … 290 292 enableTableauAssemblage.setToolTipText(tr("Add the \"Tableau(x) d''assemblage\" in the list of cadastre sheets to grab.")); 291 293 cadastrewms.add(enableTableauAssemblage, GBC.eop().insets(0, 0, 0, 0)); 294 // option to use 2 bits colors only 295 simplify2BitsColors.setSelected(Main.pref.getBoolean("cadastrewms.raster2bitsColors", false)); 296 simplify2BitsColors.setToolTipText(tr("Replace greyscale by white color (smaller files and memory usage).")); 297 cadastrewms.add(simplify2BitsColors, GBC.eop().insets(0, 0, 0, 0)); 292 298 // the crosspiece display 293 299 JLabel jLabelCrosspieces = new JLabel(tr("Display crosspieces:")); … … 404 410 Main.pref.put("cadastrewms.noImageCropping", disableImageCropping.isSelected()); 405 411 Main.pref.put("cadastrewms.useTA", enableTableauAssemblage.isSelected()); 412 Main.pref.put("cadastrewms.raster2bitsColors", simplify2BitsColors.isSelected()); 406 413 if (crosspiece1.isSelected()) Main.pref.put("cadastrewms.crosspieces", "0"); 407 414 else if (crosspiece2.isSelected()) Main.pref.put("cadastrewms.crosspieces", "1"); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageModifier.java
r29801 r29828 66 66 int height = bufferedImage.getHeight(); 67 67 BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); 68 // converting grey scale colors to black/white is configurable (use less resources but is less readable) 69 boolean simplifyColors = Main.pref.getBoolean("cadastrewms.raster2bitsColors", false); 68 70 for (int y = 0; y < height; y++) { 69 71 for (int x = 0; x < width; x++) { … … 75 77 Color maskedColor; 76 78 if (rgb == cadastreBackground) { 77 maskedColor = new Color(r, g, b, 0x00); // transparent 79 maskedColor = simplifyColors ? new Color(0xff, 0xff, 0xff, 0x00) : 80 new Color(r, g, b, 0x00); // transparent 78 81 } else { 79 maskedColor = new Color(r, g, b, 0xFF); // opaque 82 maskedColor = simplifyColors ? new Color(0, 0, 0, 0xFF) : 83 new Color(r, g, b, 0xFF); // opaque 80 84 } 81 //maskedColor = new Color(r, g, b, alpha);82 85 bi.setRGB(x, y, maskedColor.getRGB()); 83 86 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r29714 r29828 248 248 if (isRaster) { 249 249 str += "\n"+tr("Is not vectorized."); 250 str += "\n"+tr("Raster size: {0}", communeBBox); 250 str += "\n"+tr("Bounding box: {0}", communeBBox); 251 if(images.size()>0) 252 str += "\n"+tr("Image size (px): {0}/{1}", images.get(0).image.getWidth(), images.get(0).image.getHeight()); 251 253 } else 252 254 str += "\n"+tr("Is vectorized.");
Note:
See TracChangeset
for help on using the changeset viewer.