From 53f84cb161c28593dc4081771fe2932ce473e87e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 13 May 2013 13:08:56 +0200 Subject: add widescreen support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/Assemble.java | 15 +++++++++++++++ src/splashtool | 3 +-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Assemble.java b/src/Assemble.java index a1d9563..6a9a592 100644 --- a/src/Assemble.java +++ b/src/Assemble.java @@ -137,10 +137,25 @@ public class Assemble g.drawImage(shadow, offx + 1, offy + 1, null); g.drawImage(foreground, offx, offy, null); g.dispose(); + + if (args[1].toLowerCase().startsWith("-w") || args[1].toLowerCase().startsWith("--w")) + splash = widescreen(splash); + ImageIO.write(splash, "png", new BufferedOutputStream(new FileOutputStream(new File(args[0])))); } + private static BufferedImage widescreen(BufferedImage img) + { + BufferedImage rc = new BufferedImage(480 * 16 / 9, 480, BufferedImage.TYPE_INT_ARGB); + Graphics2D g = rc.createGraphics(); + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); + g.drawImage(img, 0, 0, 480 * 16 / 9, 480, 0, 0, 640, 480, null); + g.dispose(); + return rc; + } + + private static int join(int fg, int bg, int alpha) { double t = alpha * linear(fg) + (255 - alpha) * linear(bg); diff --git a/src/splashtool b/src/splashtool index d653f5d..9ab14c6 100755 --- a/src/splashtool +++ b/src/splashtool @@ -23,7 +23,6 @@ in="$(realpath "$1")" out="$(realpath "$2")" d="$(dirname "$(realpath "$0")")" - cd "$(dirname "$1")" -cat "$in" | "$d"/trim.py | "$d"/parse.py | java -cp "$d" Assemble "$out" +cat "$in" | "$d"/trim.py | "$d"/parse.py | java -cp "$d" Assemble "$out" "$3" -- cgit v1.2.3-70-g09d2