Active Topics

 


Reply
Thread Tools
tz1's Avatar
Posts: 716 | Thanked: 236 times | Joined on Dec 2007
#1
http://www.zdez.org/drawrgb.py

On a tablet,

"python2.5 disprgb.py /mnt/initrd/usr/share/images/logo-nokia" will display the nokia logo in a window. The only other file in this format is qgn_indi_charger_connection_detected in the same directory, but there is another which is an actual png file.

I haven't tried substituting anything for the logos yet or changing the startup scripts which run the programs which display these.

The format starts with two 4 byte integers, one each for width and height in that order, then the image. The image is a set of code/datas starting with a 1 byte rle code. zero is a terminator. If the code is > 127, the number is anded with 127 and the next byte-pair is repeated that many times. If the code is < 128, it means that that many following byte pairs (2*code bytes total) should be copied. (I don't think 0x80 as a code - zero reps - occurs).

The byte pairs are in framebuffer format, BBBBBGGG GGGRRRRR
 

The Following 3 Users Say Thank You to tz1 For This Useful Post:
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#2
FYI, 0xffff has a C tool for encoding and decoding these, logotool, which builds fine in Maemo and in Cygwin/NT5.1; I'll attach it here (both binaries in source directory, but the .exe will not work unless you have Cygwin installed).
Attached Files
File Type: tar logotool.tar (120.0 KB, 126 views)
 

The Following 2 Users Say Thank You to Benson For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#3
I've used logotool before and replaced the logo in the initfs but I've had the program displaying the initfs logo segfault...

It's also worth noting that nokia have the logo in nolo too (i've commented out the lines that display the initfs logo in linuxrc but I still get the nokia logo).
 
tz1's Avatar
Posts: 716 | Thanked: 236 times | Joined on Dec 2007
#4
His compress doesn't actually compress, just codes everything as literal byte pairs.

I can't tell if I've got everything right (corner cases mainly since I've tested common things), but the attached will handle anything Python can accept to load as an image (which includes gif, png, jpg) and actually compress the output to logo-out.
Attached Files
File Type: gz im2pix.py.gz (751 Bytes, 104 views)
 

The Following 2 Users Say Thank You to tz1 For This Useful Post:
tz1's Avatar
Posts: 716 | Thanked: 236 times | Joined on Dec 2007
#5
It seems to use the filesize and/or W*H to determine when to stop.
Notes on the rle byte:

0 - ignored, proceeds with the next byte as a new rle byte.

1-127 - copy the next N byte-pairs to the buffer.

128-255, copy the following byte-pair N-128 times to the buffer. If N==128, don't copy anything, but do read/skip the byte pair.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:32.