Hi All - looking for suggestions - I'm porting a piece of code that
extensively uses java awt MemoryImageSource & IndexColorModel objects
to efficiently transform a bitmap made up of (int)pixels[w*h] custom
color's into (int)pixels[w*h] RGB colors.
in a nutshell, if color#1 = blue and:
if pixels[1] = blue - set pixels[1] = 11111111000000000000000011111111
(blue in argb)
I'm currently doing it like this, but it's slow:
public int loresColor[] = {
(int)(0x000000), (int)(0xff00ff), (int)(0x00007f), (int)
(0x7f007f),
(int)(0x007f00), (int)(0x7f7f7f), (int)(0x0000bf), (int)
(0x0000ff),
(int)(0xbf7f00), (int)(0xffbf00), (int)(0xbfbfbf), (int)
(0xff7f7f),
(int)(0x00ff00), (int)(0xffff00), (int)(0x00bf7f), (int)
(0xffffff),
};
for (int i = 0; i < 280*192; i++) {
//if (pixels[i] > 0) mpixels[i] = (255 << 24) | (255 << 8);
mpixels[i] = 0;
if (pixels[i] > 0) mpixels[i] = (255 << 24) | loresColor[pixels[i]];
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---