Beispiel #1
0
        private void fillPixels()
        {
            filler fill = new filler(pixels, width, total);

            for (int i = 0; i < bufferSize; i++)
            {
                fill.getBounds(buffer[i]);
            }
            int count = 0;

            for (int i = 0; i < bufferSize; i++)
            {
                if (buffer[i] + width < total && !pixels[buffer[i] + width].selected && pixels[buffer[i] + width].value >= VALUE_THRESHOLD)
                {
                    fill.start(buffer[i] + width);
                    List <pathDirection> whitePixels = fill.getPath();
                    if (whitePixels.Count != 0)
                    {
                        //j once was i, not sure how this wasn't an issue in c++
                        //but reassigning i here may have slowed things down a lot

                        for (int j = 0; j < whitePixels.Count; j++)
                        {
                            buffer.Add(whitePixels[j].id);
                            tree.insert(buff, whitePixels[j].id);
                            count++;
                        }
                    }
                }
            }
            fill.clearFoundBuffer();
            bufferSize += count;
        }
        private void fillpixels()
        {
            filler fill = new filler(p, width, total);

            buffersize += fill.run(buffer, buffersize, buff);
        }