Mip-flooding an image

The central function of libmipflooding is processing an image using the Mip Flooding algorithm. There two ways to flood an image:

Using the flood_image() function

All APIs

which takes an input image, an optional coverage mask, a number of processing options, and outputs a mip-flooded image

Executing the subroutines manually

C++/C API

Calling them in this order:

  1. convert_and_scale_down_weighted()
    which processes the input image and scales it down to half its size
  2. scale_down_weighted() in a loop,
    halving the resolution in each iteration, until one side reaches 1px
  3. composite_up() in a loop,
    which composites mip levels together in pairs, starting with the smallest
  4. final_composite_and_convert()
    which doubles the resolution of the largest mip, and composites it with the original image

Subroutines: