avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] Storing B&W bitmap images into Flash : file format sugges


From: Marge Coahran
Subject: Re: [avr-chat] Storing B&W bitmap images into Flash : file format suggestion ?
Date: Sat, 9 Jan 2010 22:39:45 -0600 (CST)

I think the easiest image format is the PNM family (PBM for bitmaps): http://en.wikipedia.org/wiki/Netpbm_format

It takes space though. No compression is done. Note that each format in the family can be written in binary or ascii. Obviously the ascii is pretty wasteful, but examples are usually given in the ascii form, so you can see the data. One thing to note is that if you use the binary form, the 3 (for PBM) or 4 (for PGM, PPM) headers lines are still written as ascii digits, then a single whitespace character (usually newline), then the pixel values written in binary.

Marge

On Sun, 10 Jan 2010, Vincent Trouilliez wrote:

Hi list,

Back again...resuming work on my OBD reader after 6+ months off...
My first "proof of concept" prototype, which used a simple 4x20 text
LCD, kinda worked (just needs some minor bug fixing to really work,
I think).
So now I am starting work on a more complex version of the
device. Main change for now, will be replacing the small text LCD by a
large graphic LCD. It's a 240x128 unit with a Toshiba  T6963 controller.

I would like to display a full screen "welcome" picture at start-up,
but I don't have any experience with storing and displaying
bitmap graphics yet, so I am in learning mode... I guess I will have a
few questions in the coming days on how to stuff that binary file into
Flash, and then read it to display it, but for now my first question is:

- What's the usual/easiest file format that people use, to store 1-bit
(black and white) bitmap images/pictures ?

I am asking this, because I created a test picture: a 240x128 picture
that's completely white. I then saved it into "BMP" file format, and
then looked at the resulting binary data using a hex file editor, to
check how things are stored. I can see a header of 62 bytes, no
trailer, and what looks like a kind of 16 bit "checksum" every 30 byte
of data. The header is easy enough to skip by means of an offset, but
the CRC bytes that split the picture in small chuncks, is a bit of a
nightmare I would like to avoid if possible :-/
Especially because aside from storing a pretty picture, I would also
like to define a custom font table (in order to allow for larger
characters than the usual 5x7 font provided by the LCD controller).
I was thinking of creating a single file/picture, where all the new
characters and digits would be stuffed together. Then using an offset I
could easily select/locate where a particular character is located
within the picture, then read it from there, and dump the
data/sub-bitmap on the screen. But that assumes a "clean"/linear data
space in the file...

So what do you gents would suggest for a file format ? Which one is
easiest to deal with ? Is there a file format which (aside from the
necessary header which is easy to skip) does not "pollute" the
picture data with CRC's or other unwanted/annoying bytes, so one can
read it in a simple/linear fashion ?


Thanks in advance for your input ! :-)


Regards,


--
Vince



_______________________________________________
AVR-chat mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-chat





reply via email to

[Prev in Thread] Current Thread [Next in Thread]