-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDynamicRangeChartReference.Fuse
More file actions
80 lines (67 loc) · 1.88 KB
/
DynamicRangeChartReference.Fuse
File metadata and controls
80 lines (67 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FuRegisterClass("DynamicRangeChartReference", CT_Tool, {
REGS_Category = "Analysis",
REGS_OpIconString = "DRCR",
REGS_OpDescription = "Generates the ideal values for a dynamic range testing chart in Linear XYZ space (Equal Energy white point)",
REG_OpNoMask = true,
REG_NoBlendCtrls = true,
REG_NoObjMatCtrls = true,
REG_NoMotionBlurCtrls = true,
})
black = Pixel({R = 0, G = 0, B = 0, A = 1})
function Create()
InPatches = self:AddInput("Patches", "Patches", {
LINKS_Name = "Stops +/- mid gray",
LINKID_DataType = "Number",
INPID_InputControl = "SliderControl",
INP_Integer = true,
INP_MaxScale = 10,
INP_MinScale = 0,
INP_Default = 10,
ICD_Center = 0,
})
InMidGray = self:AddInput("MidGray", "MidGray", {
LINKS_Name = "Middle Gray Luminance",
LINKID_DataType = "Number",
INPID_InputControl = "SliderControl",
INP_Integer = false,
INP_MaxScale = 1,
INP_MinScale = 0,
INP_Default = 0.184187,
ICD_Center = 0,
})
OutputLink = self:AddOutput("Output", "Output", {
LINKID_DataType = "Image",
LINK_Main = 1,
})
end
function Process(req)
patches = InPatches:GetValue(req).Value
mid_gray = InMidGray:GetValue(req).Value
local image_attribs = {
IMG_Width = patches*2+1,
IMG_Height = 1,
IMG_Depth = 8,
IMG_XScale = 1.0,
IMG_YScale = 1.0,
IMG_Quality = not req:IsQuick(),
IMG_MotionBlurQuality = not req:IsNoMotionBlur(),
IMG_Document = self.Comp,
{ IMG_Channel = "Red", },
{ IMG_Channel = "Green", },
{ IMG_Channel = "Blue", },
{ IMG_Channel = "Alpha", },
}
if not req:IsStampOnly() then
image_attribs.IMG_ProxyScale = 1
end
if SourceDepth ~= 0 then
image_attribs.IMG_Depth = SourceDepth
end
local output = Image(image_attribs)
output:Fill(black)
for x = 0, output.Width do
p = mid_gray * (2 ^ (x - patches))
output:SetPixel(x, 0, Pixel({R = p, G = p, B = p, A = 1}))
end
OutputLink:Set(req, output)
end