Pages

Pages

Thursday, 27 March 2014

cvbcvbcv

private ArrayList getAvgPixelsList(Bitmap bmp, int stepX, int stepY) { int xStepsCount = bmp.getWidth() / stepX; int yStepsCount = bmp.getHeight() / stepY; ArrayList res = new ArrayList<>(xStepsCount * yStepsCount); for (int y = 0; y < yStepsCount; y++) { for (int x = 0; x < xStepsCount; x++) { res.add(new int[] {x * stepX, y * stepY, getAvgColor(bmp, x, y, stepX, stepY)}); } } return res;