vsview-split-planes 0.4.0__tar.gz → 0.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: vsview-split-planes
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: A vsview plugin displaying video clips' constituent planes
5
5
  Project-URL: Documentation, https://jaded-encoding-thaumaturgy.github.io/vs-view/plugins/second-party/#split-planes
6
6
  Project-URL: Source Code, https://github.com/Jaded-Encoding-Thaumaturgy/vs-view/tree/main/src/plugins/split-planes
@@ -5,8 +5,8 @@ from jetpytools import fallback
5
5
  from pydantic import BaseModel
6
6
  from PySide6.QtCore import QSignalBlocker, QTimer, Slot
7
7
  from PySide6.QtWidgets import QBoxLayout, QDoubleSpinBox, QHBoxLayout, QLabel, QVBoxLayout, QWidget, QWidgetAction
8
- from vapoursynth import VideoNode
9
- from vstools import scale_mask, stack_planes
8
+ from vapoursynth import ColorFamily, SampleType, VideoNode
9
+ from vstools import Range, scale_mask, stack_planes
10
10
 
11
11
  from vsview.api import (
12
12
  Checkbox,
@@ -191,9 +191,21 @@ class SplitPlanesView(PluginGraphicsView):
191
191
  else:
192
192
  offset = offset_chroma
193
193
 
194
+ shift_float_chroma = self.settings.global_.shift_float_chroma
195
+
196
+ if (
197
+ shift_float_chroma
198
+ and clip.format.color_family == ColorFamily.YUV
199
+ and clip.format.sample_type == SampleType.FLOAT
200
+ ):
201
+ full = clip.std.Expr(["", "x 0.5 +"])
202
+ limited = clip.std.Expr(["", "x 0.5 + 224 219 / *"])
203
+ clip = full.std.FrameEval(lambda n, f: limited if Range.from_video(f).is_limited else full, prop_src=clip)
204
+ shift_float_chroma = False
205
+
194
206
  return stack_planes(
195
207
  clip,
196
- self.settings.global_.shift_float_chroma,
208
+ shift_float_chroma,
197
209
  offset,
198
210
  self.settings.global_.mode,
199
211
  self.settings.global_.write_plane_name,