protected override void ThreadMission_Pixel(int i, int j) { int index = SWTextureProcess.XYtoIndex(texWidth, texHeight, i, j); texColorBuffer [index] = new Color( 0, 1 - texColorBuffer [index].g, 0, 1 - texColorBuffer [index].a); }
protected override void ThreadMission_Pixel(int i, int j) { base.ThreadMission_Pixel(i, j); var cc = texSrcColorBuffer[(texSrcHeight - j - 1) * texSrcWidth + i]; float m = SWTextureProcess.Match(cc, colors); if (m <= tolerance) { //Vector2 _uv = TexUV (t_Width, t_Height, i, j); int index = SWTextureProcess.XYtoIndex(texSrcWidth, texSrcHeight, i, j); SWTextureProcess.Brush_ApplyOnce(ref texColorBuffer[index], brush, 0); } }
void PerPixel(PixelCom p) { map [p.x, p.y] = 2; int index = SWTextureProcess.XYtoIndex(texSrcWidth, texSrcHeight, p.x, p.y); float m = SWTextureProcess.Match(texSrcColorBuffer [index], texSrcColorBuffer [p.colorFrom]); if (m <= tolerance) { SWTextureProcess.Brush_ApplyOnce(ref texColorBuffer [index], brush, 0); AddTask(p.x + 1, p.y, index); AddTask(p.x - 1, p.y, index); AddTask(p.x, p.y - 1, index); AddTask(p.x, p.y + 1, index); } }
void ThreadMission_Pixel2(int i, int j) { int index = SWTextureProcess.XYtoIndex(texWidth, texHeight, i, j); Vector2 uv = SWTextureProcess.TexUV(texWidth, texHeight, i, j); Color c = texColorBuffer [index]; float dis = offset.magnitude * threhold; float alpha = -1; for (float v = 0; v < 1; v += 0.01f) { Vector2 newUV = uv + dirHor * v * dis; int newIndex = SWTextureProcess.TexUV2Index(texWidth, texHeight, newUV); Color newC = texColorBuffer[newIndex]; if (newC.a == 0) { alpha = v; break; } newUV = uv - dirHor * v * dis; newIndex = SWTextureProcess.TexUV2Index(texWidth, texHeight, newUV); newC = texColorBuffer[newIndex]; if (newC.a == 0) { alpha = v; break; } } // if (alpha < 0.5f) // alpha = 0; if (alpha >= 0) { texColorBuffer [index] = new Color(c.r, c.g, c.b, c.a * alpha); } }