Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: 6 x 8 graphics anyone? ;-)

6 x 8 graphics anyone? ;-)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 8 May 2002 01:01:06 +0200 (MET DST)

Yes

I discovered that if you fire up GIMP, create a black-and-white image 6
pixels wide and 8 pixels high and save it as "XBM", you get an almost usable
source output.

It only saves the bytes row-by-row instead of the column-by-column that we
want.

The following little perl script "rotates" the bytes and makes a neat array
to use in the code for the Recorder LCD. Feel free to tear apart and improve.

Yes, I added two "icons" in the dir browser I made this way. ;-)

---- snip ----
#!/usr/bin/perl

while(<STDIN>) {
    if($_ =~
       / 0x(..), 0x(..), 0x(..), 0x(..), 0x(..), 0x(..), 0x(..), 0x(..)/)
{

        ($a[0], $a[1], $a[2], $a[3], $a[4], $a[5], $a[6], $a[7])=
            ($1,$2,$3,$4,$5,$6,$7,$8);

        my _at_b;

        for(0 .. 7) {
            $bit = $_;

            for(0 .. 7) {
              # printf("check %02x in %02x\n", (1<<$bit), hex($a[$_]));
                if(hex($a[$_]) & (1 << $bit)) {
                    $b[$bit] |= (1 << $_);
                }

              # printf("b[$bit] = %x (byte %d)\n", $b[$bit], $_);
            }

        }

        for(0 .. 5) {
            printf("0x%02x, ", $b[$_]);
        }
        print "}; \n";
    }
    else {
        print $_;
    }
}
---- snip ----

-- 
  Daniel Stenberg -- Hacking Archos => http://bjorn.haxx.se/rockbox/
Received on 2002-05-08

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy