(洪水填充)现有用字符标记像素颜色的8x8图像,颜色填充的操作描述
image[r][c] == prev_color
image[r][c] != prev_color
image[r][c] == new_color
image[r][c] != new_color
image[cur.r+1][cur.c] = new_color
image[cur.r][cur.c] = new_color
image[cur.r][cur.c+1] = new_color
image[cur.r][cur.c] = prev_color
Point(pt.r,pt.c)
Point(pt.r,pt.c+1)
Point(pt.r+1,pt.c)
Point(pt.r+1,pt.c+1)
prev_color=image[p,r][p.c]
new_color=image[p.r][p.c]
image[p.r][p.c]
image[p.r][p.c] = new_color
queue.push(p)
queue.push(pt)
queue.push(cur)
queue.push(Point(ROWS,COLS))