#!/usr/bin/perl
-#
-# Convert an LSS-16 image to PPM
-#
-# Usage:
-#
-# lss16toppm [-map] < file.lss > file.ppm
-#
-# The -map causes the color map to be output on stderr.
-#
+## -----------------------------------------------------------------------
+##
+## Copyright 2001-2008 H. Peter Anvin - All Rights Reserved
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+##
+## lss16toppm:
+## Convert an LSS-16 image to PPM
+##
+## Usage:
+##
+## lss16toppm [-map] < file.lss > file.ppm
+##
+## The -map causes the color map to be output on stderr.
+##
+
+eval { use bytes; };
+eval { binmode STDIN; };
+eval { binmode STDOUT; };
$map = 0;
foreach $arg ( @ARGV ) {
# Truncate overlong runs
$c = $xsize-$x if ( $c > $xsize-$x );
# Output run
- while ( $c ) {
- print $color{$n};
- $c--;
- $x++;
- }
+ print $color{$n} x $c;
+ $x += $c;
}
}
}