I've got a coordinate surface with dimensions (800, 600) px
There is a circle on the surface with fixed radius.
How to pull out all pixels in the circle on the surface excluding circumference?
I know the simplest formula of circle (x-x0)^2 + (y-y0)^2 <= R^2.
It works, but it takes more performance for execution, because I need to go through all the values (x,y) from surface and put them to equation to comparing.
Also a little remark is that I need to get only whole pixels in circle.
I forgot one method, when are joined lines from one point of circle to another.
Considering the row of pixels between $y-1/2$ and $y+1/2$, the intersection of the circle with the slab is obtained by solving
$$(x-x_0)^2+\left(y\pm\frac12-y_0\right)^2=r^2,$$
or
$$x=x_0\pm\sqrt{r^2-\left(y\pm\frac12-y_0\right)^2}.$$
This gives you four values of $x$ and the whole pixels are found in the range
$$\left[\left\lceil \max(x_{--},x_{-+})+\frac12\right\rceil,\left\lfloor\max(x_{+-},x_{++})-\frac12\right\rfloor\right]$$
If some of the roots do not exist, then there is no useful pixel.
Note that this assumes square pixels. Round pixels would make it a little different.