This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
pixelSpacing tells how many pixels to skip each pixel. | |
If pixelSpacing > 1: the average color is an estimate, but higher values mean better performance | |
If pixelSpacing == 1: the average color will be the real average | |
If pixelSpacing < 1: the method will most likely crash (don't use values below 1) | |
*/ | |
public int calculateAverageColor(android.graphics.Bitmap bitmap, int pixelSpacing) { | |
int R = 0; int G = 0; int B = 0; | |
int height = bitmap.getHeight(); | |
int width = bitmap.getWidth(); |