func (i *Image) At(x, y int) (byte, byte, byte, byte) {
	w, h := i.image.Size()
	if x < 0 || y < 0 || w <= x || h <= y {
		return 0, 0, 0, 0
	}

	i.readPixelsFromGPUIfNeeded()

	// Even after readPixelsFromGPU, basePixels might be nil when OpenGL error happens.
	if i.basePixels == nil {
		return 0, 0, 0, 0
	}

	idx := 4*x + 4*y*w
	return i.basePixels.At(idx), i.basePixels.At(idx + 1), i.basePixels.At(idx + 2), i.basePixels.At(idx + 3)
}
func (i *Image) At(x, y int) (byte, byte, byte, byte) {
	w, h := i.image.Size()
	if x < 0 || y < 0 || w <= x || h <= y {
		return 0, 0, 0, 0
	}

	i.readPixelsFromGPUIfNeeded()

	
	if i.basePixels == nil {
		return 0, 0, 0, 0
	}

	idx := 4*x + 4*y*w
	return i.basePixels.At(idx), i.basePixels.At(idx + 1), i.basePixels.At(idx + 2), i.basePixels.At(idx + 3)
}
func ( i * Image ) At ( x , y int ) ( byte , byte , byte , byte ) { w , h := i . image . Size ( ) if x < 0 || y < 0 || w <= x || h <= y { return 0 , 0 , 0 , 0 } i . readPixelsFromGPUIfNeeded ( ) // Even after readPixelsFromGPU, basePixels might be nil when OpenGL error happens. if i . basePixels == nil { return 0 , 0 , 0 , 0 } idx := 4 * x + 4 * y * w return i . basePixels . At ( idx ) , i . basePixels . At ( idx + 1 ) , i . basePixels . At ( idx + 2 ) , i . basePixels . At ( idx + 3 ) }
// At returns a color value at (x, y).
//
// Note that this must not be called until context is available.
At returns a color value at ( x y ) . Note that this must not be called until context is available .