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

From VFXPedia

Jump to: navigation, search

Contents


Summary

The Gamma method applies the gamma adjustment specified in the methods sole argument to every pixel in the Image. The result is applied directly to the Image object which calls the function. This function does not return a value.


Usage

Image:Gamma(number r, number g, number b, number a)

number r, g, b, a (number, required)
The amount by which to gamma the image.


Example

A very simple gamma tool.

FuRegisterClass("Gamma", CT_Tool, {
	REGS_Category = "Color\\Simple",
	REGS_OpIconString = "Gam",
	REGS_OpDescription = "Gamma",
	})
	
function Create()
	InGamma = self:AddInput("Gamma", "Gamma", {
		LINKID_DataType = "Number",
		INPID_InputControl = "SliderControl",
		INP_Default = 1.0,
		INP_MaxScale = 2.0,
		})
	
	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 gamma = InGamma:GetValue(req).Value
	
	local newimg = img:Copy()
 
	newimg:Gamma(gamma, gamma, gamma, 1)
	
	OutImage:Set(req, newimg)
end


Tips for Gamma (edit)

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