我有如下的Swift代码。
let resolution = [imageView.frame.size.width, imageView.frame.size.height]
for x in 0...Int(resolution[0]) {
for y in 0...Int(resolution[1]) {
let coordinate = [x, y]
//Find the colour of the pixel here
}
}
我希望能够找到照片中每个像素所显示的颜色。是否有一种方法可以修改代码,在我放置“//Find the colour of the pixel here”处,以便打印出由常数坐标表示的坐标处像素的RGB值?