Eyeon:Script/Reference/Applications/Fuse/Classes/Image/MergeOf

From VFXPedia

Jump to: navigation, search

Contents


Summary

The MergeOf method will merge a FG image over the Image calling the method, and returns a new Image containing the result. This is different from Image:Merge in that a new image is produced. The foreground image can also be offset, scaled and rotated. This function supports all of the apply modes and operations supported by the Merge tool.


Usage

image new_image = Image:MergeOf(image fg, table attributes)

fg (Image, required)
The Image to be used as the foreground of the merge.
attributes (table, required)
A table containing entries which describe how the foreground will be merged over the background. All values are optional, and an empty table will perform a default Additive merge of the foreground over the background. Valid entries include
  • MO_EdgeMode
    • "Black"
    • "Wrap"
    • "Duplicate"
  • MO_ApplyMode
    • "Merge"
    • "Screen"
    • "Dissolve"
    • "Multiply"
    • "Overlay"
    • "SoftLight"
    • "HardLight"
    • "ColorDodge"
    • "ColorBurn"
    • "Darken"
    • "Lighten"
    • "Difference"
    • "Exclusion"
    • "Hue"
    • "Saturation"
    • "Color"
    • "Luminosity"
  • MO_ApplyOperator
    • "Over"
    • "In"
    • "HeldOut"
    • "Atop"
    • "XOr"
  • MO_DoZ
  • MO_UseOpenGL
  • MO_MustDoCopy
  • MO_BBoxOnly
  • MO_FgZOffset
  • MO_BgZOffset
  • MO_XOffset
  • MO_YOffset
  • MO_XAxis
  • MO_YAxis
  • MO_XSize
  • MO_YSize
  • MO_Angle
  • MO_FgAddSub
  • MO_BgAddSub
  • MO_BurnIn
  • MO_FgRedGain
  • MO_FgGreenGain
  • MO_FgBlueGain
  • MO_FgAlphaGain
  • MO_BgAlphaGain


Example

This simple example Fuse additively merges the FG over the BG and provides no further options.

FuRegisterClass("SimpleMerge", CT_Tool, {
	REGS_Category = "Fuses\\Samples",
	REGS_OpIconString = "SMrg",
	REGS_OpDescription = "Simple Merge",
	})
 
function Create()
	
	InBackground = self:AddInput("Background", "Background", {
		LINKID_DataType = "Image",
		LINK_Main = 1,
		})
 
	InForeground = self:AddInput("Foreground", "Foreground", {
		LINKID_DataType = "Image",
		LINK_Main = 2,
		})
 
	OutImage = self:AddOutput("Output", "Output", {
		LINKID_DataType = "Image",
		LINK_Main = 1,
		})				
end
 
 
function Process(req) 
	local bg = InBackground:GetValue(req)
	local fg = InForeground:GetValue(req)
	
	out = bg:MergeOf(fg, {MO_ApplyMode = "Merge"})
	
	OutImage:Set(req, out)
end


Tips for MergeOf (edit)

EyeonTips:Script/Reference/Applications/Fuse/Classes/Image/MergeOf