hello i have the following code:
totalPixels = imageHeight * imageWidth
regionsData = UnsafeMutablePointer<UInt16>.allocate(capacity: totalPixels)
let pixelColor = regionsData.advanced(by: (pixelY * imageWidth) + pixelX).pointee
where pixelColor is returning 0, this is supposed to color parts of an image when i tap on the screen, but for some reason it is not working, and of course i think the reason is because pixelColor = 0 and note that the other values are not 0 (totalPixels, pixelY, pixelX, ...) any help is appreciated.