aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-05-13 13:08:56 +0200
committerMattias Andrée <maandree@operamail.com>2013-05-13 13:08:56 +0200
commit53f84cb161c28593dc4081771fe2932ce473e87e (patch)
tree910f1ecf2c55fee95ec1deb27046e0c98ca8bf1b
parentadd the glue (diff)
downloadsplashtool-53f84cb161c28593dc4081771fe2932ce473e87e.tar.gz
splashtool-53f84cb161c28593dc4081771fe2932ce473e87e.tar.bz2
splashtool-53f84cb161c28593dc4081771fe2932ce473e87e.tar.xz
add widescreen support
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/Assemble.java15
-rwxr-xr-xsrc/splashtool3
2 files changed, 16 insertions, 2 deletions
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"