1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
$(if (not no_procedure) or (no_procedure == 1) then
OUT=[[
//
// Function to run the Execute method of this filter
//
Image ${name:gsub("ImageFilter$", ""):gsub("Filter$", "")} ( $(include ImageParameters.in)$(include InputParameters.in)$(include MemberParameters.in) )
{
${name} filter;
return filter.Execute ( $(for inum=1,number_of_inputs do
if inum>1 then
OUT=OUT..', '
end
OUT=OUT .. 'image' .. inum
end
local count = number_of_inputs
if inputs then
for inum=1,#inputs do
if not (inputs[inum].optional and no_optional) then
if count>0 then
OUT = OUT .. ", "
end
count = count + 1
OUT=OUT..inputs[inum].name:sub(1,1):lower() .. inputs[inum].name:sub(2,-1)
end
end
end
for i = 1,#members do
if count > 0 then
OUT = OUT .. ", "
end
count = count + 1
OUT= OUT .. members[i].name:sub(1,1):lower() .. members[i].name:sub(2,-1)
end) );
}
]]
end)$(if inputs and ((not no_procedure) or (no_procedure == 1))then
local has_optional_inputs = false
for i =1,#inputs do
if inputs[i].optional then
has_optional_inputs=inputs[i].optional
end
end
if has_optional_inputs and not no_optional then
no_optional=1
-- we recusively include this same template file but with the no_optional variable defined
OUT=[[
$(include FunctionalAPI.cxx.in)]]
end
end)$(if inputs then no_optional=nil end)
|