I need efficient fill algorithm to fill closed polygons (like ex. Scanline fill), which I can run on CUDA. Have you got any suggestions?
Thanks in advance for any replays!
I need efficient fill algorithm to fill closed polygons (like ex. Scanline fill), which I can run on CUDA. Have you got any suggestions?
Thanks in advance for any replays!
Thrust has a really good scanning algorithm, but only along single line. You may need to extend it a bit to work with images. Assuming edges are 1 and 0 everywhere else, all you need to do is perform a prefix sum on the image. Once the prefix sum is complete, all you need to do is fill the areas where the sum is Odd.