ws-apifix: F.ops.layers.flatten applies the mask of a passThrough group (codecs/image/Blend lerp takes a mask)
This commit is contained in:
1 parent
de4f14a343
commit
25d8e4ff25
3 files changed
+51
-12
No files matched your search
@@ -110,6 +110,19 @@ do
|
||||
g.opacity = 0.5
|
||||
local r3 = get(LayerOps.flatten(doc({ bottom, g })))
|
||||
t:check(math.abs(r3 - 150) <= 1, "pass-through opacity mixes before / after: " .. r3)
|
||||
-- a pass-through group's mask limits its effect: black hides it, grey mixes, outside the mask = its default
|
||||
g.opacity = 1
|
||||
local m = Types.Image.new(1, 1, "gray8")
|
||||
g.mask = { image = m, x = 0, y = 0, default = 255 }
|
||||
t:eq((get(LayerOps.flatten(doc({ bottom, g })))), 200, "pass-through: black mask hides the group")
|
||||
buffer.writeu8(m.pixels, 0, 128)
|
||||
local r4 = get(LayerOps.flatten(doc({ bottom, g })))
|
||||
t:check(math.abs(r4 - 150) <= 1, "pass-through: grey mask mixes: " .. r4)
|
||||
g.mask = { image = m, x = 3, y = 3, default = 0 }
|
||||
t:eq((get(LayerOps.flatten(doc({ bottom, g })))), 200, "pass-through: outside the mask, default black")
|
||||
g.mask.disabled = true
|
||||
t:check(math.abs(get(LayerOps.flatten(doc({ bottom, g }))) - 100) <= 1, "pass-through: disabled mask ignored")
|
||||
g.mask = nil
|
||||
end
|
||||
-- frames, leaves, flattenFrames
|
||||
do
|
||||
|
||||
Reference in new issue
Block a user