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

From VFXPedia

< Eyeon:Script | Reference | Applications | Fuse | Classes | Image
Revision as of 15:14, 26 November 2007 by Izyk (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents


Summary

The Fill method will fill the image with the color specified by the Pixel object provided as its sole argument..


Usage

img:Fill(object pixel)

object (pixel, required)
This argument should be set to a pixel object.


Example

FuRegisterClass("SampleFill", CT_Tool, {
	REGS_Category = "Fuses\\Samples",
	REGS_OpIconString = "Fill",
	REGS_OpDescription = "Fill Example Fuse",
	REG_OpNoMask = true,
	REG_NoBlendCtrls = true,
	REG_NoObjMatCtrls = true,
	REG_NoMotionBlurCtrls = true,
	})
 
function Create()
	InBlank = self:AddInput(" ", "Blank", {
		LINKID_DataType = "Number",
		INPID_InputControl = "LabelControl",
		INP_External = false,
		})
 
	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) 
	img = InImage:GetValue(req)
	
	p = Pixel({R = 0.5, G = 0.2, B = 0, A = 1})
	
	out = Image({IMG_Like = img})
	out:Fill(p)
 
	OutImage:Set(req, out)
end


Tips for Fill (edit)

Fill() will also change the canvas color of an image. If you just want to fill the image (inside its DoD) and preserve the canvas color, you need to save it first using GetCanvasColor() and restore it afterwards using SetCanvasColor().