我正在迭代一些从canvas
这样的图像数据中提取的图像数据:
var imageData = this.context.getImageData(0, 0, this.el.width, this.el.height);
var data = imageData.data;
for (var i = data.length; i >= 0; i -= 4) {
if (data[i + 3] > 0) {
data[i] = this.colour.R;
data[i + 1] = this.colour.G;
data[i + 2] = this.colour.B;
}
}
如何计算我所在的当前 X 和 Y 像素坐标?