I can get the r,g,b values using the following functions.
int rgb=bImg.getRGB(i, j);
int r=(rgb>>16) & 0xff;
int g=(rgb>>8) & 0xff;
int b=(rgb) & 0xff;
Now I do some operations in on those values and want to set the rgb values using the following function
bImg.setRgb(int x,int y,int rgb)
But i do not know how to calculate rgb from R,G,B values.