Soft Paint Bucket Fill: Colour Equality

后端 未结 2 1258
自闭症患者
自闭症患者 2021-01-07 09:34

I\'m making a small app where children can fill preset illustrations with colours. I\'ve succesfully implemented an MS-paint style paint bucket using the flood fill argorith

2条回答
  •  轮回少年
    2021-01-07 10:13

    Made something that works:

                    c = b.getPixel(xx,yy);
                    if (c == to) continue;
                    if (c != from) d = 
                        Math.pow(f1 - (c & 0xFF), 2) +
                        Math.pow(f2 - (c >> 8 & 0xFF), 2) +
                        Math.pow(f3 - (c >> 16 & 0xFF), 2)
                    if (c == from || d < tres) {
    

提交回复
热议问题