I have been rebuilding the ImageJ library so that it is compatible with android. I am stuck on one of the constructors in PixelGrabber. Bare in mind that I have rebuilt the ImageJ and the awt library so that it takes Bitmap.
My class ColorProcessor constructor
public ColorProcessor(Bitmap img) {
width = img.getWidth();
height = img.getHeight();
pixels = new int[width * height];
PixelGrabber pg = new PixelGrabber(img, 0, 0, width, height, pixels, 0, width);
try {
pg.grabPixels();
} catch (InterruptedException e){};
createColorModel();
fgColor = 0xff000000; //black
resetRoi();
}
Creates an object from PixelGrabber class. Here is the constructor for that.
public PixelGrabber(Bitmap img, int x, int y, int w, int h, int[] pix,
int off, int scansize) {
this(img.getSource(), x, y, w, h, pix, off, scansize);
}
There is a red line under getSource(). This code was designed for the JRE so this getSource is referring to java.awt.Image abstract class. Does anyone know what I can replace img.getSource with? Any help would be much appreciated.