< Previous | Contents | Next >

Example

The following example is the process() event from the Fuse.


edge_modes = {"Black", "Canvas", "Wrap", "Duplicate"}


function Process(req)

local img = InImage:GetValue(req) local center = InCenter:GetValue(req) local pivot = InPivot:GetValue(req) local sizex = InSizeX:GetValue(req).Value local sizey = InSizeY:GetValue(req).Value local angle = InAngle:GetValue(req).Value local edges = InEdges:GetValue(req).Value


if locked then

sizey = sizex

end


out = img:Transform(nil, { XF_XOffset = center.X, XF_YOffset = center.Y, XF_XAxis = pivot.X, XF_YAxis = pivot.Y, XF_XSize = sizex, XF_YSize = sizey, XF_Angle = angle,

XF_EdgeMode = edge_modes[edges+1],

})


OutImage:Set(req, out)

end