【发布时间】:2019-11-05 00:52:46
【问题描述】:
我需要遍历位图图像的每个像素,这是我的代码,但是太慢了
Bitmap img=......;
int imgWidth = img.getWidth();
int imgHeight = img.getHeight();
for (int i = 0; i < imgWidth; i++) {
for (int j = 0; j < imgHeight; j++) {
int color = img.getPixel(i, j);
int R = android.graphics.Color.red(color);
int G = android.graphics.Color.green(color);
int B = android.graphics.Color.blue(color);
// do something
}
}
【问题讨论】:
标签: java android image-processing nested-loops divide-and-conquer