Go Down

Topic: .bmp to .cpp on mac (Read 2 times) previous topic - next topic

bperrybap

The Big/Little endian, referenced doesn't really makes sense for bit ordering, so I assume they
mean LSB to MSB for "little" endian.

It sounds like the byte orientation is horizontal and is LSB to MSB so it matches
the data format of X bitmaps, which means you can directly
use the data created by the .xbm exports from gimp.



--- bill

jeanmat

Hi there,
found this topic as I am trying to do the same as zonkzonk (actually print a QR code on the thermal printer)
thanks bill for your advices, but it looks that .xbm exports from gimp are not what is expected, if you have any further insights, I'd gladly go on with them, or if anyone managed to convert bitmaps to cpp on a mac (using The Gimp or Graphic Converter or...) to use with the arduino...
thanks!
mat

robtillaart


Think it is quite well possible to make even an Arduino program to convert a bmp file to cpp code.

strip of the header and loop through the data - http://en.wikipedia.org/wiki/BMP_file_format -
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

bperrybap


Hi there,
found this topic as I am trying to do the same as zonkzonk (actually print a QR code on the thermal printer)
thanks bill for your advices, but it looks that .xbm exports from gimp are not what is expected, if you have any further insights, I'd gladly go on with them, or if anyone managed to convert bitmaps to cpp on a mac (using The Gimp or Graphic Converter or...) to use with the arduino...
thanks!
mat


".cpp" is not a graphic format. There are many ways that bitmap data can be encoded and stored
into a C data array for compiling and linking into a program image.
Getting the bitmap data into a C data array is really only half the issue.
Gimp takes the bitmap file data and creates a C data array that can be used to compile and link into your
code.
Once the data is stored in the program image you still have to have code to get it
out and then do something with it.
Depending on the format of the data, you may or may not have to massage the data in order to use it.
You will have to look at the format and bit ordering of what you have vs what you need and write
the necessary code to do what ever is necessary.
The massaging of the data can happen up front before it is converted into a C data array
or it can happen run time or be done a bit in each.
It all depends on what you have vs what you need and the tools you are using.


--- bill


Go Up