--@TBCONFIG INFO: Contrast Luminance Map
--@TBCONFIG INFO: Revision 1
--@TBCONFIG INFO:  
--@TBCONFIG SLIDER: Strength, 40
--@TBCONFIG FLAG: Post Levels, true
--@TBCONFIG FLAG: Post Histo Stretch, false



paint_open(0)

paint_buffer_from_layer(0)

paint_filter("Grayscale",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
paint_filter("Surface Blur",0,1000,1000,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0)
paint_filter("Negative",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

paint_buffer_from_layer(1)
paint_buffer_to_layer(0)
paint_buffer_merge_layer(1, MERGE_HSL_LUM, sliderVal1 * 128)

if flagVal1 == true then
  paint_filter("Levels",0,0,1000,0,1000,0,0,0,0,1,1,1,0,1,0,0,0,0,0)
--  paint_filter("Adjust HSL",0,500,500 - (sliderVal1 * 350),500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  paint_filter("Adjust HSL",0,500,500 - (sliderVal1 * 300),500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
end

if flagVal2 == true then
  paint_filter("Histogram Stretch",0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
end

paint_close()




