unfortunately I'm trying to create Bitmap object, from not typical data source ...
- I'm painting map tiles onto screen (tiles are 120 x 120px - 14400px)
- from map file with tiles I obtain
1. palette - array of int int - 256 colors
2. image data, deflated by ZLIB, after decopress (by Inflater) i receive 14400b array of byte, that contain indexes of colors in color array
currently i'm not using JNI so to create Bitmap I use this code:
- so, after loading image data, I have to create new array filled with right color for every pixel. This is very slow (cycle with 14400 computes for every image). I'm testing it on motorola milestone and cause of big resolution, I need around 40 images to cover whole screen. Because this is map application, so you move with tiles, this method is very slow. Because I'm not much familiar with C++, I'm asking if anyone have any idea how to make it faster, probably with using of JNI.
- best solution should be direct creating of Bitmap from palette and compressed datas, but this is surely not in API. I also tryed to create PNG image (directly from loaded bytes) which have similar PLTE and IDAT part, but this IDAT do not containg filter byte '0' in every image row.
any suggestions are very very welcome, thank you ...