How to make luma of pixels dependent on the hue, with user-controllable curves?
I'm trying to build a patch where:
1) a camera feed comes in and is converted to HSL
2) the luma is set to the same value for all pixels (0.5)
3) a new luma is calculated based on the hue (brighten red & blue, dim yellow & cyan)
I want the user interface to display a hue rainbow, with a multislider underneath that lets the user "draw" the brightness curve.
I see that I probably want to use something like jit.rbg2hsl, then jit.unpack, apply a jit.charmap to the Hue plane, and then use jit.pack to put everything back together, except the transformed Hue plane replaces the Luma plane.
However, I'm stuck with one thing:
I would like to generate a hue rainbow, displayed in a pwindow. I can't seem to figure out how to do it.
You can do it programmatically, but a quick workaround:
--make a big [swatch] and take a screenshot
--crop out everything but the middle strip, where the hue is the most saturated
--save that as an image
--use it in your patch as an [fpic] and put a [suckah] over it. voila, user-selectable rainbow colors!