@@ -172,39 +172,39 @@ end
172172
173173
174174function Process(req)
175- local src = InImage:GetValue(req)
176- local dst = Image{ IMG_Like = src, IMG_DeferAlloc = true }
177-
178- if not req:IsPreCalc() then
179- local node = DVIPComputeNode(req, "SolidKernel", SolidKernel, "SolidParams", SolidParams)
180- local params = node:GetParamBlock(SolidParams)
181-
182- params.hexagonal = InHexagonal:GetValue(req).Value
183- params.threshold_r = InThresholdR:GetValue(req).Value
184- params.threshold_g = InThresholdG:GetValue(req).Value
185- params.threshold_b = InThresholdB:GetValue(req).Value
186- params.power = InPower:GetValue(req).Value
187- params.shd_rolloff = InShdRolloff:GetValue(req).Value
188- params.cyan = InCyan:GetValue(req).Value
189- params.magenta = InMagenta:GetValue(req).Value
190- params.yellow = InYellow:GetValue(req).Value
191- params.invert = InInvert:GetValue(req).Value
192- params.srcCompOrder = src:IsMask() and 1 or 15
193-
194- node:SetParamBlock(params)
195-
196- node:AddInput("src", src)
197- node:AddOutput("dst", dst)
198-
199- local ok = node:RunSession(req)
200-
201- if not ok then
202- dst = nil
203- end
204-
205- end
175+ local src = InImage:GetValue(req)
176+ local dst = Image{ IMG_Like = src, IMG_DeferAlloc = true }
177+
178+ if not req:IsPreCalc() then
179+ local node = DVIPComputeNode(req, "SolidKernel", SolidKernel, "SolidParams", SolidParams)
180+ local params = node:GetParamBlock(SolidParams)
181+
182+ params.hexagonal = InHexagonal:GetValue(req).Value
183+ params.threshold_r = InThresholdR:GetValue(req).Value
184+ params.threshold_g = InThresholdG:GetValue(req).Value
185+ params.threshold_b = InThresholdB:GetValue(req).Value
186+ params.power = InPower:GetValue(req).Value
187+ params.shd_rolloff = InShdRolloff:GetValue(req).Value
188+ params.cyan = InCyan:GetValue(req).Value
189+ params.magenta = InMagenta:GetValue(req).Value
190+ params.yellow = InYellow:GetValue(req).Value
191+ params.invert = InInvert:GetValue(req).Value
192+ params.srcCompOrder = src:IsMask() and 1 or 15
193+
194+ node:SetParamBlock(params)
195+
196+ node:AddInput("src", src)
197+ node:AddOutput("dst", dst)
206198
207- OutImage:Set(req, dst)
199+ local ok = node:RunSession(req)
200+
201+ if not ok then
202+ dst = nil
203+ end
204+
205+ end
206+
207+ OutImage:Set(req, dst)
208208end
209209
210210
@@ -255,9 +255,9 @@ SolidKernel = [[
255255
256256 // thr is the percentage of the core gamut to protect: the complement of threshold.
257257 float3 thr = make_float3(
258- _fmaxf(0.0001f, 1.0f- params->threshold_r),
259- _fmaxf(0.0001f, 1.0f- params->threshold_g),
260- _fmaxf(0.0001f, 1.0f- params->threshold_b));
258+ 1.0f- _fmaxf(0.0001f, params->threshold_r),
259+ 1.0f- _fmaxf(0.0001f, params->threshold_g),
260+ 1.0f- _fmaxf(0.0001f, params->threshold_b));
261261
262262 // lim is the max distance from the gamut boundary that will be compressed
263263 // 0 is a no-op, 1 will compress colors from a distance of 2.0 from achromatic to the gamut boundary
0 commit comments