Move mboot documentation to the doc/ directory
[profile/ivi/syslinux.git] / lss16toppm
index 513aa9e..18b7f64 100755 (executable)
@@ -1,13 +1,30 @@
 #!/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 ) {
@@ -87,11 +104,8 @@ for ( $y = 0 ; $y < $ysize ; $y++ ) {
            # 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;
        }
     }
 }