Look up Table (LuT)

For each pixel, the value is an index to search in the LuT for the real value. When you modify a value for a pixel, you modify its index. If the new value is not in LuT you :

  • add a new value to the LuT
  • make a new LuT copying the first one + the added value
  • throw something

Can also be handled by converting the LuT into a proper contiguous buffer.