On Wed, 13 Jan 2010 10:56:03 +1030
"Daniel O'Connor" <address@hidden> wrote:
Starting to sound like too much work IMO :)
Yeah, I think I will just write my own little C programme to convert
the picture into a C array of bytes. I now fancy doing it regardless,
just as a little exercise... and it's just cool to build his own tools
I find ! I mean, can't be that complex, just need to figure out how to
read a binary file on Linux.
FreeBSD comes with 'file2c'
http://svn.freebsd.org/viewvc/base/head/usr.bin/file2c/file2c.c?revision=200462&view=markup
I guess this does what I stated above ? It must read a file fro the
disk, but for the life ofd me I can't see any instruction/command
related to reading/opening files in this piece of code.. I must be
blind ?! :-/
Anyway, I will just search for some Linux C tutorial (I assume the
commands to handle files/disks are specific to Linux, so a Windows
C tutorial won't do !...)
Also it only does RGBA which will cost you lots of RAM since you only
want B&W.
Yeah we have already pointed this out I think ;-)
RLE is Run Length Encoding, a basic compression scheme
http://en.wikipedia.org/wiki/Run-length_encoding
Thanks ! This Wikipedia thing is bloody useful isn't it !
RLE yeah.. now I think of it, ISTR it was used in the "PCX" picture
file format in Windows 3.1 a century ago LOL...
I don't think it's suited to my project though... it would save me
space, but there is too much decoding for the case at hand, and it
would be too much work when displaying font digits. So I prefer an
uncompressed format, where I can just dump my array of bits straight
onto the LCD, to draw very fast, with maybe some shifting or masking
or trivial things, but no arythmetic/calculations...
I was suggested this utility off-list:
http://www.dreamsware.info/
It looks great, but I am not quite sure that it stuffs 8 pixels per
byte, I fear it wastes a whole byte for each single B/W pixel... which I
can't afford (I am using an ATmega32, I have space for one full screen
picture or two (I don't need more anyway), but that's about it). I must
absolutely pack 8 pixels per byte. The BMP format I tried the other day
appears to do that, so it could be a good base for my utility program.
I will keep searching a little bit for less "polluted" formats though,
to simplify the work.
Regards,
--
Vince
_______________________________________________
AVR-chat mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-chat