vsview-nativeres 0.3.0__tar.gz → 0.3.2__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.
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/PKG-INFO +3 -3
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/pyproject.toml +1 -1
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/src/vsview_nativeres/main.py +33 -36
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/src/vsview_nativeres/utils.py +8 -5
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/.gitignore +0 -0
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/LICENSE +0 -0
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/README.md +0 -0
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/src/vsview_nativeres/__init__.py +0 -0
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/src/vsview_nativeres/components.py +0 -0
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/src/vsview_nativeres/plotting.py +0 -0
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/src/vsview_nativeres/py.typed +0 -0
- {vsview_nativeres-0.3.0 → vsview_nativeres-0.3.2}/src/vsview_nativeres/settings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vsview-nativeres
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: A vsview plugin for analyzing and determining the native resolution of video content
|
|
5
5
|
Project-URL: Documentation, https://github.com/Jaded-Encoding-Thaumaturgy/nativeres/blob/master/src/plugin/README.md
|
|
6
6
|
Project-URL: Source Code, https://github.com/Jaded-Encoding-Thaumaturgy/nativeres/tree/master/src/plugin
|
|
@@ -38,8 +38,8 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
38
38
|
Classifier: Programming Language :: Python :: 3.14
|
|
39
39
|
Classifier: Typing :: Typed
|
|
40
40
|
Requires-Python: >=3.12
|
|
41
|
-
Requires-Dist: nativeres
|
|
42
|
-
Requires-Dist: vsview>=0.
|
|
41
|
+
Requires-Dist: nativeres>=0.2.0
|
|
42
|
+
Requires-Dist: vsview>=0.8.0
|
|
43
43
|
Description-Content-Type: text/markdown
|
|
44
44
|
|
|
45
45
|
# vsview-nativeres
|
|
@@ -2,18 +2,17 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import csv
|
|
4
4
|
import json
|
|
5
|
-
from concurrent.futures import Future
|
|
6
5
|
from itertools import zip_longest
|
|
7
6
|
from logging import getLogger
|
|
8
7
|
from math import ceil
|
|
9
8
|
from pathlib import Path
|
|
10
|
-
from typing import TYPE_CHECKING, cast
|
|
9
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
11
10
|
|
|
12
11
|
import numpy as np
|
|
13
12
|
import vapoursynth as vs
|
|
14
13
|
from jetpytools import fallback, mod2
|
|
15
14
|
from PySide6.QtCore import QSignalBlocker, QTimer, Signal
|
|
16
|
-
from PySide6.QtGui import QPalette,
|
|
15
|
+
from PySide6.QtGui import QPalette, Qt
|
|
17
16
|
from PySide6.QtWidgets import (
|
|
18
17
|
QComboBox,
|
|
19
18
|
QDoubleSpinBox,
|
|
@@ -420,7 +419,7 @@ class GetNativeTab(TabContainer, IconReloadMixin):
|
|
|
420
419
|
return getnative(
|
|
421
420
|
self.api.current_voutput.vs_output.clip,
|
|
422
421
|
frame,
|
|
423
|
-
dimensions,
|
|
422
|
+
dimensions, # type: ignore[arg-type]
|
|
424
423
|
kernel,
|
|
425
424
|
metric_mode=metric_mode,
|
|
426
425
|
progress_cb=(
|
|
@@ -432,16 +431,11 @@ class GetNativeTab(TabContainer, IconReloadMixin):
|
|
|
432
431
|
func=self.on_calculate_clicked,
|
|
433
432
|
)
|
|
434
433
|
|
|
435
|
-
|
|
436
|
-
def on_completed(f: Future[list[GetNativeResult]]) -> None:
|
|
434
|
+
def on_done(_: Any) -> None:
|
|
437
435
|
self.progress_bar.reset_progress()
|
|
438
436
|
self.calculate_btn.setEnabled(True)
|
|
439
|
-
if f.exception():
|
|
440
|
-
logger.exception("Failed to get native results")
|
|
441
|
-
return
|
|
442
|
-
|
|
443
|
-
results = f.result()
|
|
444
437
|
|
|
438
|
+
def on_success(results: list[GetNativeResult]) -> None:
|
|
445
439
|
plot = self.create_rescale_plot(title, results, dim_mode, x_label_fmt)
|
|
446
440
|
self.plot_stack.addWidget(plot)
|
|
447
441
|
self.plot_stack.setCurrentWidget(plot)
|
|
@@ -453,8 +447,15 @@ class GetNativeTab(TabContainer, IconReloadMixin):
|
|
|
453
447
|
|
|
454
448
|
self.computedPlotAdded.emit(plot)
|
|
455
449
|
|
|
456
|
-
|
|
457
|
-
|
|
450
|
+
blocker = self.api.blocker()
|
|
451
|
+
blocker.acquire()
|
|
452
|
+
(
|
|
453
|
+
get_results()
|
|
454
|
+
.add_loop_callback(on_done)
|
|
455
|
+
.map(on_success, on_loop=True)
|
|
456
|
+
.catch(lambda e: logger.exception("Failed to get native results", exc_info=e))
|
|
457
|
+
.add_done_callback(lambda _: blocker.release())
|
|
458
|
+
)
|
|
458
459
|
|
|
459
460
|
def create_rescale_plot(
|
|
460
461
|
self,
|
|
@@ -723,15 +724,7 @@ class GetScalerTab(TabContainer):
|
|
|
723
724
|
func=self.on_calculate_clicked,
|
|
724
725
|
)
|
|
725
726
|
|
|
726
|
-
|
|
727
|
-
def on_completed(f: Future[list[GetScalerResult]]) -> None:
|
|
728
|
-
self.calculate_btn.setEnabled(True)
|
|
729
|
-
if f.exception():
|
|
730
|
-
logger.exception("Failed to get scaler results")
|
|
731
|
-
return
|
|
732
|
-
|
|
733
|
-
results = f.result()
|
|
734
|
-
|
|
727
|
+
def on_success(results: list[GetScalerResult]) -> None:
|
|
735
728
|
if not results:
|
|
736
729
|
return
|
|
737
730
|
|
|
@@ -751,8 +744,15 @@ class GetScalerTab(TabContainer):
|
|
|
751
744
|
finally:
|
|
752
745
|
self.table.setUpdatesEnabled(True)
|
|
753
746
|
|
|
754
|
-
|
|
755
|
-
|
|
747
|
+
blocker = self.api.blocker()
|
|
748
|
+
blocker.acquire()
|
|
749
|
+
(
|
|
750
|
+
get_results()
|
|
751
|
+
.add_loop_callback(lambda f: self.calculate_btn.setEnabled(True))
|
|
752
|
+
.map(on_success, on_loop=True)
|
|
753
|
+
.catch(lambda e: logger.exception("Failed to get scaler results", exc_info=e))
|
|
754
|
+
.add_done_callback(lambda _: blocker.release())
|
|
755
|
+
)
|
|
756
756
|
|
|
757
757
|
|
|
758
758
|
class GetFreqTab(TabContainer):
|
|
@@ -853,16 +853,10 @@ class GetFreqTab(TabContainer):
|
|
|
853
853
|
with self.api.vs_context():
|
|
854
854
|
return get_dct_distribution(clip, frame, cull_rate)
|
|
855
855
|
|
|
856
|
-
|
|
857
|
-
def on_completed(f: Future[tuple[NpFloatArray1D, NpFloatArray1D]]) -> None:
|
|
856
|
+
def on_success(results: tuple[NpFloatArray1D, NpFloatArray1D]) -> None:
|
|
858
857
|
if request_id != self._last_request_id:
|
|
859
858
|
return
|
|
860
859
|
|
|
861
|
-
if e := f.exception():
|
|
862
|
-
logger.error("Failed to get DCT distribution: %s", e)
|
|
863
|
-
return
|
|
864
|
-
|
|
865
|
-
results = f.result()
|
|
866
860
|
new_plot = self.create_freq_plot(title, results, clip)
|
|
867
861
|
|
|
868
862
|
if self.plot:
|
|
@@ -873,8 +867,14 @@ class GetFreqTab(TabContainer):
|
|
|
873
867
|
self.canvas.setCurrentWidget(new_plot)
|
|
874
868
|
self.plot = new_plot
|
|
875
869
|
|
|
876
|
-
|
|
877
|
-
|
|
870
|
+
blocker = self.api.blocker()
|
|
871
|
+
blocker.acquire()
|
|
872
|
+
(
|
|
873
|
+
get_results()
|
|
874
|
+
.map(on_success, on_loop=True)
|
|
875
|
+
.catch(lambda e: logger.exception("Failed to get DCT distribution", exc_info=e))
|
|
876
|
+
.add_done_callback(lambda _: blocker.release())
|
|
877
|
+
)
|
|
878
878
|
|
|
879
879
|
def create_freq_plot(
|
|
880
880
|
self, title: str, results: tuple[NpFloatArray1D, NpFloatArray1D], clip: vs.VideoNode
|
|
@@ -928,10 +928,7 @@ class NativeResPlugin(WidgetPluginBase[GlobalSettings, LocalSettings]):
|
|
|
928
928
|
self.tabs.addTab(self.tab_getfreq, "Get Frequencies")
|
|
929
929
|
|
|
930
930
|
main_layout.addWidget(self.tabs)
|
|
931
|
-
|
|
932
|
-
def showEvent(self, event: QShowEvent) -> None:
|
|
933
931
|
warmup_plots()
|
|
934
|
-
return super().showEvent(event)
|
|
935
932
|
|
|
936
933
|
# Plugin hooks
|
|
937
934
|
def on_current_voutput_changed(self, voutput: VideoOutputProxy, tab_index: int) -> None:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import importlib
|
|
2
|
+
import threading
|
|
2
3
|
from collections.abc import Iterator
|
|
3
4
|
from inspect import isabstract
|
|
4
5
|
from logging import getLogger
|
|
@@ -10,6 +11,7 @@ from vsview.api import run_in_background
|
|
|
10
11
|
logger = getLogger(__name__)
|
|
11
12
|
|
|
12
13
|
QCHART_IMPORTED = False
|
|
14
|
+
LOCK = threading.Lock()
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
@run_in_background(name="WarmupImportPlots")
|
|
@@ -17,11 +19,12 @@ def warmup_plots() -> None:
|
|
|
17
19
|
"""Warmup import of QChart to avoid long startup times."""
|
|
18
20
|
global QCHART_IMPORTED
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
with LOCK:
|
|
23
|
+
if not QCHART_IMPORTED:
|
|
24
|
+
QCHART_IMPORTED = True
|
|
25
|
+
logger.debug("Importing Plots")
|
|
26
|
+
importlib.import_module("nativeres.plotting")
|
|
27
|
+
logger.debug("Importing Plots done")
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
def get_edge_detect_classes() -> Iterator[type[EdgeDetect]]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|