Skip to content

Commit

Permalink
Merge pull request #27 from ebocher/release
Browse files Browse the repository at this point in the history
Fix release action
  • Loading branch information
ebocher authored Sep 24, 2024
2 parents 45f594e + a93369c commit 205c0e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
9 changes: 6 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.orbisgis</groupId>
<artifactId>demat</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<packaging>pom</packaging>
<description>Demat is breton word to said "Hello". Demat is library to run Vega-lite specifications.</description>
<!-- Properties -->
<properties>
Expand All @@ -26,8 +26,11 @@

<!-- Plugins versions -->
<exec-maven-version>3.0.0</exec-maven-version>
<gmaven-version>3.0.2</gmaven-version>
<maven-assembly-version>3.3.0</maven-assembly-version>
<maven-bundle-version>5.1.2</maven-bundle-version>
<maven-clean-version>3.1.0</maven-clean-version>
<maven-compiler-version>3.8.1</maven-compiler-version>
<maven-enforcer-version>3.0.0</maven-enforcer-version>
<maven-gpg-plugin-version>3.0.1</maven-gpg-plugin-version>
<maven-jar-version>3.2.0</maven-jar-version>
Expand Down Expand Up @@ -387,8 +390,8 @@
<url>https://github.com/ebocher/demat</url>
<licenses>
<license>
<name>The GNU General Public License, Version 3.0</name>
<url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
<name>GNU Lesser General Public License (LGPLV3+)</name>
<url>http://www.gnu.org/licenses/lgpl-3.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
Expand Down
40 changes: 19 additions & 21 deletions src/main/java/org/orbisgis/demat/SvgRasterizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,30 @@
import java.net.URL;
import java.util.Map;

import static java.awt.RenderingHints.*;
import static java.awt.image.BufferedImage.TYPE_INT_ARGB;

/**
* @author Erwan Bocher, CNRS 2023-2024
*/
public class SvgRasterizer {
public final static Map<Object, Object> RENDERING_HINTS = Map.of(
KEY_ANTIALIASING,
VALUE_ANTIALIAS_ON,
KEY_ALPHA_INTERPOLATION,
VALUE_ALPHA_INTERPOLATION_QUALITY,
KEY_COLOR_RENDERING,
VALUE_COLOR_RENDER_QUALITY,
KEY_DITHERING,
VALUE_DITHER_DISABLE,
KEY_FRACTIONALMETRICS,
VALUE_FRACTIONALMETRICS_ON,
KEY_INTERPOLATION,
VALUE_INTERPOLATION_NEAREST_NEIGHBOR,
KEY_RENDERING,
VALUE_RENDER_QUALITY,
KEY_STROKE_CONTROL,
VALUE_STROKE_PURE,
KEY_TEXT_ANTIALIASING,
VALUE_TEXT_ANTIALIAS_ON
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON,
RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY,
RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY,
RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE,
RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON,
RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR,
RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY,
RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_PURE,
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON
);

private final static SVGUniverse sRenderer = new SVGUniverse();
Expand All @@ -108,7 +106,7 @@ public BufferedImage rasterize(final InputStream path, final float ratio )
final int wScaled = (int) scaled.getWidth();
final int hScaled = (int) scaled.getHeight();

final BufferedImage image = new BufferedImage( wScaled, hScaled, TYPE_INT_ARGB );
final BufferedImage image = new BufferedImage( wScaled, hScaled, BufferedImage.TYPE_INT_ARGB );

final Graphics2D g = image.createGraphics();
g.setRenderingHints( RENDERING_HINTS );
Expand Down

0 comments on commit 205c0e5

Please sign in to comment.