我正在尝试实现一种算法来填充区域,该特定算法在以下Wikipedia文档中的“固定内存方法(右手填充方法)”标题下给出。下面给出了发生左转和右转的算法的具体部分......
START:
set count to number of non-diagonally adjacent pixels filled (front/back/left/right ONLY)
if count is not 4
do
turn right
while front-pixel is empty
do
turn left
while front-pixel is filled
end if
该声明明确指出要向右转或向左转,而不是向右或向左移动。令我困惑的是,(x,y)坐标处的像素如何转向其左侧的右侧?