diff --git a/tools/image/img2lcd.pl b/tools/image/img2lcd.pl new file mode 100755 index 0000000..5f9fee1 --- /dev/null +++ b/tools/image/img2lcd.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl + +# img2lcd.pl - by 05/2011, BSD Licence +# +# This script converts an image to .lcd format for the r0ket + +use strict; +use warnings; +use Getopt::Long; +use Module::Load; + +$|=1; + +### +### Runtime Options +### + +my ($verbose); + +GetOptions ( + "verbose" => \$verbose, # flag + "help" => sub { + print <new($in); + + +my $w=$image->width; +my $h=$image->height; + +my @img; +for my $y (0..$h){ + for my $x (0..$w){ + my $px= $image->getPixel($x,$y); + $img[$x][$y/8]|=$px<<(7-$y%8); + if($verbose){ + $px=~y/01/ */; print STDERR $px; + }; + }; + if ($verbose){ + print STDERR "<\n"; + }; +}; + +open(F,">",$out)||die "open: $!"; + +my $hb=int($h/8); +for my $y (0..$hb){ + for my $x (0..$w){ + printf F "%c",$img[$w-$x][$hb-$y]; + }; +}; + +close(F); diff --git a/tools/image/src/i42.gif b/tools/image/src/i42.gif new file mode 100755 index 0000000..acd34ee Binary files /dev/null and b/tools/image/src/i42.gif differ