Skip to content

Commit

Permalink
Fix split view crash on float YUV (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed May 12, 2024
2 parents 76d99b9 + 12b4138 commit 73fc7bb
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions vspreview/plugins/split_view.ppy
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,13 @@ class SplitPlanesViewPlugin(MappedNodesViewPlugin):
if node.format.color_family is vs.GRAY:
return node

planes = split(node)

if node.format.sample_type is vs.FLOAT:
fmt = node.format.replace(bits_per_sample=32)
node = depth(node, 32)

if node.format.color_family is vs.YUV:
planes = [
plane.std.Expr('x 0.5 +' if i else 'x', fmt)
for i, plane in enumerate(planes)
]
elif node.format.bits_per_sample != 32:
planes = [depth(plane, fmt) for plane in planes]

planes = [c.text.Text(text=k) for k, c in zip(node.format.name, planes)]
node = node.std.Expr(['x', 'x 0.5 +'])

planes = [c.text.Text(text=k) for k, c in zip(node.format.name, split(node))]

subsampling = node.format.subsampling_w, node.format.subsampling_h

Expand Down

0 comments on commit 73fc7bb

Please sign in to comment.