1

As referenced here https://stackoverflow.com/a/8737690/5220210 I am trying to process every pixel on bitmap so I have this

int [] pixel = {0x0, 0x0, 0x0};
int [] pixels_old, pixels_new;
int [] params = {image_source.getWidth(), image_source.getHeight()};
int [] image_params = {image_source.getWidth() - 2 * anaglyph_amplitude, image_source.getHeight()};
pixels_old = new int[params[2] * params[3]];
pixels_new = new int[image_params[0] * image_params[1]];
image_source.getPixels(pixels_old, 0, params[2], 0, 0, params[2], params[3]); 
image_source = null;
for(int i = 0; i < image_params[0]; ++i)
    for(int j = 0; j < image_params[1]; ++j) {
        pixel[0] = pixels_old[i + j * params[2]];
        pixel[1] = pixels_old[i + (anaglyph_amplitude<<1) + j * params[2]];
        pixel[2] = pixel[0] + (pixel[1] & 0xFFFF) - (pixel[0] & 0xFFFF);
        pixels_new[i + j * image_params[0]] = pixel[2];
    }
pixels_old = null;
image_source = Bitmap.createBitmap(pixels_new, image_params[0], image_params[1], Bitmap.Config.ARGB_8888);
pixels_new = null;

But I dont know what is anaglyph_amplitude. Please assist me it you know. I have researched but couldn't find the meaning. Thanks

Community
  • 1
  • 1
Blaze
  • 2,269
  • 11
  • 40
  • 82

0 Answers0