< Previous | Contents | Next >
Name | Type : Description |
OFCD_DisplayXScale | numeric : The value displayed in the offset control for the X axis will be multiplied by the number provided here. |
OFCD_DisplayYScale | numeric : The value displayed in the offset control for the X axis will be multiplied by the number provided here. See the effect of the Merge and Transform tools reference inputs on the Size input for an example of the effect of these attributes. |
INP_DefaultX | numeric : The default value to use for the X coordinate. |
INP_DefaultY | numeric : The default value to use for the Y coordinate. |
The following example is a very simplified Fuse which uses a crosshair to transform an image.
FuRegisterClass("SampleOffset", CT_Tool, { REGS_Category = "Fuses\\Samples", REGS_OpIconString = "SOf", REGS_OpDescription = "SampleOffset",
})
function Create()
InCenter = self:AddInput("Center", "Center", { LINKID_DataType = "Point", INPID_InputControl = "OffsetControl", INPID_PreviewControl = "CrosshairControl",
})

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
= InImage:GetValue(req)
local center = InCenter:GetValue(req)
out = img:Transform(nil, { XF_XOffset = center.X, XF_YOffset = center.Y, XF_XAxis = 0.5,
XF_YAxis = 0.5,
XF_XSize = 1,
XF_YSize = 1,
XF_Angle = 0, XF_EdgeMode = "Black",
})
OutImage:Set(req, out)
end