I have a bitmap image(543 Χ 800) and i want to convert it into an Array of (bytes?) in order to process it in embedded system environment. Any help would be precious!
I have a bitmap image(543 Χ 800) and i want to convert it into an Array of (bytes?) in order to process it in embedded system environment. Any help would be precious!
Isn't this a matter of parsing the file according to the format?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I basically want the array of rgb values.
Okay, so what's stopping you from getting them?
I mean, you can either find an existing library to do the parsing for you, or you can implement a parser yourself (especially if you have very specific requirements and hence don't have to worry about variations of the BMP file format).
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Use GIMP and Export to C file. Example (I want to believe X-Files poster):
Code:/* GIMP RGB C-Source image dump (believe.c) */ static const struct { unsigned int width; unsigned int height; unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */ unsigned char pixel_data[320 * 402 * 3 + 1]; } gimp_image = { 320, 402, 3, "\261\331\316\254\326\312\251\323\307\251\324\310\252\330\313\251\331\313" "\247\327\311\247\332\313\251\330\314\247\325\310\252\330\313\254\332\317" ... };
OP:
Do you know what an Compiler is? If no, you need to learn about Compilers.
Do you have an C Compiler for your embedded system? If no, find one.
Do you know how to compile an C file for your embedded system? If no, find out how.
If you still have problems post the information needed to help you; if you fail to post the information I for one will write you off as an "Help Vampire".
The answers to the above questions is needed information!
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
Visit my website for lots of associated C programming resources.
https://github.com/MalcolmMcLean