aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony McCrary2014-01-28 16:20:58 (EST)
committerLars Vogel2014-02-08 15:01:18 (EST)
commit935a9a8d14eec1ce5acddb4e50098637f8aeb2bc (patch)
tree4a524a584a16718b656cc509e95250844f16637a
parentf91ea1ed14d9eaeb803d4da62971e6f4e14afaa0 (diff)
downloadeclipse.platform.ui-935a9a8d14eec1ce5acddb4e50098637f8aeb2bc.zip
eclipse.platform.ui-935a9a8d14eec1ce5acddb4e50098637f8aeb2bc.tar.gz
eclipse.platform.ui-935a9a8d14eec1ce5acddb4e50098637f8aeb2bc.tar.bz2
Bug 426365 -added image filter which reduces contrast for disabled icons refs/changes/23/21223/3
Change-Id: Ia6dc3e28ad04a5c7a3d83ce2bc5736c4d05f99c1 Signed-off-by: Tony McCrary <tmccrary@gmail.com>
-rw-r--r--bundles/org.eclipse.ui.images.renderer/src/main/java/org/eclipse/ui/images/renderer/RenderMojo.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.ui.images.renderer/src/main/java/org/eclipse/ui/images/renderer/RenderMojo.java b/bundles/org.eclipse.ui.images.renderer/src/main/java/org/eclipse/ui/images/renderer/RenderMojo.java
index baca708..45a2e18 100644
--- a/bundles/org.eclipse.ui.images.renderer/src/main/java/org/eclipse/ui/images/renderer/RenderMojo.java
+++ b/bundles/org.eclipse.ui.images.renderer/src/main/java/org/eclipse/ui/images/renderer/RenderMojo.java
@@ -45,6 +45,7 @@ import org.apache.maven.plugin.logging.Log;
import org.w3c.dom.Element;
import org.w3c.dom.svg.SVGDocument;
+import com.jhlabs.image.ContrastFilter;
import com.jhlabs.image.GrayscaleFilter;
import com.jhlabs.image.HSBAdjustFilter;
@@ -130,6 +131,9 @@ public class RenderMojo extends AbstractMojo {
/** Used for creating desaturated icons */
private HSBAdjustFilter desaturator;
+
+ /** Reduces contrast for disabled icons. */
+ private ContrastFilter decontrast;
/**
* @return the number of icons rendered at the time of the call
@@ -310,7 +314,9 @@ public class RenderMojo extends AbstractMojo {
BufferedImage desaturated16 = desaturator.filter(
grayFilter.filter(sourceImage, null), null);
- ImageIO.write(desaturated16, "PNG", new File(icon.disabledPath, icon.nameBase + ".png"));
+ BufferedImage deconstrast = decontrast.filter(desaturated16, null);
+
+ ImageIO.write(deconstrast, "PNG", new File(icon.disabledPath, icon.nameBase + ".png"));
}
} catch (Exception e1) {
log.error("Failed to resize rendered icon to output size: " +
@@ -581,6 +587,10 @@ public class RenderMojo extends AbstractMojo {
desaturator = new HSBAdjustFilter();
desaturator.setSFactor(0.0f);
+
+ decontrast = new ContrastFilter();
+ decontrast.setBrightness(2.9f);
+ decontrast.setContrast(0.2f);
}
/**