< Previous | Contents | Next >

FuRegisterClass("SimpleSaturate", CT_Tool, { REGS_Category = "Fuses\\Examples", REGS_OpIconString = "SSt", REGS_OpDescription = "SimpleSaturate",
})
function Create()
InSat = self:AddInput("Saturation", "Saturation", { LINKID_DataType = "Number", INPID_InputControl = "SliderControl", INP_Default = 1.0,
})
InImage = self:AddInput("Input", "Input", { LINKID_DataType = "Image", LINK_Main = 1,
})
OutImage = self:AddOutput("Output", "Output", { LINKID_DataType = "Image",
LINK_Main = 1,
})
end
function Process(req)
local img
local sat
= InImage:GetValue(req)
= InSat:GetValue(req).Value
local newimg = img:Copy()
newimg:Saturate(sat, sat, sat) -- This could also desaturate a single color
A very simple saturate tool.