绘制实心圆的快速算法? [英] fast algorithm for drawing filled circles?

查看:30
本文介绍了绘制实心圆的快速算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Bresenham 圆算法 来快速绘制圆.但是,我也想(应用户的要求)画一个实心圆.

I am using Bresenham's circle algorithm for fast circle drawing. However, I also want to (at the request of the user) draw a filled circle.

有没有快速有效的方法来做到这一点?与 Bresenham 相同的东西?

Is there a fast and efficient way of doing this? Something along the same lines of Bresenham?

我使用的语言是 C.

推荐答案

已阅读 Bresenham 上的维基百科页面(也是中点")圆算法,看起来最简单的事情是修改它的动作,而不是

Having read the Wikipedia page on Bresenham's (also 'Midpoint') circle algorithm, it would appear that the easiest thing to do would be to modify its actions, such that instead of

setPixel(x0 + x, y0 + y);
setPixel(x0 - x, y0 + y);

类似,每次你都这样做

lineFrom(x0 - x, y0 + y, x0 + x, y0 + y);

也就是说,对于 Bresenham 想让你绘图的每一对点(具有相同的y),你改为用一条线连接强>.

That is, for each pair of points (with the same y) that Bresenham would you have you plot, you instead connect with a line.

这篇关于绘制实心圆的快速算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆