Dump a BMP file 2 an array of arrays (of arrays) #256
Replies: 6 comments
-
Posted at 2014-04-06 by DrAzzy One thing you're going to need to do is use Uint32Arrays. An array of 32 32 entry simple arrays will take up a bit over 2048 memory units, which is more than the espruino board has. Even with typed arrays, that's going to be like 500-something memory units. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-06 by user6837 Tryed several things always running out of memory, un the end I used a unit8array and stored everything on a 4096 lineal array and I will have to calculate the positions every time |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-07 by @gfwilliams So you have it working now? You should have some luck using 32 x Uint32Arrays (or Uint8Arrays)? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-22 by user6837 In the end I dumped the 32 X 32 bmp into Uint32Arrays, here is the code:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-22 by moka Could you please modify your post, as it looks broken :) You can extract colour data from bmp into Uint8Array on desktop computer, then using |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-23 by @gfwilliams I just edited the post - you just need to highlight the code and click the 'code' button. You can actually set the value of the Uint8Array to the string with a simple:
Which could be a bit faster for the first case. Thanks @moka - If anyone's interested there's a little bit on how to do this at the bottom of http://www.espruino.com/Graphics Having said that, a module to load Bitmaps off the SD card would be pretty cool :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-05 by user6837
Hi,
I've been trying to dump a bmp file in to an array as follows:
an array of 32 arrays of 32 arrays of 4 byte values, but have not been able to make it work, I would appreciate any help, this is what I've been trying:
The first 54 bytes have header information:
I would really appreciate any help.
Bests
Beta Was this translation helpful? Give feedback.
All reactions